Skip to main content
PUT
Update 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 of the user. 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.

userId
string
required

Required. String. Identifies the user to update, as returned in the id or externalSourceId field of the list response: either the user's internal ID (32-character hexadecimal string) or its externalSourceId (the non-empty string an integration set on the user). Only the users of the given organization are searched. This endpoint supports externalId: when a user of the organization has that internal ID, the internal ID takes precedence; otherwise the value is looked up as externalSourceId.

Body

application/json

The properties of a user to change. Only the properties in the body are changed; a property that is left out keeps its value, and null clears an optional property. The properties have the same names and formats as in the list response, so a listed user can be sent back: email and ssn are accepted when they equal the user's current values, and the read-only properties id, lastInvitationDate and dateCreated are ignored. Leave out language when the list returns null for it, since null is rejected. 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 and nothing is changed. The limit is checked on every value in the body, also on one sent back unchanged; a value the list returns always fits, since the stored values are at most 255 characters. Apart from that length check, an endDate, bankAccountNumber, IBAN or BIC sent back unchanged isn't validated again; the other values, such as department and customDimensionPresetValues, are validated even when unchanged. firstName, lastName, mobilePhone, language, bankAccountNumber, IBAN and BIC belong to the person, whom every organization employing them shares: while the person is also a (not deleted) user of another organization, they are accepted only when they equal the current values, otherwise the request is rejected with 400 INVALID_JSON_PROPERTY_VALUE and nothing is changed. Bank details that only differ in formatting, such as spaces or dashes, count as unchanged.

email
string<email>

Can't be changed. String. The user's email address, which is also their login. Accepted only when it is the user's current email address (case-insensitive), otherwise 400 INVALID_JSON_PROPERTY_VALUE. At most 255 characters after leading and trailing whitespace is removed, otherwise 400 FIELD_EXCEEDS_MAX_LENGTH.

Maximum string length: 255
ssn
string | null

Can't be changed. String. The user's personal identity number. Accepted only when it is the user's current number, written in any accepted format (19121212-1212 matches a stored 1212121212), otherwise 400 INVALID_JSON_PROPERTY_VALUE.

firstName
string

Optional. String. The user's first name. Can't be empty or null. Can't be changed while the person is also a user of another organization: then accepted only when equal to the current value, otherwise 400 INVALID_JSON_PROPERTY_VALUE. At most 255 characters after leading and trailing whitespace is removed, otherwise 400 FIELD_EXCEEDS_MAX_LENGTH.

Maximum string length: 255
lastName
string

Optional. String. The user's last name. Can't be empty or null. Can't be changed while the person is also a user of another organization: then accepted only when equal to the current value, otherwise 400 INVALID_JSON_PROPERTY_VALUE. 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. null clears 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. null clears 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. null clears it. 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). null clears it. A user whose mobile number is verified keeps that number: a different number or null is ignored, and the request still answers 200. Can't be changed while the person is also a user of another organization: then accepted only when equal to the current value, otherwise 400 INVALID_JSON_PROPERTY_VALUE. 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. A new value can't be in the past. null clears 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. null removes the user from their department.

customDimensionPresetValues
object[] | null

Optional. Custom dimension values to preset on the user, used as defaults on the user's expenses. The list replaces the user's preset values: a dimension left out of it loses its preset value, and null or [] removes them all. The other properties of a listed preset value are ignored.

language
string

Optional. String. The user's language and region as a locale code (language_COUNTRY, e.g. en_GB, sv_SE). Can't be null: leave it out for a user the list returns with language: null. Can't be changed while the person is also a user of another organization: then accepted only when equal to the current value, otherwise 400 INVALID_JSON_PROPERTY_VALUE.

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. null clears it. Can't be changed while the person is also a user of another organization: then accepted only when equal to the current value (ignoring formatting), otherwise 400 INVALID_JSON_PROPERTY_VALUE. 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. null clears it. Can't be changed while the person is also a user of another organization: then accepted only when equal to the current value (ignoring formatting), otherwise 400 INVALID_JSON_PROPERTY_VALUE.

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. null clears it. Can't be changed while the person is also a user of another organization: then accepted only when equal to the current value (ignoring formatting), otherwise 400 INVALID_JSON_PROPERTY_VALUE.

isAdministrator
boolean | null

Optional. Boolean. True makes the user an administrator of the organization, false removes them as one. null leaves it unchanged.

Response

OK — the updated 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.