Twofold v2.7

Search pages, sections and endpoints.

    Open the console

    API reference

    Usage billing

    Usage billing only — starting and ending a seat per provider when your organization is billed per seat in use. See the Billing modes guide.

    Environment

    Start a user's seat

    post/v2/partner/users/{externalUserId}/seat/start

    Authenticate with your partner API key and the Twofold-Client-Id header.

    Usage billing only. On a seat subscription, access is set with access-level instead.

    Path parameters

    externalUserIdstringrequired

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

    Request bodyJSON

    planenumrequired

    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

    groupExternalIdstringrequired

    Your id for the group this user belongs to. Stored and shown back to you for reconciliation, never interpreted by Twofold. Sent on every start; a start on an already-open seat updates it without changing the seat.

    Response200

    The user has FULL_ACCESS and an open seat, billed from today. Idempotent: starting a user who already holds a seat on this plan succeeds without opening a second one. plan annual on a monthly seat switches the plan the same day; plan annual for a user inside a paid annual term resumes it at no charge.

    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.

    Example request

    bash
    curl -X POST https://partner-api.trytwofold.com/v2/partner/users/provider-1042/seat/start \
      -H "Authorization: Bearer twofold_key_prod_…" \
      -H "Twofold-Client-Id: prtn_ab12Cd34Ef56" \
      -H "Content-Type: application/json" \
      -d '{
      "plan": "monthly",
      "groupExternalId": "grp_8f31"
    }'
    bash
    curl -X POST https://partner-api.staging.trytwofold.com/v2/partner/users/provider-1042/seat/start \
      -H "Authorization: Bearer twofold_key_staging_…" \
      -H "Twofold-Client-Id: prtn_ab12Cd34Ef56" \
      -H "Content-Type: application/json" \
      -d '{
      "plan": "monthly",
      "groupExternalId": "grp_8f31"
    }'

    Example response

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

    Errors

    400

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

    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.

    End a user's seat

    post/v2/partner/users/{externalUserId}/seat/end

    Authenticate with your partner API key and the Twofold-Client-Id header.

    Usage billing only. On a seat subscription, access is set with access-level instead.

    Path parameters

    externalUserIdstringrequired

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

    Response200

    The seat is ended and the user is READ_ONLY; seat is null. Idempotent and forgiving: a user whose seat already ended, or who never had one, also succeeds.

    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.

    Example request

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

    Example response

    json
    {
      "externalUserId": "provider-1042",
      "twofoldUserId": "user_ab12Cd34Ef56",
      "linkStatus": "active",
      "accessLevel": "READ_ONLY",
      "linkedAt": "2026-08-15T14:02:11.000Z",
      "groupExternalId": "grp_8f31",
      "seat": null
    }
    json
    {
      "externalUserId": "provider-1042",
      "twofoldUserId": "user_ab12Cd34Ef56",
      "linkStatus": "active",
      "accessLevel": "READ_ONLY",
      "linkedAt": "2026-08-15T14:02:11.000Z",
      "groupExternalId": "grp_8f31",
      "seat": null
    }

    Errors

    400

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

    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.