API reference
Partner administration
Organization-level operations with your partner API key, in both billing modes: linked users, the seat read, webhooks.
Set a user's templates
put/v2/partner/users/{externalUserId}/templates
Authenticate with your partner API key and the Twofold-Client-Id header.
Path parameters
externalUserIdstringrequiredThe partner's id for the linked user, bound at link time.
Request bodyJSON
templateIdsarray of stringrequiredThe full set of your base templates this user should have — replaces the previous assignment; templates you did not author are unaffected. Ids come from the partner console. At least one id is required: an empty set would leave the provider unable to record, so it is refused.
Response200
The assignment was applied. Idempotent: sending the current set changes nothing.
templateIdsarray of stringThe base templates assigned to the user after this call.
Example request
curl -X PUT https://partner-api.trytwofold.com/v2/partner/users/provider-1042/templates \
-H "Authorization: Bearer twofold_key_prod_…" \
-H "Twofold-Client-Id: prtn_ab12Cd34Ef56" \
-H "Content-Type: application/json" \
-d '{
"templateIds": [
"ct_ab12Cd34Ef56"
]
}'curl -X PUT https://partner-api.staging.trytwofold.com/v2/partner/users/provider-1042/templates \
-H "Authorization: Bearer twofold_key_staging_…" \
-H "Twofold-Client-Id: prtn_ab12Cd34Ef56" \
-H "Content-Type: application/json" \
-d '{
"templateIds": [
"ct_ab12Cd34Ef56"
]
}'Example response
{
"templateIds": [
"…"
]
}{
"templateIds": [
"…"
]
}Errors
400The request is invalid. param names the offending parameter when there is one. Possible error.code values: invalid_parameters, template_not_found.
401Authentication failed — the API key or the Twofold-Client-Id header is missing, wrong or revoked. Possible error.code values: missing_client_id, missing_api_key, wrong_environment_api_key, invalid_api_key, api_key_revoked, client_id_mismatch.
403The credential is valid but this partner may not act yet. Possible error.code values: partner_not_activated.
404The addressed resource does not exist for this credential. Possible error.code values: user_not_found.
429Rate limit exceeded: 100 requests/second (burst 200) per API key. Wait Retry-After seconds and retry. Possible error.code values: rate_limit_exceeded.
500Something failed on Twofold's side, or the partner API is temporarily paused (temporarily_unavailable). Safe to retry. Possible error.code values: internal_error, temporarily_unavailable.
End a user's link
post/v2/partner/users/{externalUserId}/revoke
Authenticate with your partner API key and the Twofold-Client-Id header.
Path parameters
externalUserIdstringrequiredThe partner's id for the linked user, bound at link time.
Response200
The link is ended and every token on it is dead, and on usage billing its open seat is ended with it. accessLevel keeps the value it had; a revoked link grants nothing whatever it reads. Idempotent: revoking a user whose link has already ended succeeds and reports the link as revoked.
externalUserIdstringThe partner's id for this user, bound at link time.
twofoldUserIdstringTwofold's stable id for the user.
linkStatusenumWhether the link is still in force. Listing and the administration endpoints only ever see currently-linked users, so this is "active" everywhere except the response to a revoke.
activerevoked
accessLevelenumFULL_ACCESS consumes a partner seat and unlocks the full app; READ_ONLY users are prompted to activate via the partner.
FULL_ACCESSREAD_ONLY
linkedAtstringWhen the current link was created, ISO 8601 UTC.
groupExternalIdstring | nullUsage billing only: the group id you sent on the last seat/start call for this user. Null for a user you have never started a seat for, and always null on a seat subscription.
seatobject | nullUsage billing only: the user's open seat, or null when none is open. Always null on a seat subscription.
planenummonthly bills a period starting on the seat's start day every month while the seat is open; annual bills twelve months up front and renews on the anniversary while the seat is open.
monthlyannual
startedAtstringWhen this seat term started, ISO 8601 UTC.
annualTermEndsAtstring | nullAnnual seats only: when the paid twelve-month term ends. The term renews for another year if the seat is still open at that instant; end the seat before it to stop the renewal. Null for monthly seats.
Example request
curl -X POST https://partner-api.trytwofold.com/v2/partner/users/provider-1042/revoke \
-H "Authorization: Bearer twofold_key_prod_…" \
-H "Twofold-Client-Id: prtn_ab12Cd34Ef56"curl -X POST https://partner-api.staging.trytwofold.com/v2/partner/users/provider-1042/revoke \
-H "Authorization: Bearer twofold_key_staging_…" \
-H "Twofold-Client-Id: prtn_ab12Cd34Ef56"Example response
{
"externalUserId": "provider-1042",
"twofoldUserId": "user_ab12Cd34Ef56",
"linkStatus": "revoked",
"accessLevel": "FULL_ACCESS",
"linkedAt": "2026-08-15T14:02:11.000Z",
"groupExternalId": "grp_8f31",
"seat": null
}{
"externalUserId": "provider-1042",
"twofoldUserId": "user_ab12Cd34Ef56",
"linkStatus": "revoked",
"accessLevel": "FULL_ACCESS",
"linkedAt": "2026-08-15T14:02:11.000Z",
"groupExternalId": "grp_8f31",
"seat": null
}Errors
400The request is invalid. param names the offending parameter when there is one. Possible error.code values: invalid_parameters.
401Authentication failed — the API key or the Twofold-Client-Id header is missing, wrong or revoked. Possible error.code values: missing_client_id, missing_api_key, wrong_environment_api_key, invalid_api_key, api_key_revoked, client_id_mismatch.
403The credential is valid but this partner may not act yet. Possible error.code values: partner_not_activated.
404The addressed resource does not exist for this credential. Possible error.code values: user_not_found.
429Rate limit exceeded: 100 requests/second (burst 200) per API key. Wait Retry-After seconds and retry. Possible error.code values: rate_limit_exceeded.
500Something failed on Twofold's side, or the partner API is temporarily paused (temporarily_unavailable). Safe to retry. Possible error.code values: internal_error, temporarily_unavailable.
List linked users
get/v2/partner/users
Authenticate with your partner API key and the Twofold-Client-Id header.
Query parameters
limitinteger · default 25Page size, 1-100.
cursorstringOpaque cursor from the previous page's nextCursor. Omit for the first page.
Response200
The partner's linked users, newest link first.
dataarray of objectOne page of linked users, newest link first.
externalUserIdstringThe partner's id for this user, bound at link time.
twofoldUserIdstringTwofold's stable id for the user.
linkStatusenumWhether the link is still in force. Listing and the administration endpoints only ever see currently-linked users, so this is "active" everywhere except the response to a revoke.
activerevoked
accessLevelenumFULL_ACCESS consumes a partner seat and unlocks the full app; READ_ONLY users are prompted to activate via the partner.
FULL_ACCESSREAD_ONLY
linkedAtstringWhen the current link was created, ISO 8601 UTC.
groupExternalIdstring | nullUsage billing only: the group id you sent on the last seat/start call for this user. Null for a user you have never started a seat for, and always null on a seat subscription.
seatobject | nullUsage billing only: the user's open seat, or null when none is open. Always null on a seat subscription.
planenummonthly bills a period starting on the seat's start day every month while the seat is open; annual bills twelve months up front and renews on the anniversary while the seat is open.
monthlyannual
startedAtstringWhen this seat term started, ISO 8601 UTC.
annualTermEndsAtstring | nullAnnual seats only: when the paid twelve-month term ends. The term renews for another year if the seat is still open at that instant; end the seat before it to stop the renewal. Null for monthly seats.
nextCursorstring | nullOpaque cursor for the next page; null when this is the last page.
Example request
curl https://partner-api.trytwofold.com/v2/partner/users \
-H "Authorization: Bearer twofold_key_prod_…" \
-H "Twofold-Client-Id: prtn_ab12Cd34Ef56"curl https://partner-api.staging.trytwofold.com/v2/partner/users \
-H "Authorization: Bearer twofold_key_staging_…" \
-H "Twofold-Client-Id: prtn_ab12Cd34Ef56"Example response
{
"data": [
{
"externalUserId": "provider-1042",
"twofoldUserId": "user_ab12Cd34Ef56",
"linkStatus": "active",
"accessLevel": "FULL_ACCESS",
"linkedAt": "2026-04-01T17:32:04.000Z",
"groupExternalId": "grp_8f31",
"seat": {
"plan": "monthly",
"startedAt": "2026-04-01T17:32:04.000Z",
"annualTermEndsAt": null
}
}
],
"nextCursor": null
}{
"data": [
{
"externalUserId": "provider-1042",
"twofoldUserId": "user_ab12Cd34Ef56",
"linkStatus": "active",
"accessLevel": "FULL_ACCESS",
"linkedAt": "2026-04-01T17:32:04.000Z",
"groupExternalId": "grp_8f31",
"seat": {
"plan": "monthly",
"startedAt": "2026-04-01T17:32:04.000Z",
"annualTermEndsAt": null
}
}
],
"nextCursor": null
}Errors
400The request is invalid. param names the offending parameter when there is one. Possible error.code values: invalid_parameters.
401Authentication failed — the API key or the Twofold-Client-Id header is missing, wrong or revoked. Possible error.code values: missing_client_id, missing_api_key, wrong_environment_api_key, invalid_api_key, api_key_revoked, client_id_mismatch.
403The credential is valid but this partner may not act yet. Possible error.code values: partner_not_activated.
429Rate limit exceeded: 100 requests/second (burst 200) per API key. Wait Retry-After seconds and retry. Possible error.code values: rate_limit_exceeded.
500Something failed on Twofold's side, or the partner API is temporarily paused (temporarily_unavailable). Safe to retry. Possible error.code values: internal_error, temporarily_unavailable.
Get seat usage
get/v2/partner/seats
Authenticate with your partner API key and the Twofold-Client-Id header.
Response200
Your organization's current seat usage. On a seat subscription the body is billingMode partner_level_seat_subscriptions, your seatsAllowed and seatsUsed, and no seatsByPlan.
billingModeenumWhich billing mode your organization is on, and so which endpoints apply to you: partner_level_seat_subscriptions (a seat subscription: access-level and set-seats) or provider_seat_usage (usage billing: seat/start and seat/end). Twofold sets it; it does not change on its own.
partner_level_seat_subscriptionsprovider_seat_usage
seatsAllowedinteger | nullSeat subscriptions: how many FULL_ACCESS seats your contract covers — null when no seat count has been configured yet, and no user can be set to FULL_ACCESS until one is. Usage billing: always null, there is no cap in that mode.
seatsUsedintegerSeat subscriptions: how many currently-linked users are on FULL_ACCESS. Usage billing: how many seats are open right now, the total of seatsByPlan.
seatsByPlanobjectUsage billing only: the open seats by plan. Absent on a seat subscription.
monthlyintegerannualintegerExample request
curl https://partner-api.trytwofold.com/v2/partner/seats \
-H "Authorization: Bearer twofold_key_prod_…" \
-H "Twofold-Client-Id: prtn_ab12Cd34Ef56"curl https://partner-api.staging.trytwofold.com/v2/partner/seats \
-H "Authorization: Bearer twofold_key_staging_…" \
-H "Twofold-Client-Id: prtn_ab12Cd34Ef56"Example response
{
"billingMode": "provider_seat_usage",
"seatsAllowed": null,
"seatsUsed": 42,
"seatsByPlan": {
"monthly": 30,
"annual": 12
}
}{
"billingMode": "provider_seat_usage",
"seatsAllowed": null,
"seatsUsed": 42,
"seatsByPlan": {
"monthly": 30,
"annual": 12
}
}Errors
400The request is invalid. param names the offending parameter when there is one. Possible error.code values: invalid_parameters.
401Authentication failed — the API key or the Twofold-Client-Id header is missing, wrong or revoked. Possible error.code values: missing_client_id, missing_api_key, wrong_environment_api_key, invalid_api_key, api_key_revoked, client_id_mismatch.
403The credential is valid but this partner may not act yet. Possible error.code values: partner_not_activated.
429Rate limit exceeded: 100 requests/second (burst 200) per API key. Wait Retry-After seconds and retry. Possible error.code values: rate_limit_exceeded.
500Something failed on Twofold's side, or the partner API is temporarily paused (temporarily_unavailable). Safe to retry. Possible error.code values: internal_error, temporarily_unavailable.
Get webhook keys
get/v2/partner/webhook-keys
Authenticate with your partner API key and the Twofold-Client-Id header.
Response200
The partner's current and previous webhook keys.
keysobjectRead Twofold-Key-Id (or the JWE kid) off the delivery and decrypt with whichever of these two matches. Keys rotate every 10 minutes, so cache this response for a few minutes at most — and re-fetch on an unknown key id rather than per delivery.
latestobject | nullThe key Twofold is sealing with now. Null only if no key has been minted yet.
keyIdstringMatches the delivery's Twofold-Key-Id header and the JWE kid.
keystringThe base64url-encoded 256-bit key to decrypt with.
previousobject | nullThe key from before the last rotation, still valid for deliveries sealed with it. Null until the first rotation.
keyIdstringMatches the delivery's Twofold-Key-Id header and the JWE kid.
keystringThe base64url-encoded 256-bit key to decrypt with.
Example request
curl https://partner-api.trytwofold.com/v2/partner/webhook-keys \
-H "Authorization: Bearer twofold_key_prod_…" \
-H "Twofold-Client-Id: prtn_ab12Cd34Ef56"curl https://partner-api.staging.trytwofold.com/v2/partner/webhook-keys \
-H "Authorization: Bearer twofold_key_staging_…" \
-H "Twofold-Client-Id: prtn_ab12Cd34Ef56"Example response
{
"keys": {
"latest": {
"keyId": "019860ab-1c2d-7e3f-8a9b-0c1d2e3f4a5b",
"key": "9c0Yy1t9y2c1V0kFQ0m0dQ4b6a1nJm2Cq8Ib2Xy7cQ0"
},
"previous": {
"keyId": "019860a2-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
"key": "Qm4tR7vX2zB5nC8kL1pS6wD9fG3hJ0aE7uI4oY2rT5e"
}
}
}{
"keys": {
"latest": {
"keyId": "019860ab-1c2d-7e3f-8a9b-0c1d2e3f4a5b",
"key": "9c0Yy1t9y2c1V0kFQ0m0dQ4b6a1nJm2Cq8Ib2Xy7cQ0"
},
"previous": {
"keyId": "019860a2-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
"key": "Qm4tR7vX2zB5nC8kL1pS6wD9fG3hJ0aE7uI4oY2rT5e"
}
}
}Errors
400The request is invalid. param names the offending parameter when there is one. Possible error.code values: invalid_parameters.
401Authentication failed — the API key or the Twofold-Client-Id header is missing, wrong or revoked. Possible error.code values: missing_client_id, missing_api_key, wrong_environment_api_key, invalid_api_key, api_key_revoked, client_id_mismatch.
403The credential is valid but this partner may not act yet. Possible error.code values: partner_not_activated.
429Rate limit exceeded: 100 requests/second (burst 200) per API key. Wait Retry-After seconds and retry. Possible error.code values: rate_limit_exceeded.
500Something failed on Twofold's side, or the partner API is temporarily paused (temporarily_unavailable). Safe to retry. Possible error.code values: internal_error, temporarily_unavailable.
Send a test webhook
post/v2/partner/webhooks/test
Authenticate with your partner API key and the Twofold-Client-Id header.
Request bodyJSON
typeenumrequiredThe event type to fire.
note.startednote.recording_pausednote.recording_resumednote.recording_endednote.generated_successfullynote.editednote.failednote.deletedlink.revoked
Response200
The delivery was attempted. A non-2xx from the configured endpoint is reported in this body, not as an error status — the request itself succeeded.
eventIdstringThe id of the event that was fired, matching its id in the sealed body.
deliveredbooleanWhether the configured endpoint answered with a 2xx within the 20-second timeout.
responseStatusCodeinteger | nullThe HTTP status the endpoint answered with; null when it could not be reached.
errorstring | nullWhy the delivery failed; null when it succeeded.
Example request
curl -X POST https://partner-api.trytwofold.com/v2/partner/webhooks/test \
-H "Authorization: Bearer twofold_key_prod_…" \
-H "Twofold-Client-Id: prtn_ab12Cd34Ef56" \
-H "Content-Type: application/json" \
-d '{
"type": "note.generated_successfully"
}'curl -X POST https://partner-api.staging.trytwofold.com/v2/partner/webhooks/test \
-H "Authorization: Bearer twofold_key_staging_…" \
-H "Twofold-Client-Id: prtn_ab12Cd34Ef56" \
-H "Content-Type: application/json" \
-d '{
"type": "note.generated_successfully"
}'Example response
{
"eventId": "evt_ab12Cd34Ef56",
"delivered": true,
"responseStatusCode": 200,
"error": null
}{
"eventId": "evt_ab12Cd34Ef56",
"delivered": true,
"responseStatusCode": 200,
"error": null
}Errors
400The request is invalid. param names the offending parameter when there is one. Possible error.code values: invalid_parameters, webhook_url_not_configured.
401Authentication failed — the API key or the Twofold-Client-Id header is missing, wrong or revoked. Possible error.code values: missing_client_id, missing_api_key, wrong_environment_api_key, invalid_api_key, api_key_revoked, client_id_mismatch.
403The credential is valid but this partner may not act yet. Possible error.code values: partner_not_activated.
429Rate limit exceeded: 100 requests/second (burst 200) per API key. Wait Retry-After seconds and retry. Possible error.code values: rate_limit_exceeded.
500Something failed on Twofold's side, or the partner API is temporarily paused (temporarily_unavailable). Safe to retry. Possible error.code values: internal_error, temporarily_unavailable.