Skip to content

Invite a user to the portal

POST
/client-members/{memberId}/portal-invitation
Code sample: Shell / cURL
curl --request POST \
--url https://example.com/api/v1/client-members/example/portal-invitation \
--header 'Authorization: Bearer <token>'

Invites one user to the portal as the Users page row action does, with or without a company. A person never invited is queued through their silent contacts, or invited through their first live company; an invited one gets it again; a revoked one has access restored through every company the caller reaches. A person with no company is invited on their own account, which answers failed once it was closed. A user who can already sign in is skipped. Requires the clients.view and clients.edit permissions and the same reach as GET /client-members; anyone else answers 404. No request body is needed.

memberId
required

WorkspaceMember id of the client person.

string
>= 1 characters

WorkspaceMember id of the client person.

What the invitation did.

Media typeapplication/json
object
data
required
object
alreadyQueued
required

Pending members that already had an invitation waiting in the queue.

integer
>= -9007199254740991 <= 9007199254740991
failed
required

Invitations that did not leave or were refused, such as for a person with no company whose account was closed.

integer
>= -9007199254740991 <= 9007199254740991
queued
required

Invitations newly enqueued by this call.

integer
>= -9007199254740991 <= 9007199254740991
sent
required

Invitations or welcomes sent right away.

integer
>= -9007199254740991 <= 9007199254740991

Example generated

{
"data": {
"alreadyQueued": 1,
"failed": 1,
"queued": 1,
"sent": 1
}
}

Unauthorized.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Forbidden.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Client person not found.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Rate limit exceeded. Wait for Retry-After before retrying.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}
RateLimit-Limit
string
/^\d+$/

Maximum requests in the current quota window.

RateLimit-Policy
string

Quota policy in requests and window seconds, for example 60;w=60.

RateLimit-Remaining
string
/^\d+$/

Requests left in this quota window (zero when blocked).

RateLimit-Reset
string
/^\d+$/

Seconds until the current quota window resets, when available from the rate-limit store.

Retry-After
string
/^\d+$/

Seconds until another request may be attempted.