Invite members
curl --request POST \
--url https://agents.labs.bandwidth.com/api/v1/organizations/invites \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"emails": [
"jsmith@example.com"
],
"targets": [
{
"organization_id": 123,
"role": "viewer"
}
]
}
'import requests
url = "https://agents.labs.bandwidth.com/api/v1/organizations/invites"
payload = {
"emails": ["jsmith@example.com"],
"targets": [
{
"organization_id": 123,
"role": "viewer"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
emails: ['jsmith@example.com'],
targets: [{organization_id: 123, role: 'viewer'}]
})
};
fetch('https://agents.labs.bandwidth.com/api/v1/organizations/invites', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"created": [
{
"email": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"id": 123,
"role": "<string>",
"status": "<string>"
}
],
"skipped": [
{
"email": "<string>",
"reason": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Members and invitations
Invite members
Invite accounts to one or more workspace groups.
POST
/
api
/
v1
/
organizations
/
invites
Invite members
curl --request POST \
--url https://agents.labs.bandwidth.com/api/v1/organizations/invites \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"emails": [
"jsmith@example.com"
],
"targets": [
{
"organization_id": 123,
"role": "viewer"
}
]
}
'import requests
url = "https://agents.labs.bandwidth.com/api/v1/organizations/invites"
payload = {
"emails": ["jsmith@example.com"],
"targets": [
{
"organization_id": 123,
"role": "viewer"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
emails: ['jsmith@example.com'],
targets: [{organization_id: 123, role: 'viewer'}]
})
};
fetch('https://agents.labs.bandwidth.com/api/v1/organizations/invites', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"created": [
{
"email": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"id": 123,
"role": "<string>",
"status": "<string>"
}
],
"skipped": [
{
"email": "<string>",
"reason": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Requires an OAuth bearer token and Admin or Owner permission for every target group. Send recipient
emails and targets containing organization_id and role. This sends invitation emails.
Inspect both created and skipped in the response; one successful HTTP response does not mean every recipient received a new invitation. Empty/invalid targets or roles return 400; insufficient target access returns 403. API keys are not accepted.Authorizations
Bandwidth Labs OAuth access token. Uses the user's selected workspace; the workspace header is not required. Do not also send an API key. Bearer-only operations may additionally require the Labs super_user role.
Body
application/json