Create a workspace
curl --request POST \
--url https://agents.labs.bandwidth.com/api/v1/user/tenants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'import requests
url = "https://agents.labs.bandwidth.com/api/v1/user/tenants"
payload = { "name": "<string>" }
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({name: '<string>'})
};
fetch('https://agents.labs.bandwidth.com/api/v1/user/tenants', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"group_id": 123,
"name": "<string>",
"tenant_id": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Workspace management
Create a workspace
Create a workspace with a default group owned by your account.
POST
/
api
/
v1
/
user
/
tenants
Create a workspace
curl --request POST \
--url https://agents.labs.bandwidth.com/api/v1/user/tenants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'import requests
url = "https://agents.labs.bandwidth.com/api/v1/user/tenants"
payload = { "name": "<string>" }
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({name: '<string>'})
};
fetch('https://agents.labs.bandwidth.com/api/v1/user/tenants', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"group_id": 123,
"name": "<string>",
"tenant_id": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Requires an OAuth bearer token. Supply a nonempty name. The response includes
tenant_id, group_id, and name. The new group becomes the account’s selected workspace. Duplicate names and workspace ownership/membership limits return 409. 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