Skip to main content
POST
Create user

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

organizationId
string
required

Required. String. Identifies the organization the user is added to. Accepts either the organization's internal ID (32-character hexadecimal string) or its externalSourceId (the string an integration set on the organization). This endpoint supports externalId: when the value has the format of an internal ID and an organization with that ID exists, the internal ID takes precedence; otherwise the value is looked up as externalSourceId.

Query Parameters

sendInvitationMail
boolean

Optional. Boolean. true sends the new user an invitation email, false doesn't (unless the organization's user setup invites every new user). When left out, the user is invited only if the calling client application sends invitations for activated organizations and the organization is activated.

Body

application/json

A new user of an organization. The properties have the same names and formats as in the list response, so a listed user can be posted as is: null for an optional property means it isn't set, and the read-only properties id, lastInvitationDate and dateCreated are ignored. email, firstName, lastName, externalSourceId, employeeId, title, mobilePhone and bankAccountNumber can be at most 255 characters long after leading and trailing whitespace is removed, and a text dimension's presetStringValue at most 255 characters; a longer value is rejected with 400 FIELD_EXCEEDS_MAX_LENGTH. Unless a property states otherwise, the other string properties have no validated length or pattern.

email
string<email>
required

Required. String. The user's email address, also used to log in. No other user of the organization may have it; a deleted user's email address can be reused. At most 255 characters after leading and trailing whitespace is removed, otherwise 400 FIELD_EXCEEDS_MAX_LENGTH.

Maximum string length: 255
firstName
string
required

Required. String. The user's first name. At most 255 characters after leading and trailing whitespace is removed, otherwise 400 FIELD_EXCEEDS_MAX_LENGTH.

Maximum string length: 255
lastName
string
required

Required. String. The user's last name. At most 255 characters after leading and trailing whitespace is removed, otherwise 400 FIELD_EXCEEDS_MAX_LENGTH.

Maximum string length: 255
externalSourceId
string | null

Optional. String. Identifier of the user in an external system. No other user of the organization may have it. At most 255 characters after leading and trailing whitespace is removed, otherwise 400 FIELD_EXCEEDS_MAX_LENGTH.

Maximum string length: 255
employeeId
string | null

Optional. String. The user's employee number in the organization. No other user of the organization may have it. At most 255 characters after leading and trailing whitespace is removed, otherwise 400 FIELD_EXCEEDS_MAX_LENGTH.

Maximum string length: 255
title
string | null

Optional. String. The user's job title. At most 255 characters after leading and trailing whitespace is removed, otherwise 400 FIELD_EXCEEDS_MAX_LENGTH.

Maximum string length: 255
mobilePhone
string | null

Optional. String. The user's mobile phone number in international format (e.g. +46701234567). At most 255 characters after leading and trailing whitespace is removed, otherwise 400 FIELD_EXCEEDS_MAX_LENGTH.

Maximum string length: 255
endDate
string<date-time> | null

Optional. ISO-8601 date-time in UTC (yyyy-MM-ddTHH:mm:ssZ). The date the user's employment ends. Can't be in the past.

ssn
string | null

Optional. String. The user's personal identity number (social security number), validated for the organization's country. Stored normalized, for Swedish numbers without separator and century digits (19121212-1212 is stored as 1212121212). No other person may have it.

department
object

Optional. The department (organizational unit) of the organization to place the user in, identified by either id or externalSourceId; at least one of them is required. When both are given, id is used.

customDimensionPresetValues
object[] | null

Optional. Custom dimension values to preset on the user, used as defaults on the user's expenses. The other properties of a listed preset value are ignored.

language
string | null

Optional. String. The user's language and region as a locale code (language_COUNTRY, e.g. en_GB, sv_SE). Defaults to the organization's language.

bankAccountNumber
string | null

Optional. String. The user's bank account number for reimbursements, validated for the organization's country unless the client application turns that validation off. Stored without separators (9562-1537876 is stored as 95621537876). At most 255 characters after leading and trailing whitespace is removed, otherwise 400 FIELD_EXCEEDS_MAX_LENGTH.

Maximum string length: 255
IBAN
string | null

Optional. String. The user's International Bank Account Number for reimbursements. Spaces are allowed and removed; stored in upper case.

BIC
string | null

Optional. String. The Bank Identifier Code (SWIFT code) of the user's bank. Spaces are allowed and removed; stored in upper case.

isAdministrator
boolean | null

Optional. Boolean. True makes the user an administrator of the organization. Defaults to false.

Response

Created — the new user

A user of an organization: a person employed by the organization. Every property is always present; properties without a value are null.

id
string
required

UUID without dashes (32-character hex string)

Pattern: ^[0-9a-fA-F]{32}$
externalSourceId
string | null
required

String. Identifier of the user in an external system, set by an integration. Unique within the client application. Null when not set.

employeeId
string | null
required

String. The user's employee number in the organization. Null when not set.

title
string | null
required

String. The user's job title. Null when not set.

firstName
string
required

String. The user's first name.

lastName
string
required

String. The user's last name.

email
string<email>
required

String. The user's email address, also used to log in.

mobilePhone
string | null
required

String. The user's mobile phone number as entered, usually in international format (e.g. +46701234567). Null when not set.

endDate
string<date-time> | null
required

ISO-8601 date-time in UTC (yyyy-MM-ddTHH:mm:ssZ). The date the user's employment ends. Null when the employment has no end date.

ssn
string | null
required

String. The user's personal identity number (social security number), as stored. A number entered by the user is stored normalized, for Swedish numbers without separator and century digits (e.g. 1212121212). Null when not set.

department
object | null
required

The department (organizational unit) the user belongs to. Null when the user is not placed in a department.

customDimensionPresetValues
object[]
required

Custom dimension values preset on the user, used as defaults on the user's expenses. Excludes values belonging to deleted dimension definitions. Empty when none are set.

language
string | null
required

String. The user's language and region as a locale code (language_COUNTRY, e.g. en_GB, sv_SE). Null when the user has not chosen a language, in which case the organization's language applies.

bankAccountNumber
string | null
required

String. The user's bank account number for reimbursements. Null when not set.

IBAN
string | null
required

String. The user's International Bank Account Number for reimbursements. Null when not set.

BIC
string | null
required

String. The Bank Identifier Code (SWIFT code) of the user's bank. Null when not set.

lastInvitationDate
string<date-time> | null
required

ISO-8601 date-time in UTC (yyyy-MM-ddTHH:mm:ssZ). When the user was last sent an invitation email. Null when the user has not been invited, or has since activated their account.

dateCreated
string<date-time>
required

ISO-8601 date-time in UTC (yyyy-MM-ddTHH:mm:ssZ). When the user was added to the organization.

isAdministrator
boolean
required

Boolean. True when the user is an administrator of the organization.