← API reference

Widget API

Embeddable widget: mint short-lived widget tokens (Bearer) and drive campaigns with them (Widget token).

POST /widget/token

Mint a widget token

Auth: API key (Authorization: Bearer). Scope: widget:create.

Mints a short-lived HMAC widget token scoped to specific campaigns (and optionally origins), for embedding in a browser widget. Each campaign id must exist and belong to the calling org (404 otherwise). The returned token authenticates the /widget/campaigns/* operations.

Requires the widget:create scope.

Request body application/json required

FieldTypeDescription
campaign_idsarray of integer required

Non-empty list of campaign ids the token may drive.

min items 1

ttlinteger

Token lifetime in seconds.

Default 3600 · min 1 · max 86400

allowed_originsarray of string

Optional http(s) origins (scheme://host[:port], no path) the token is bound to.

Responses

200 Token minted

Headers: X-Request-ID, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-API-Key-Expires-At, X-API-Key-Expires-In-Days

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required

A minted widget token and its grants.

data.tokenstring
data.expires_ininteger

TTL in seconds.

data.campaign_idsarray of integer
data.allowed_originsarray of string
data.scopesarray of string

400 Invalid request (validation errors under error.details.validation_errors).

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Authenticated but not permitted (insufficient scope uses the auth envelope with code INSUFFICIENT_SCOPE; policy/plan denials use the router envelope).

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

404 Resource not found (also returned for cross-tenant ids to avoid existence leaks).

429 Rate limit exceeded.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

POST /widget/token/revoke

Revoke a widget token

Auth: API key (Authorization: Bearer). Scope: widget:create.

Best-effort revocation of a widget token by its jti (via the shared token cache). For guaranteed revocation of all of the org's widget tokens, rotate the organization API key. A token belonging to another org returns the same generic error (no cross-org oracle).

Requires the widget:create scope.

Request body application/json required

FieldTypeDescription
tokenstring required

Responses

200 Revoked (best-effort)

Headers: X-Request-ID, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-API-Key-Expires-At, X-API-Key-Expires-In-Days

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required
data.revokedboolean
data.jtistring | null
data.revoked_untilinteger | null

Unix timestamp (seconds) of the token's expiry; the revocation is held until then.

data.notestring

400 Invalid request (validation errors under error.details.validation_errors).

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Authenticated but not permitted (insufficient scope uses the auth envelope with code INSUFFICIENT_SCOPE; policy/plan denials use the router envelope).

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

429 Rate limit exceeded.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

GET /widget/campaigns/{id}/status

Get campaign status (widget token)

Auth: widget token (Authorization: Widget). Scope: widget:campaign:status.

Campaign status and progress. Authenticated with a Widget token (Authorization: Widget <token>) that grants access to this campaign.

Requires the widget:campaign:status scope.

Parameters

NameInTypeDescription
idpathinteger required

Campaign id

Responses

200 Success

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required
data.campaign_idinteger
data.namestring
data.statusstring
data.progressobject
data.progress.total_contactsinteger
data.progress.completedinteger
data.progress.failedinteger
data.progress.pendinginteger
data.progress.in_progressinteger
data.outcomesobject

Accepts any keys

401 Missing or invalid widget token. error.code is MISSING_AUTH, INVALID_AUTH_FORMAT (not Authorization: Widget <token>) or INVALID_WIDGET_TOKEN (bad signature, expired or revoked).

403 Auth envelope with ORIGIN_MISMATCH (the request origin is not one of the token's allowed origins) or INSUFFICIENT_SCOPE; or router envelope with forbidden when the token does not grant access to this campaign.

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

404 Resource not found (also returned for cross-tenant ids to avoid existence leaks).

429 One of two limits. Per organization, 100 per minute and 5000 per hour: auth envelope with code RATE_LIMITED, no retry_after field and no Retry-After header. Per client IP, 60 per minute and 600 per hour, applied before authentication: SessionRateLimitError body with a Retry-After header. Neither sends X-RateLimit-* headers.

Headers: Retry-After

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorstring required

Example Rate limit exceeded. Try again in 30 seconds.

retry_afterinteger required

Seconds.

POST /widget/campaigns/{id}/start

Start a campaign (widget token)

Auth: widget token (Authorization: Widget). Scope: widget:campaign:start.

Starts a campaign (allowed from ready/scheduled/paused). Authenticated with a Widget token that grants access to this campaign.

Returns 400 when the campaign is in another status, has no contacts, or its voice agent is missing or does not belong to the organization.

Requires the widget:campaign:start scope.

Parameters

NameInTypeDescription
idpathinteger required

Campaign id

Responses

200 Started

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required
data.campaign_idinteger
data.statusstring

Always running

data.messagestring

400 Invalid request (validation errors under error.details.validation_errors).

401 Missing or invalid widget token. error.code is MISSING_AUTH, INVALID_AUTH_FORMAT (not Authorization: Widget <token>) or INVALID_WIDGET_TOKEN (bad signature, expired or revoked).

403 Auth envelope with ORIGIN_MISMATCH (the request origin is not one of the token's allowed origins) or INSUFFICIENT_SCOPE; or router envelope with forbidden when the token does not grant access to this campaign.

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

404 Resource not found (also returned for cross-tenant ids to avoid existence leaks).

429 One of two limits. Per organization, 100 per minute and 5000 per hour: auth envelope with code RATE_LIMITED, no retry_after field and no Retry-After header. Per client IP, 60 per minute and 600 per hour, applied before authentication: SessionRateLimitError body with a Retry-After header. Neither sends X-RateLimit-* headers.

Headers: Retry-After

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorstring required

Example Rate limit exceeded. Try again in 30 seconds.

retry_afterinteger required

Seconds.

POST /widget/campaigns/{id}/stop

Stop a campaign (widget token)

Auth: widget token (Authorization: Widget). Scope: widget:campaign:stop.

Stops a running campaign. Authenticated with a Widget token that grants access to this campaign.

Requires the widget:campaign:stop scope.

Parameters

NameInTypeDescription
idpathinteger required

Campaign id

Responses

200 Stopped

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required
data.campaign_idinteger
data.statusstring

Always completed

data.messagestring

400 Invalid request (validation errors under error.details.validation_errors).

401 Missing or invalid widget token. error.code is MISSING_AUTH, INVALID_AUTH_FORMAT (not Authorization: Widget <token>) or INVALID_WIDGET_TOKEN (bad signature, expired or revoked).

403 Auth envelope with ORIGIN_MISMATCH (the request origin is not one of the token's allowed origins) or INSUFFICIENT_SCOPE; or router envelope with forbidden when the token does not grant access to this campaign.

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

404 Resource not found (also returned for cross-tenant ids to avoid existence leaks).

429 One of two limits. Per organization, 100 per minute and 5000 per hour: auth envelope with code RATE_LIMITED, no retry_after field and no Retry-After header. Per client IP, 60 per minute and 600 per hour, applied before authentication: SessionRateLimitError body with a Retry-After header. Neither sends X-RateLimit-* headers.

Headers: Retry-After

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorstring required

Example Rate limit exceeded. Try again in 30 seconds.

retry_afterinteger required

Seconds.

Ready to build on Vosy?

API access is included with the Business and Enterprise plans. Sign up, choose a plan with API access, and create your own keys from the Vosy API page in your account. Compare plans

Get Started