Embedding

Embed
Preview of the card
<a href="https://indrava.forumulate.com/docs/ref-embedding"><img src="https://indrava.forumulate.com/docs/_api/public/orgs/e421ace4-3e78-4ed8-9818-7b4899cf3aa0/spaces/2bcc7f09-4489-40af-85d8-9fdd3f3da314/pages/96e4fbfe-c7c9-4e46-b1ce-3d36aaf5722f/social-card.svg?v=3e7ae33eec8b" alt="Embedding" width="600" height="315"></a>
GET 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

200 OK
Example
{}
Option 1
{}
Option 2
{}
POST 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
externalId
string
required
name
string
required
webhookUrl
string
{
  "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

200 OK
Example
{}
Option 1
{}
Option 2
{}
POST 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

externalId
string
path
required

Code 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

200 OK
Example
{}
Option 1
{}
Option 2
{}
DELETE 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

externalId
string
path
required

Code 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

200 OK
Example
{}
Option 1
{}
Option 2
{}
POST 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

externalId
string
path
required

Request body

application/json
provider
string
required
redirectUrl
string
{
  "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

200 OK
Example
{}
Option 1
{}
Option 2
{}
GET http://localhost:4000/api/v1/embed/tenants/{externalId}/channels

List a tenant workspace's channels

Parameters

externalId
string
path
required

Code 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

200 OK
Example
{}
Option 1
{}
Option 2
{}
DELETE 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

externalId
string
path
required
channelId
string
path
required

Code 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

200 OK
Example
{}
Option 1
{}
Option 2
{}
GET 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

externalId
string
path
required

Code 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

200 OK
Example
{}
Option 1
{}
Option 2
{}
PUT 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

externalId
string
path
required

Request body

application/json
plan
string
required
{
  "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

200 OK
Example
{}
Option 1
{}
Option 2
{}
GET 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

externalId
string
path
required

Code 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

200 OK
Example
{}
Option 1
{}
Option 2
{}
GET http://localhost:4000/api/v1/embed/tenants/{externalId}/members

List the members of a tenant workspace

Parameters

externalId
string
path
required

Code 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

200 OK
Example
{}
Option 1
{}
Option 2
{}
POST 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

externalId
string
path
required

Request body

application/json
userExternalId
string
required
role
string
required
org:admin | org:member | org:editor | org:approver | org:client_reviewer
{
  "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

200 OK
Example
{}
Option 1
{}
Option 2
{}
DELETE 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

externalId
string
path
required
userId
string
path
required

Code 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

200 OK
Example
{}
Option 1
{}
Option 2
{}
PATCH http://localhost:4000/api/v1/embed/tenants/{externalId}/members/{userId}

Change a member's role in a tenant workspace

Parameters

externalId
string
path
required
userId
string
path
required

Request body

application/json
role
string
required
org:admin | org:member | org:editor | org:approver | org:client_reviewer
{
  "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

200 OK
Example
{}
Option 1
{}
Option 2
{}

Updated