Twofold v2.7

Search pages, sections and endpoints.

    Open the console

    API reference

    Partner administration

    Organization-level operations with your partner API key, in both billing modes: linked users, the seat read, webhooks.

    Environment

    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

    externalUserIdstringrequired

    The partner's id for the linked user, bound at link time.

    Request bodyJSON

    templateIdsarray of stringrequired

    The 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 string

    The base templates assigned to the user after this call.

    Example request

    bash
    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"
      ]
    }'
    bash
    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

    json
    {
      "templateIds": [
        "…"
      ]
    }
    json
    {
      "templateIds": [
        "…"
      ]
    }

    Errors

    400

    The request is invalid. param names the offending parameter when there is one. Possible error.code values: invalid_parameters, template_not_found.

    401

    Authentication 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.

    403

    The credential is valid but this partner may not act yet. Possible error.code values: partner_not_activated.

    404

    The addressed resource does not exist for this credential. Possible error.code values: user_not_found.

    429

    Rate limit exceeded: 100 requests/second (burst 200) per API key. Wait Retry-After seconds and retry. Possible error.code values: rate_limit_exceeded.

    500

    Something 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 25

    Page size, 1-100.

    cursorstring

    Opaque cursor from the previous page's nextCursor. Omit for the first page.

    Response200

    The partner's linked users, newest link first.

    dataarray of object

    One page of linked users, newest link first.

    externalUserIdstring

    The partner's id for this user, bound at link time.

    twofoldUserIdstring

    Twofold's stable id for the user.

    linkStatusenum

    Whether 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

    accessLevelenum

    FULL_ACCESS consumes a partner seat and unlocks the full app; READ_ONLY users are prompted to activate via the partner.

    FULL_ACCESSREAD_ONLY

    linkedAtstring

    When the current link was created, ISO 8601 UTC.

    groupExternalIdstring | null

    Usage 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 | null

    Usage billing only: the user's open seat, or null when none is open. Always null on a seat subscription.

    planenum

    monthly 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

    startedAtstring

    When this seat term started, ISO 8601 UTC.

    annualTermEndsAtstring | null

    Annual 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 | null

    Opaque cursor for the next page; null when this is the last page.

    Example request

    bash
    curl https://partner-api.trytwofold.com/v2/partner/users \
      -H "Authorization: Bearer twofold_key_prod_…" \
      -H "Twofold-Client-Id: prtn_ab12Cd34Ef56"
    bash
    curl https://partner-api.staging.trytwofold.com/v2/partner/users \
      -H "Authorization: Bearer twofold_key_staging_…" \
      -H "Twofold-Client-Id: prtn_ab12Cd34Ef56"

    Example response

    json
    {
      "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
    }
    json
    {
      "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

    400

    The request is invalid. param names the offending parameter when there is one. Possible error.code values: invalid_parameters.

    401

    Authentication 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.

    403

    The credential is valid but this partner may not act yet. Possible error.code values: partner_not_activated.

    429

    Rate limit exceeded: 100 requests/second (burst 200) per API key. Wait Retry-After seconds and retry. Possible error.code values: rate_limit_exceeded.

    500

    Something 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.

    billingModeenum

    Which 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 | null

    Seat 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.

    seatsUsedinteger

    Seat subscriptions: how many currently-linked users are on FULL_ACCESS. Usage billing: how many seats are open right now, the total of seatsByPlan.

    seatsByPlanobject

    Usage billing only: the open seats by plan. Absent on a seat subscription.

    monthlyinteger
    annualinteger

    Example request

    bash
    curl https://partner-api.trytwofold.com/v2/partner/seats \
      -H "Authorization: Bearer twofold_key_prod_…" \
      -H "Twofold-Client-Id: prtn_ab12Cd34Ef56"
    bash
    curl https://partner-api.staging.trytwofold.com/v2/partner/seats \
      -H "Authorization: Bearer twofold_key_staging_…" \
      -H "Twofold-Client-Id: prtn_ab12Cd34Ef56"

    Example response

    json
    {
      "billingMode": "provider_seat_usage",
      "seatsAllowed": null,
      "seatsUsed": 42,
      "seatsByPlan": {
        "monthly": 30,
        "annual": 12
      }
    }
    json
    {
      "billingMode": "provider_seat_usage",
      "seatsAllowed": null,
      "seatsUsed": 42,
      "seatsByPlan": {
        "monthly": 30,
        "annual": 12
      }
    }

    Errors

    400

    The request is invalid. param names the offending parameter when there is one. Possible error.code values: invalid_parameters.

    401

    Authentication 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.

    403

    The credential is valid but this partner may not act yet. Possible error.code values: partner_not_activated.

    429

    Rate limit exceeded: 100 requests/second (burst 200) per API key. Wait Retry-After seconds and retry. Possible error.code values: rate_limit_exceeded.

    500

    Something 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.

    keysobject

    Read 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 | null

    The key Twofold is sealing with now. Null only if no key has been minted yet.

    keyIdstring

    Matches the delivery's Twofold-Key-Id header and the JWE kid.

    keystring

    The base64url-encoded 256-bit key to decrypt with.

    previousobject | null

    The key from before the last rotation, still valid for deliveries sealed with it. Null until the first rotation.

    keyIdstring

    Matches the delivery's Twofold-Key-Id header and the JWE kid.

    keystring

    The base64url-encoded 256-bit key to decrypt with.

    Example request

    bash
    curl https://partner-api.trytwofold.com/v2/partner/webhook-keys \
      -H "Authorization: Bearer twofold_key_prod_…" \
      -H "Twofold-Client-Id: prtn_ab12Cd34Ef56"
    bash
    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

    json
    {
      "keys": {
        "latest": {
          "keyId": "019860ab-1c2d-7e3f-8a9b-0c1d2e3f4a5b",
          "key": "9c0Yy1t9y2c1V0kFQ0m0dQ4b6a1nJm2Cq8Ib2Xy7cQ0"
        },
        "previous": {
          "keyId": "019860a2-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
          "key": "Qm4tR7vX2zB5nC8kL1pS6wD9fG3hJ0aE7uI4oY2rT5e"
        }
      }
    }
    json
    {
      "keys": {
        "latest": {
          "keyId": "019860ab-1c2d-7e3f-8a9b-0c1d2e3f4a5b",
          "key": "9c0Yy1t9y2c1V0kFQ0m0dQ4b6a1nJm2Cq8Ib2Xy7cQ0"
        },
        "previous": {
          "keyId": "019860a2-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
          "key": "Qm4tR7vX2zB5nC8kL1pS6wD9fG3hJ0aE7uI4oY2rT5e"
        }
      }
    }

    Errors

    400

    The request is invalid. param names the offending parameter when there is one. Possible error.code values: invalid_parameters.

    401

    Authentication 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.

    403

    The credential is valid but this partner may not act yet. Possible error.code values: partner_not_activated.

    429

    Rate limit exceeded: 100 requests/second (burst 200) per API key. Wait Retry-After seconds and retry. Possible error.code values: rate_limit_exceeded.

    500

    Something 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

    typeenumrequired

    The 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.

    eventIdstring

    The id of the event that was fired, matching its id in the sealed body.

    deliveredboolean

    Whether the configured endpoint answered with a 2xx within the 20-second timeout.

    responseStatusCodeinteger | null

    The HTTP status the endpoint answered with; null when it could not be reached.

    errorstring | null

    Why the delivery failed; null when it succeeded.

    Example request

    bash
    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"
    }'
    bash
    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

    json
    {
      "eventId": "evt_ab12Cd34Ef56",
      "delivered": true,
      "responseStatusCode": 200,
      "error": null
    }
    json
    {
      "eventId": "evt_ab12Cd34Ef56",
      "delivered": true,
      "responseStatusCode": 200,
      "error": null
    }

    Errors

    400

    The request is invalid. param names the offending parameter when there is one. Possible error.code values: invalid_parameters, webhook_url_not_configured.

    401

    Authentication 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.

    403

    The credential is valid but this partner may not act yet. Possible error.code values: partner_not_activated.

    429

    Rate limit exceeded: 100 requests/second (burst 200) per API key. Wait Retry-After seconds and retry. Possible error.code values: rate_limit_exceeded.

    500

    Something 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.