Rest API
List workspaces
GET
/api/v1/workspaces
const url = 'https://api.unless.com/api/v1/workspaces';const options = { method: 'GET', headers: {'x-api-key': 'example', 'x-user-email': 'example', 'x-account-id': 'example'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.unless.com/api/v1/workspaces \ --header 'x-account-id: example' \ --header 'x-api-key: example' \ --header 'x-user-email: example'List the workspaces you can reach in the account. Use the websiteId of a workspace as the
x-website-id header of every other call.
Notes
- This is the only endpoint that does not need an
x-website-idheader - Users limited to specific workspaces only get those
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”x-api-key
required
string
Your API key from account settings.
x-user-email
required
string
The email address of your user.
x-account-id
required
string
The ID of your account. You can find this in the account settings.
Responses
Section titled “Responses”The workspaces you can reach, oldest first.
Media typeapplication/json
object
workspaces
Array<object>
object
websiteId
string
name
The workspace name, or its domain when it has no name.
string
domain
string
Example generated
{ "workspaces": [ { "websiteId": "example", "name": "example", "domain": "example" } ]}Unauthorized - invalid API key.