Invitations
5 operations in the WP Waterfall API.
- getList invitations
- postInvite a teammate
- postAccept an invitation with its code
- deleteRevoke an invitation
- postResend an invitation
List invitations
get/companies/me/invitationsPermalink to List invitations
- Dashboard session only, no API key
Lists the company's invitations with the invited email and role, in pages of up to 200 (default 50). A Site Admin or Site Developer cannot read them and gets 403.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer | How many rows to return in one page: at most 200, and 50 when left out. Default: 50. Range: 1 to 200. |
cursor | query | string | The next_cursor of the page before. Leave it out for the first page. |
Responses
| Status | Body | Description |
|---|---|---|
200 | InvitationList | Invitations |
400 | Problem | The request could not be read: bad JSON, a bad header, or a malformed value. |
401 | Problem | The credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme. |
403 | Problem | The credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing. |
422 | Problem | The request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field. |
429 | Problem | A rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address. |
200 response fields
| Name | Type | Description |
|---|---|---|
data required | array of Invitation | The rows of this page. |
data[].id required | string | |
data[].email required | string (email) | |
data[].role required | string | One of: owner, admin, developer, billing, viewer, site_admin, site_developer. |
data[].site_ids | array of string (uuid) | Sites the invitee may use. Only set for Site Admin and Site Developer invitations. |
data[].expires_at required | string (date-time) | |
data[].created_at required | string (date-time) | |
next_cursor required | string or null | Send it as cursor to get the next page. Null on the last page. |
Invite a teammate
post/companies/me/invitationsPermalink to Invite a teammate
Emails an invitation code that works for 7 days and answers 201 with the invitation. site_ids (up to 100) limits a Site Admin or Site Developer invitation to those sites, and the owner role answers 422. A signed-in person needs a recent sign-in for every role above Viewer. An API key needs the users:write scope and cannot invite an Admin or a Billing user (403). A company sends at most 30 invitation emails an hour.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key required | header | string | Send a fresh unique value on every POST: a POST without it answers 422. The answer is stored for 24 hours, so a retry with the same key and body returns the first answer, and the same key with a different body returns 422. |
Responses
| Status | Body | Description |
|---|---|---|
201 | Invitation | Invitation |
400 | Problem | The request could not be read: bad JSON, a bad header, or a malformed value. |
401 | Problem | The credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme. |
403 | Problem | Missing users:write |
409 | Problem | The current state does not allow this: the same change is already running, or another change got there first. |
422 | Problem | The request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field. |
429 | Problem | A rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address. |
201 response fields
| Name | Type | Description |
|---|---|---|
id required | string | |
email required | string (email) | |
role required | string | One of: owner, admin, developer, billing, viewer, site_admin, site_developer. |
site_ids | array of string (uuid) | Sites the invitee may use. Only set for Site Admin and Site Developer invitations. |
expires_at required | string (date-time) | |
created_at required | string (date-time) |
Accept an invitation with its code
post/invitations/acceptPermalink to Accept an invitation with its code
- Dashboard session only, no API key
A signed-in session only. No API key may call it. The person signs in with the invited email address and sends the code from the invitation email. They join the company with the invited role, and a site role gets one membership for each invited site. An unknown code and a code for another address both answer 404, so a code never leaks.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key required | header | string | Send a fresh unique value on every POST: a POST without it answers 422. The answer is stored for 24 hours, so a retry with the same key and body returns the first answer, and the same key with a different body returns 422. |
Request body application/json, required, AcceptInvitationRequest
Fields
| Name | Type | Description |
|---|---|---|
token required | string |
Responses
| Status | Body | Description |
|---|---|---|
200 | object | The company the person joined |
400 | Problem | The request could not be read: bad JSON, a bad header, or a malformed value. |
401 | Problem | The credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme. |
403 | Problem | The credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing. |
404 | Problem | No such invitation for this address |
409 | Problem | The person already belongs to this company |
410 | Problem | The invitation has expired |
422 | Problem | The request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field. |
429 | Problem | A rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address. |
200 response fields
| Name | Type | Description |
|---|---|---|
company_id required | string | |
role required | string | |
site_ids required | array of string |
Revoke an invitation
delete/invitations/{id}Permalink to Revoke an invitation
- Dashboard session only, no API key
Deletes an invitation, so its code no longer works. Owners and Admins may call it. Answers 204, or 404 when the invitation was not found.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The id of the invitation. |
Responses
| Status | Body | Description |
|---|---|---|
204 | Revoked | |
400 | Problem | The request could not be read: bad JSON, a bad header, or a malformed value. |
401 | Problem | The credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme. |
403 | Problem | The credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing. |
404 | Problem | The thing in the path does not exist, or it belongs to another company. The answer is the same for both. |
409 | Problem | The current state does not allow this: the same change is already running, or another change got there first. |
422 | Problem | The request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field. |
429 | Problem | A rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address. |
Resend an invitation
post/invitations/{id}/resendPermalink to Resend an invitation
- Dashboard session only, no API key
Makes a new code for the invitation, valid for 7 days, and emails it again, so the earlier code stops working. It counts toward the 30 invitation emails a company may send in an hour. Answers 404 when the invitation was not found.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The id of the invitation. |
Idempotency-Key required | header | string | Send a fresh unique value on every POST: a POST without it answers 422. The answer is stored for 24 hours, so a retry with the same key and body returns the first answer, and the same key with a different body returns 422. |
Responses
| Status | Body | Description |
|---|---|---|
200 | Invitation | Invitation |
400 | Problem | The request could not be read: bad JSON, a bad header, or a malformed value. |
401 | Problem | The credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme. |
403 | Problem | The credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing. |
404 | Problem | The thing in the path does not exist, or it belongs to another company. The answer is the same for both. |
409 | Problem | The current state does not allow this: the same change is already running, or another change got there first. |
422 | Problem | The request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field. |
429 | Problem | A rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address. |
200 response fields
| Name | Type | Description |
|---|---|---|
id required | string | |
email required | string (email) | |
role required | string | One of: owner, admin, developer, billing, viewer, site_admin, site_developer. |
site_ids | array of string (uuid) | Sites the invitee may use. Only set for Site Admin and Site Developer invitations. |
expires_at required | string (date-time) | |
created_at required | string (date-time) |