---
title: "Invite a user to a client company"
method: POST
path: "/agencies/{agencyId}/companies/{companyId}/invitations"
tags: ["agency-users"]
---

# Invite a user to a client company

`POST /agencies/{agencyId}/companies/{companyId}/invitations`

## Request

- Base URL: `https://api.bokio.se/v1`
- URL: `https://api.bokio.se/v1/agencies/{agencyId}/companies/{companyId}/invitations`
- Auth: HTTP bearer

Invite a user to one of the agency's client companies.
Creates a pending invitation and sends an email.

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`

## Request body

- CompanyUserInvitationWriteModel
  - `email` string, email, required: Email address of the user to invite
  - `inviterUserId` string, 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.

## Response `200`

Invitation created

- UserInvitationGetModel
  - `id` string, uuid, required: Unique identifier for the invitation
  - `email` string, email, required: Email address of the invited user
  - `status` 'pendingInvitation', required: Status of the invitation

## Other responses

- `400`: Validation error
- `404`: Company client is not found under this agency

---

[API](https://skmtc.dev/bokio/apis/agency-api.md) - [All operations](https://skmtc.dev/bokio/apis/agency-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bokio/apis/agency-api/revisions/2ec5b299f1d5?raw)
