Embedding
http://localhost:4000/api/v1 /embed/tenants List the workspaces you created for your customers
Code samples
cURL
curl -X GET "http://localhost:4000/api/v1/embed/tenants" \
-H "Authorization: Bearer $API_KEY"TypeScript
Python
Go
PHP
Ruby
Java
Responses
Example
{}Option 1
{}Option 2
{}http://localhost:4000/api/v1 /embed/tenants Create (or update) a workspace for one of your customers
Idempotent on externalId, your own id for the customer. The first call returns apiKey: the tenant workspace's own key for the rest of this API (posts, media, analytics), shown once. Later calls return apiKey: null, rename the workspace and put it on your current plan. Tenants count against your plan's client limit; each tenant gets your plan's limits. With webhookUrl, every event of the tenant workspace (see Events) is sent there, signed with the returned webhookSecret.
Request body
application/json
externalIdnamewebhookUrl{
"externalId": "string",
"name": "string",
"webhookUrl": "string"
}Code samples
cURL
curl -X POST "http://localhost:4000/api/v1/embed/tenants" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"externalId":"string","name":"string","webhookUrl":"string"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
Example
{}Option 1
{}Option 2
{}http://localhost:4000/api/v1 /embed/tenants/{externalId}/key Replace a tenant workspace's API key
Every earlier key of the tenant stops working. apiKey is shown once.
Parameters
externalIdCode samples
cURL
curl -X POST "http://localhost:4000/api/v1/embed/tenants/{externalId}/key" \
-H "Authorization: Bearer $API_KEY"TypeScript
Python
Go
PHP
Ruby
Java
Responses
Example
{}Option 1
{}Option 2
{}http://localhost:4000/api/v1 /embed/tenants/{externalId} Delete a tenant workspace and everything in it
Channels are disconnected at their platforms, scheduled posts never publish, files are deleted and the tenant's keys stop working. Not reversible.
Parameters
externalIdCode samples
cURL
curl -X DELETE "http://localhost:4000/api/v1/embed/tenants/{externalId}" \
-H "Authorization: Bearer $API_KEY"TypeScript
Python
Go
PHP
Ruby
Java
Responses
Example
{}Option 1
{}Option 2
{}http://localhost:4000/api/v1 /embed/tenants/{externalId}/connect Get a one-hour link where your customer connects a channel
Send your customer's browser to url. They sign in at the platform and the channel is saved in their tenant workspace. With redirectUrl the browser then returns there with status=connected&channels=<ids> or status=error&error=<message> in the query; the tenant's channel.connected event fires either way. Sign-in platforms only.
Parameters
externalIdRequest body
application/json
providerredirectUrl{
"provider": "string",
"redirectUrl": "string"
}Code samples
cURL
curl -X POST "http://localhost:4000/api/v1/embed/tenants/{externalId}/connect" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"provider":"string","redirectUrl":"string"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
Example
{}Option 1
{}Option 2
{}http://localhost:4000/api/v1 /embed/tenants/{externalId}/channels List a tenant workspace's channels
Parameters
externalIdCode samples
cURL
curl -X GET "http://localhost:4000/api/v1/embed/tenants/{externalId}/channels" \
-H "Authorization: Bearer $API_KEY"TypeScript
Python
Go
PHP
Ruby
Java
Responses
Example
{}Option 1
{}Option 2
{}http://localhost:4000/api/v1 /embed/tenants/{externalId}/channels/{channelId} Disconnect one of a tenant workspace's channels
The same as DELETE /channels/{id} with the tenant's key: access is revoked at the platform, and a scheduled post left with no channel goes back to draft.
Parameters
externalIdchannelIdCode samples
cURL
curl -X DELETE "http://localhost:4000/api/v1/embed/tenants/{externalId}/channels/{channelId}" \
-H "Authorization: Bearer $API_KEY"TypeScript
Python
Go
PHP
Ruby
Java
Responses
Example
{}Option 1
{}Option 2
{}http://localhost:4000/api/v1 /embed/tenants/{externalId}/plan Get the plan a tenant workspace runs
plan is what the tenant runs now; followsPartner is false when you chose a plan for it with PUT /embed/tenants/{externalId}/plan. limits use -1 for unlimited.
Parameters
externalIdCode samples
cURL
curl -X GET "http://localhost:4000/api/v1/embed/tenants/{externalId}/plan" \
-H "Authorization: Bearer $API_KEY"TypeScript
Python
Go
PHP
Ruby
Java
Responses
Example
{}Option 1
{}Option 2
{}http://localhost:4000/api/v1 /embed/tenants/{externalId}/plan Choose the plan of one tenant workspace
Any plan up to your own: a tenant never runs above the plan you pay for, and drops with you when yours goes down. plan: null makes the tenant follow your plan again. A tenant holding an operator's grant keeps it.
Parameters
externalIdRequest body
application/json
plan{
"plan": "free"
}Code samples
cURL
curl -X PUT "http://localhost:4000/api/v1/embed/tenants/{externalId}/plan" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"plan":"free"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
Example
{}Option 1
{}Option 2
{}http://localhost:4000/api/v1 /embed/tenants/{externalId}/credits Read a tenant workspace's AI credit balance
This month's limit and used for each kind. limit -1 = unlimited.
Parameters
externalIdCode samples
cURL
curl -X GET "http://localhost:4000/api/v1/embed/tenants/{externalId}/credits" \
-H "Authorization: Bearer $API_KEY"TypeScript
Python
Go
PHP
Ruby
Java
Responses
Example
{}Option 1
{}Option 2
{}http://localhost:4000/api/v1 /embed/tenants/{externalId}/members List the members of a tenant workspace
Parameters
externalIdCode samples
cURL
curl -X GET "http://localhost:4000/api/v1/embed/tenants/{externalId}/members" \
-H "Authorization: Bearer $API_KEY"TypeScript
Python
Go
PHP
Ruby
Java
Responses
Example
{}Option 1
{}Option 2
{}http://localhost:4000/api/v1 /embed/tenants/{externalId}/members Add a member to a tenant workspace
Name the person by userExternalId, your own id for them: they join the tenant workspace as role when they sign in with that id, or at once when they already have. Roles: org:admin, org:member, org:editor, org:approver, org:client_reviewer.
Parameters
externalIdRequest body
application/json
userExternalIdrole{
"userExternalId": "string",
"role": "org:admin"
}Code samples
cURL
curl -X POST "http://localhost:4000/api/v1/embed/tenants/{externalId}/members" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"userExternalId":"string","role":"org:admin"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
Example
{}Option 1
{}Option 2
{}http://localhost:4000/api/v1 /embed/tenants/{externalId}/members/{userId} Remove a member from a tenant workspace
userId is the Atlas user id from the members list, or a userExternalId that has not signed in yet (its pending invitation is cancelled).
Parameters
externalIduserIdCode samples
cURL
curl -X DELETE "http://localhost:4000/api/v1/embed/tenants/{externalId}/members/{userId}" \
-H "Authorization: Bearer $API_KEY"TypeScript
Python
Go
PHP
Ruby
Java
Responses
Example
{}Option 1
{}Option 2
{}http://localhost:4000/api/v1 /embed/tenants/{externalId}/members/{userId} Change a member's role in a tenant workspace
Parameters
externalIduserIdRequest body
application/json
role{
"role": "org:admin"
}Code samples
cURL
curl -X PATCH "http://localhost:4000/api/v1/embed/tenants/{externalId}/members/{userId}" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"role":"org:admin"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
Example
{}Option 1
{}Option 2
{}