Skip to main content
POST
Create partner user

Authorizations

Authorization
string
header
required

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

Path Parameters

partnerId
string
required

String, required. The ID of the partner (32-character hex string), as returned in the id field of the partner endpoints. Lookup by externalSourceId is not supported for partners.

UUID without dashes (32-character hex string)

Pattern: ^[0-9a-fA-F]{32}$

Query Parameters

sendInvitationMail
boolean
default:true

Boolean, optional. Whether to email the new user an invitation. When true or omitted, the user is invited: a partner administrator to the partner, any other user to the first organization in consultantOrganizations, or else in administratorOrganizations, and lastInvitationDate is set. When false, the user is created without an invitation and lastInvitationDate stays null. A new account can't sign in until an invitation is accepted; a user who shares an employee's account keeps signing in as before. Defaults to true.

Body

application/json

A new user of the partner. The user must be linked to the partner in at least one way: as an administrator of the partner (isPartnerAdministrator), or as an administrator or accounting consultant of at least one of the partner's organizations. Employment can't be set here; a partner user is never employed by the organizations it administers. String properties are trimmed, and may be at most 255 characters long.

firstName
string
required

String, required. The first name of the user. Must not be blank.

Maximum string length: 255
lastName
string
required

String, required. The last name of the user. Must not be blank.

Maximum string length: 255
email
string<email>
required

String, required. The email address of the user. Must not already be used by another partner administrator or accounting consultant in the client application, by an account that belongs to another client application, or, in a client application that shares person data across organizations, by any other user; otherwise 400 EMPLOYEE_ALREADY_EXISTS.

Maximum string length: 255
externalSourceId
string | null

String, optional. The user's id in an external system. Must be unique within the client application, otherwise 400 EMPLOYEE_ALREADY_EXISTS.

Maximum string length: 255
mobilePhone
string | null

String, optional. The mobile phone number of the user, e.g. +46701234567. Must be a valid phone number, otherwise 400 INVALID_PHONE_NUMBER, and must not be used by another user, otherwise 400 PHONE_NUMBER_ALREADY_USED.

Maximum string length: 255
language
string | null

String, optional. The user's language as a language variant, e.g. sv_SE or en_GB. Must be an existing language variant, otherwise 400 INVALID_LANGUAGE. Defaults to the language of the partner's invoice address country, or a system default when the partner has none.

Maximum string length: 255
isPartnerAdministrator
boolean | null

Boolean, optional. True makes the user an administrator of the partner. Defaults to false.

supportRole
boolean | null

Boolean, optional. True gives a partner administrator the partner support role instead of the partner manager role. Only allowed together with isPartnerAdministrator: true. Defaults to false.

administratorOrganizations
(string | object)[] | null

Array, optional. The partner's organizations the user becomes an administrator of. Each entry is either a string holding the organization's internal ID or its externalSourceId (supports externalId), or an organization object as returned by the get partner user endpoint ({id, externalSourceId, name}), resolved by id, else by externalSourceId; name is ignored. Every organization must be one of the partner's organizations and not deleted, otherwise 404 ORGANIZATION_NOT_FOUND. A value that isn't an array answers 400 INVALID_JSON_BODY.

One of the partner's organizations, given either as a string holding its internal ID or its externalSourceId (supports externalId), or as an organization object in the shape the get partner user endpoint returns, so a user read with GET can be posted back. An object is resolved by its id, or by its externalSourceId when it has no id; name is ignored.

Example:

"beta-ext-1"

consultantOrganizations
(string | object)[] | null

Array, optional. The partner's organizations the user becomes an accounting consultant of. Each entry is either a string holding the organization's internal ID or its externalSourceId (supports externalId), or an organization object as returned by the get partner user endpoint ({id, externalSourceId, name}), resolved by id, else by externalSourceId; name is ignored. Every organization must be one of the partner's organizations and not deleted, otherwise 404 ORGANIZATION_NOT_FOUND. A value that isn't an array answers 400 INVALID_JSON_BODY.

One of the partner's organizations, given either as a string holding its internal ID or its externalSourceId (supports externalId), or as an organization object in the shape the get partner user endpoint returns, so a user read with GET can be posted back. An object is resolved by its id, or by its externalSourceId when it has no id; name is ignored.

Example:

"beta-ext-1"

Response

Created — returns the new user

A user of a partner. Unlike an organization user it is not employed by the partner, so id and externalSourceId are the person's own. A person is a user of the partner when it is an administrator of the partner, an accounting consultant of one of the partner's organizations, or an administrator of one of the partner's organizations without being employed there. Api keys are never returned as users. 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. The user's id in an external system, unique within the client application. Null when not set.

firstName
string
required

String. The first name of the user.

lastName
string
required

String. The last name of the user.

email
string<email>
required

String. The email address of the user.

mobilePhone
string | null
required

String. The mobile phone number of the user. Null when not set.

language
string | null
required

String. The user's language as a language variant, e.g. sv_SE or en_GB. Null when not set.

lastInvitationDate
string<date-time> | null
required

String, ISO-8601 date-time in UTC. When the user was last invited. Null when never invited.

invite
boolean
required

Boolean. True when the user's account is pending activation, whether or not an invitation was sent; see lastInvitationDate for when the user was last invited.

isPartnerAdministrator
boolean
required

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

supportRole
boolean
required

Boolean. True when the user is an administrator of the partner and has the partner support role; always false when isPartnerAdministrator is false.

dateCreated
string<date-time>
required

String, ISO-8601 date-time in UTC. When the user was created.

administratorOrganizations
object[]
required

Array. The partner's organizations the user is an administrator of, ordered by name. Empty when none.

consultantOrganizations
object[]
required

Array. The partner's organizations the user is an accounting consultant of, ordered by name. Empty when none.

employeeOrganizations
object[]
required

Array. The partner's organizations the user is employed in, ordered by name. Empty when none. Employment alone doesn't make a person a partner user; the list shows it for users who are also linked in one of the ways above.