agency-users

Add or invite a user to a client company

Add or invite a user to one of the agency's client companies.

If the email belongs to an existing Bokio user, the user is added directly to the company. Otherwise, a pending invitation is created and an email is sent. The integrator is responsible for ensuring that only users who are valid and authorized in its system are added to the company or sent invitations.

The invitation is sent on behalf of a company user, who is named as the inviter in the email and on the page where the invitation is accepted. By default this is the company owner. Use inviterUserId to send it on behalf of another company user. That user must have permission to manage users in the company, otherwise a 400 validation error is returned. If the company has no owner, inviterUserId is required and a 400 validation error is returned when it is omitted.

Scope: agency-users:write

post/agencies/{agencyId}/companies/{companyId}/add-or-invite-user

Request

  • Base URL
    https://api.bokio.se/v1
  • URL
    https://api.bokio.se/v1/agencies/{agencyId}/companies/{companyId}/add-or-invite-user
  • Auth
    HTTP bearer

Request body

emailstring email required

Email address of the user to invite

inviterUserIdstring uuid

Unique identifier of the company user sending the invitation. The user must be a member of the company with permission to manage users. Defaults to the company owner when omitted, and is required when the company has no owner. The inviter is named in the invitation email and on the page where the invitation is accepted.

Example request

{
  "email": "user@example.com",
  "inviterUserId": "b2c3d4e5-f6a7-8901-bcde-f12345678901"
}

Response

User added or invited

operation'added' | 'invited' required

The operation performed for the requested email address:

  • added: The email belongs to an existing Bokio user who was added to the company.
  • invited: No Bokio user exists for the email, so a pending invitation was created.
idstring uuid required

Unique identifier for the user or invitation, depending on the operation

emailstring email required

Email address of the user or invitation

status'active' | 'pendingInvitation' required

Status of the user or invitation

Example response

{
  "operation": "added",
  "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "email": "staff@agency.com",
  "status": "active"
}

Changes

No recorded changes to this operation across all 1 revision of this API.