Skip to main content

Workspaces

Contacts, templates, broadcasts and messages all belong to a workspace, so you usually call this API first to find the workspace id the other endpoints ask for.

Read only

Creating, renaming and deleting workspaces is done in the app. POST /v1/workspaces, PUT /v1/workspaces/{id} and DELETE /v1/workspaces/{id} return 405 {"error":"Method not supported"}.

The workspace object​

Attributes
idstring
Workspace id. Use it as workspaceId (or workspace.id) in other endpoints.
titlestring
Workspace name as shown in the app
The workspace object
{
"id": "kR4tW9pLxQ",
"title": "Downtown Clinic"
}

List workspaces​

GET/v1/workspaces
Query parameters
searchTextstring
Returns workspaces whose title contains this text. Not case sensitive.
pageintegerdefault 1
Page number, starting at 1
limitintegerdefault 10
Results per page. Max 100; larger values are capped at 100.

200 OK: a JSON array of workspaces. An empty array means no workspace matched, or the page is past the last result.

Errors
StatusBodyWhen
401{"message":"Unauthorized"}The x-api-key header is missing, invalid or the key was deleted
500{"error":"Could not retrieve Workspaces"}Something went wrong on our side. Retry, and contact support if it continues.
Request
curl "https://api.whauto.chat/v1/workspaces?searchText=downtown&page=1&limit=20" \
-H "x-api-key: $WHAUTOCHAT_API_KEY"
Response 200
[
{ "id": "kR4tW9pLxQ", "title": "Downtown Clinic" },
{ "id": "Hb7mN2sVcE", "title": "Downtown Pharmacy" }
]

Get a workspace​

GET/v1/workspaces/{id}
Path parameters
idstringrequired
Workspace id

200 OK: the workspace object.

Errors
StatusBodyWhen
401{"message":"Unauthorized"}The x-api-key header is missing, invalid or the key was deleted
404{"error":"Workspace not found"}No workspace with that id in your account
500{"error":"Could not retrieve Location"}Something went wrong on our side. Retry, and contact support if it continues.
Request
curl "https://api.whauto.chat/v1/workspaces/kR4tW9pLxQ" \
-H "x-api-key: $WHAUTOCHAT_API_KEY"
Response 200
{
"id": "kR4tW9pLxQ",
"title": "Downtown Clinic"
}