The partner API is available to approved partners. Revyl turns it on for your platform in each
environment and may turn on your customer accounts one at a time. Connecting an account that
isn’t turned on answers
403 partner_not_allowed.Connect an account
Send your own ID for the customer account, the names to show, and the email of the person enabling the connection:
What happens depends on the mode and on whether the email already has a Revyl account:
auto, and the email has no Revyl account: Revyl creates a workspace, makes that person its Owner, and answers201withstate: "connected",origin: "provisioned", and the connection credential.auto, and Revyl created a workspace for this account before: Revyl reconnects that workspace and answers201, even after a disconnect.auto, and the email already has a Revyl account: Revyl asks for approval and answers202withstate: "awaiting_approval".link_existing: Revyl always asks for approval and answers202.- The account isn’t turned on for your integration: Revyl answers
403 partner_not_allowed.
409 already_connected with
the connection; use Rotate the credential if you lost it.
Wait for approval
A202 response carries an approval:
user_code and a link to verification_uri_complete; the approver checks
that the code in Revyl matches yours. The request expires after expires_in seconds. Revyl sends one
reminder three days after the request if no one has decided. Calling connect again for the same
person returns the same approval and resends its email at most once every 10 minutes; a different
owner_email replaces the request, and the old link stops working.
Then poll every interval seconds:
Revyl delivers the credential once. If you stop polling before you collect it, issue one with
Rotate the credential.
Use the connection credential
The credential is an opaque API key for the connected workspace, withexpires_at beside it.
Revyl returns it only when it’s created, so store it on your servers. Use it like a Revyl API
key: send it as a bearer token to the Revyl API, or set it as REVYL_API_KEY for the
CLI.
Rotate the credential
201). The credential it replaces
keeps working for a short grace period (two hours by default), so work already running on it can
finish. A credential replaced by an earlier rotation, and every session credential, stops working
at once. Rotate before expires_at, and after you lose a credential.
Mint a session credential
For a short-lived runtime, such as a VM that runs one job, mint a session credential instead of copying the connection credential:ttl_seconds is 60 to 14,400 and defaults to 7,200.
The response returns credential_id and the secret once. A session credential also ends when
you rotate the connection credential or disconnect, and you can revoke one early with
DELETE /api/v1/partner/connections/{external_account_id}/session-credentials/{credential_id}.
A revoked, expired, or ended session credential answers 401; mint a new one. A 503 means Revyl
couldn’t check it; retry.
Invite teammates
For a workspace Revyl created for the account, you can invite people as Members:403 not_supported_for_connection, because its own admins invite people.
Check and disconnect
GET /api/v1/partner/connections/{external_account_id} returns the account’s state:
connected, awaiting_approval, or not_connected. Treat any state you don’t recognize as
not usable.
To end a connection:
DELETE /api/v1/embeds/{embed_id} first. The workspace and its data stay with
the customer. It’s safe to repeat: 204 means nothing is left to stop.
To open the workspace for a person, see Dashboard links.