Embedding Indrava in your product

Give each of your customers their own Indrava workspace from your server, let them connect channels without an Indrava account, and post on their behalf.

Embed
Preview of the card
<a href="https://indrava.forumulate.com/docs/embedding"><img src="https://indrava.forumulate.com/docs/_api/public/orgs/e421ace4-3e78-4ed8-9818-7b4899cf3aa0/spaces/2bcc7f09-4489-40af-85d8-9fdd3f3da314/pages/5c0badac-a921-4d53-8918-17db30d8878a/social-card.svg?v=3e7ae33eec8b" alt="Embedding Indrava in your product" width="600" height="315"></a>

Use the embedding API when your product wants social publishing for its own customers and you do not want them to sign up to Indrava. Your server creates one tenant workspace per customer. Each tenant is a full workspace of its own: its channels, posts and files are kept apart from every other tenant's and from yours.

Everything here is server to server. Never put a key in a browser or an app.

Not yet run on a hosted Indrava

The embedding API passes its automated checks, but it has not yet run against a hosted Indrava with real tenants. Treat it as a preview until this note is removed.

What you need

An API key of your own workspace with the scope embed:write. Create it under Developers in the app. This key manages tenants; it is not the key you post with.

1. Create a workspace for a customer

curl -X POST http://localhost:4000/api/v1/embed/tenants \
  -H "Authorization: Bearer $INDRAVA_PARTNER_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "externalId": "customer-42", "name": "Acme Bakery", "webhookUrl": "https://your.app/indrava/events" }'
{
  "externalId": "customer-42",
  "name": "Acme Bakery",
  "organizationId": "org_…",
  "createdAt": "2027-01-04T09:00:00.000Z",
  "apiKey": "ak_…",
  "webhookSecret": "whsec_…"
}
  • externalId is your own id for the customer (letters, digits, ., :, -, _). Every other tenant route takes it in the path, so you never have to store an Indrava id.

  • apiKey is the tenant's key, shown once. Store it encrypted next to the customer. If it is lost or leaked, replace it with POST /embed/tenants/{externalId}/key: every earlier key of that tenant stops working.

  • The call is idempotent: sending the same externalId again renames the workspace, puts it on your current plan, and returns "apiKey": null.

  • webhookUrl is optional and read on the first call only. Every event of the tenant workspace is delivered there, signed with webhookSecret. Verify it as described in Receive webhooks.

2. Let the customer connect a channel

curl -X POST http://localhost:4000/api/v1/embed/tenants/customer-42/connect \
  -H "Authorization: Bearer $INDRAVA_PARTNER_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "provider": "linkedin", "redirectUrl": "https://your.app/settings/social" }'
{ "url": "http://localhost:4000/connect/…", "expiresAt": "2027-01-04T10:00:00.000Z" }

Send the customer's browser to url. They see which workspace is asking, sign in at the platform, and return to your redirectUrl with the outcome in the query:

Query

Meaning

status=connected&channels=<id>,<id>

The channels that were saved

status=error&error=<message>

Nothing was saved; the message can be shown to the customer

Do not treat the query as proof: anyone can open your redirectUrl with a made-up query. Confirm with GET /embed/tenants/{externalId}/channels or the channel.connected event.

  • The link works for one hour and for any number of sign-ins in that time.

  • provider is an id from GET /channels/providers. Only platforms that connect by signing in can be used here. Platforms that take pasted credentials (an app password, a bot token) are connected with the tenant's key and POST /channels/connect.

  • redirectUrl must be https (http://localhost is accepted while you develop). Without it the customer ends on a plain Indrava page that says the channel is connected.

3. Post on the customer's behalf

Use the tenant's key with the ordinary API. Nothing about these calls is special: the key decides which workspace they act on.

curl -X POST http://localhost:4000/api/v1/posts \
  -H "Authorization: Bearer $TENANT_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "parts": [{ "text": "Fresh sourdough at 8." }],
    "targets": [{ "channelId": "<channel id>" }],
    "action": "schedule",
    "scheduledAt": "2027-01-05T08:00:00Z"
  }'

The tenant's key holds every scope except the embed ones, so media, analytics, the inbox and the rest of the operations work the same way.

Manage tenants

Call

What it does

GET /embed/tenants

Your tenants, newest first

GET /embed/tenants/{externalId}/channels

A tenant's channels, with their state

DELETE /embed/tenants/{externalId}/channels/{channelId}

Disconnect a channel (access is revoked at the platform)

POST /embed/tenants/{externalId}/key

Replace the tenant's key

DELETE /embed/tenants/{externalId}

Delete the workspace and everything in it. Not reversible

Plans and limits

  • You can have as many tenants as your plan includes clients. Past that, creating another tenant answers 402 with the code PLAN_LIMIT_REACHED.

  • A tenant workspace gets your plan's limits (channels, scheduled posts per month, AI credits) when it is created, and follows your plan when it changes: every tenant is moved within a few minutes, with no call from you. A tenant that Indrava gave limits of its own keeps them through your plan changes.

  • Rate limits are counted per key, so one busy tenant does not slow the others.

Security notes

  • A tenant can only ever be reached through the partner workspace that created it: another partner sending the same externalId gets its own, separate workspace.

  • Tenant keys cannot create tenants or read your own workspace.

  • Deleting your own Indrava workspace does not delete its tenants. Delete them first.

Updated