Widget API
Embeddable widget: mint short-lived widget tokens (Bearer) and drive campaigns with them (Widget token).
- POST
/widget/tokenMint a widget token - POST
/widget/token/revokeRevoke a widget token - GET
/widget/campaigns/{id}/statusGet campaign status (widget token) - POST
/widget/campaigns/{id}/startStart a campaign (widget token) - POST
/widget/campaigns/{id}/stopStop a campaign (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
| Field | Type | Description |
|---|---|---|
campaign_ids | array of integer required | Non-empty list of campaign ids the token may drive. min items 1 |
ttl | integer | Token lifetime in seconds. Default |
allowed_origins | array 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
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
data | object required | A minted widget token and its grants. |
data.token | string | |
data.expires_in | integer | TTL in seconds. |
data.campaign_ids | array of integer | |
data.allowed_origins | array of string | |
data.scopes | array 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
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
error | object required | |
error.code | string required | e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED. |
error.message | string required | |
error.retry_after | integer | Seconds; present on 429 only. |
Shape 2 of 2
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
error | object required | |
error.message | string required | |
error.code | string required | Machine-readable error code, e.g. bad_request, not_found. |
error.details | object | 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
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
error | object required | |
error.code | string required | e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED. |
error.message | string required | |
error.retry_after | integer | Seconds; present on 429 only. |
Shape 2 of 2
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
error | object required | |
error.message | string required | |
error.code | string required | Machine-readable error code, e.g. bad_request, not_found. |
error.details | object | 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
| Field | Type | Description |
|---|---|---|
token | string 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
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
data | object required | |
data.revoked | boolean | |
data.jti | string | null | |
data.revoked_until | integer | null | Unix timestamp (seconds) of the token's expiry; the revocation is held until then. |
data.note | 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
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
error | object required | |
error.code | string required | e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED. |
error.message | string required | |
error.retry_after | integer | Seconds; present on 429 only. |
Shape 2 of 2
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
error | object required | |
error.message | string required | |
error.code | string required | Machine-readable error code, e.g. bad_request, not_found. |
error.details | object | 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
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
error | object required | |
error.code | string required | e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED. |
error.message | string required | |
error.retry_after | integer | Seconds; present on 429 only. |
Shape 2 of 2
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
error | object required | |
error.message | string required | |
error.code | string required | Machine-readable error code, e.g. bad_request, not_found. |
error.details | object | 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
| Name | In | Type | Description |
|---|---|---|---|
id | path | integer required | Campaign id |
Responses
200 Success
Response fields
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
data | object required | |
data.campaign_id | integer | |
data.name | string | |
data.status | string | |
data.progress | object | |
data.progress.total_contacts | integer | |
data.progress.completed | integer | |
data.progress.failed | integer | |
data.progress.pending | integer | |
data.progress.in_progress | integer | |
data.outcomes | object | 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
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
error | object required | |
error.code | string required | e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED. |
error.message | string required | |
error.retry_after | integer | Seconds; present on 429 only. |
Shape 2 of 2
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
error | object required | |
error.message | string required | |
error.code | string required | Machine-readable error code, e.g. bad_request, not_found. |
error.details | object | 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
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
error | object required | |
error.code | string required | e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED. |
error.message | string required | |
error.retry_after | integer | Seconds; present on 429 only. |
Shape 2 of 2
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
error | string required | Example |
retry_after | integer 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
| Name | In | Type | Description |
|---|---|---|---|
id | path | integer required | Campaign id |
Responses
200 Started
Response fields
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
data | object required | |
data.campaign_id | integer | |
data.status | string | Always |
data.message | string |
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
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
error | object required | |
error.code | string required | e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED. |
error.message | string required | |
error.retry_after | integer | Seconds; present on 429 only. |
Shape 2 of 2
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
error | object required | |
error.message | string required | |
error.code | string required | Machine-readable error code, e.g. bad_request, not_found. |
error.details | object | 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
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
error | object required | |
error.code | string required | e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED. |
error.message | string required | |
error.retry_after | integer | Seconds; present on 429 only. |
Shape 2 of 2
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
error | string required | Example |
retry_after | integer 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
| Name | In | Type | Description |
|---|---|---|---|
id | path | integer required | Campaign id |
Responses
200 Stopped
Response fields
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
data | object required | |
data.campaign_id | integer | |
data.status | string | Always |
data.message | string |
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
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
error | object required | |
error.code | string required | e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED. |
error.message | string required | |
error.retry_after | integer | Seconds; present on 429 only. |
Shape 2 of 2
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
error | object required | |
error.message | string required | |
error.code | string required | Machine-readable error code, e.g. bad_request, not_found. |
error.details | object | 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
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
error | object required | |
error.code | string required | e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED. |
error.message | string required | |
error.retry_after | integer | Seconds; present on 429 only. |
Shape 2 of 2
| Field | Type | Description |
|---|---|---|
success | boolean required | Always |
error | string required | Example |
retry_after | integer 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