Skip to main content

Invite guests to company

This endpoint allows you to invite new guests to a company or resend invitations to those who haven't accepted yet. To modify permissions for already invited guests, use the /guests/permissions endpoint.

  • If the guest hasn't been invited before, an invitation is sent,
  • If the guest was previously invited but hasn't accepted, the original invitation is resent (ignoring any new name or permissions),
  • If the guest has accepted the invitation, no new invitation is sent, but the initial invitation ID is returned, and no error is thrown.

Request

The request follows an all-or-none rule - if any guest object in the request is invalid (e.g., malformed email address), none will be invited.

Endpoint

POST https://api.woodpecker.co/rest/v2/agency/companies/{company_id}/invite_guest

Headers

x-api-key: {YOUR_API_KEY}
Content-Type: application/json

For details on how to authenticate your requests, please see the authentication guide.

Parameters

ParameterRequiredTypeDescription
company_idYesintegerPath parameter - the ID of the company to which a guest will be invited

Body

{
"guests": [
{
"name": "Michael Scott",
"email": "michael@dundermifflin.com",
"guest_permissions": []
},
{
"name": "Jimothy Halpert",
"email": "jimothy@dundermifflin.com",
"guest_permissions": ["mailboxes"]
}
]
}

Body schema

FieldTypeRequiredDescription
guestsarray[object]YesA list of guests to invite
└─[].namestringYesFull name of the invited guest
└─[].emailstringYesGuest's email address. It will be used as their login
└─[].guest_permissionsarray[string]/nullNomailboxes - allows guests to add/remove their email accounts
info

You can invite up to 10 guests with one request

Request sample

Invite guests

curl --request POST \
--url "https://api.woodpecker.co/rest/v2/agency/companies/{company_id}/invite_guest" \
--header "x-api-key: {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--data '{
"guests": [
{
"name": "Michael Scott",
"email": "michael@dundermifflin.com",
"guest_permissions": []
},
{
"name": "Jimothy Halpert",
"email": "jimothy@dundermifflin.com",
"guest_permissions": ["mailboxes"]
}
]
}'

Response

Response examples

A list of invited guests

{
"guests": [
{
"invitation_id": 45678,
"name": "Michael Scott",
"email": "michael@dundermifflin.com",
"guest_permissions": []
},
{
"invitation_id": 45679,
"name": "Jimothy Halpert",
"email": "jimothy@dundermifflin.com",
"guest_permissions": ["mailboxes"]
}
]
}

Body schema

FieldTypeDescription
guestsarray[object]List of invited guests
└─[].invitation_idintegerA unique invitation ID, distinct from the user ID. If a guest has already been invited, the ID of the initial invitation is returned. If the guest hasn't accepted the invite yet, it will be resent
└─[].namestringFull name of the invited guest
└─[].emailstringGuest's email address. It will be used as their login
└─[].guest_permissionsarray[string]List of guest permissions. Empty array if no permissions were granted