Basis Theory Tokens API

Create, retrieve, search, update, and delete tokens.

Operations 6

GET /tokens/{id} Tokens get by id #
PATCH /tokens/{id} Tokens update #
DELETE /tokens/{id} Tokens delete #
POST /tokens Tokens create #
GET /v2/tokens Tokens get V2 #
POST /v2/tokens/search Tokens search V2 #

Documentation

Specifications

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/basis-theory:basis-theory-tokens-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

basis-theory-tokens-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Basis Theory Tokens API
  description: '## Getting Started

    * Sign-in to Basis Theory and go to Applications

    * Create a Basis Theory Private Application

    * All permissions should be selected

    * Paste the API Key into the `BT-API-KEY` variable'
  version: v1
servers:
- url: https://api.basistheory.com
  description: Default
  x-fern-server-name: default
- url: https://api.us.basistheory.com
  description: US
  x-fern-server-name: us
- url: https://api.eu.basistheory.com
  description: EU
  x-fern-server-name: eu
- url: https://api.test.basistheory.com
  description: Test
  x-fern-server-name: test
security:
- ApiKey: []
tags:
- name: Tokens
paths:
  /tokens/{id}:
    get:
      tags:
      - Tokens
      operationId: Tokens_GetById
      parameters:
      - name: id
        in: path
        required: true
        schema:
          maxLength: 250
          pattern: ^.+$
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Token'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      x-fern-sdk-group-name:
      - tokens
      x-fern-sdk-method-name: get
      summary: Tokens get by id
      x-summary-source: derived
    patch:
      tags:
      - Tokens
      operationId: Tokens_Update
      parameters:
      - name: id
        in: path
        required: true
        schema:
          maxLength: 200
          pattern: ^.+$
          type: string
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/UpdateTokenRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Token'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      x-fern-sdk-group-name:
      - tokens
      x-fern-sdk-method-name: update
      x-fern-idempotent: true
      summary: Tokens update
      x-summary-source: derived
    delete:
      tags:
      - Tokens
      operationId: Tokens_Delete
      parameters:
      - name: id
        in: path
        required: true
        schema:
          maxLength: 200
          pattern: ^.+$
          type: string
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      x-fern-sdk-group-name:
      - tokens
      x-fern-sdk-method-name: delete
      summary: Tokens delete
      x-summary-source: derived
  /tokens:
    post:
      tags:
      - Tokens
      operationId: Tokens_Create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTokenRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Token'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      x-fern-sdk-group-name:
      - tokens
      x-fern-sdk-method-name: create
      x-fern-idempotent: true
      summary: Tokens create
      x-summary-source: derived
  /v2/tokens:
    get:
      tags:
      - Tokens
      operationId: Tokens_Get_V2
      parameters:
      - name: type
        in: query
        schema:
          type:
          - string
          - 'null'
      - name: container
        in: query
        schema:
          maxLength: 400
          type:
          - string
          - 'null'
      - name: fingerprint
        in: query
        schema:
          maxLength: 100
          type:
          - string
          - 'null'
      - name: metadata
        in: query
        style: deepObject
        schema:
          maxLength: 1
          type:
          - object
          - 'null'
          additionalProperties:
            type: string
      - name: start
        in: query
        schema:
          maxLength: 5000
          type:
          - string
          - 'null'
      - name: size
        in: query
        schema:
          maximum: 100
          type:
          - integer
          - 'null'
          format: int32
          exclusiveMinimum: 0
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenCursorPaginatedList'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      x-fern-sdk-group-name:
      - tokens
      x-fern-sdk-method-name: listV2
      x-fern-pagination:
        cursor: $request.start
        next_cursor: $response.pagination.next
        results: $response.data
      summary: Tokens get V2
      x-summary-source: derived
  /v2/tokens/search:
    post:
      tags:
      - Tokens
      operationId: Tokens_Search_V2
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchTokensRequestV2'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenCursorPaginatedList'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      x-fern-sdk-group-name:
      - tokens
      x-fern-sdk-method-name: searchV2
      x-fern-idempotent: true
      x-fern-pagination:
        cursor: $request.start
        next_cursor: $response.pagination.next
        results: $response.data
      summary: Tokens search V2
      x-summary-source: derived
components:
  schemas:
    CardIssuer:
      type: object
      properties:
        country:
          type:
          - string
          - 'null'
        name:
          type:
          - string
          - 'null'
      additionalProperties: false
    TokenEnrichments:
      type: object
      properties:
        bin_details:
          $ref: '#/components/schemas/BinDetails'
        card_details:
          $ref: '#/components/schemas/TokenEnrichmentsCardDetails'
      additionalProperties: false
    Token:
      type: object
      properties:
        id:
          maxLength: 400
          pattern: ^.+$
          type: string
        type:
          maxLength: 50
          pattern: ^[A-z_]*$
          type: string
        tenant_id:
          maxLength: 36
          pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          type: string
          format: uuid
        data: {}
        metadata:
          type:
          - object
          - 'null'
          additionalProperties:
            type:
            - string
            - 'null'
        enrichments:
          $ref: '#/components/schemas/TokenEnrichments'
        created_by:
          maxLength: 36
          pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          type:
          - string
          - 'null'
          format: uuid
        created_at:
          maxLength: 40
          type:
          - string
          - 'null'
          format: date-time
        card:
          $ref: '#/components/schemas/CardDetails'
        bank:
          $ref: '#/components/schemas/BankDetails'
        network_token:
          $ref: '#/components/schemas/CardDetails'
        modified_by:
          maxLength: 36
          pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          type:
          - string
          - 'null'
          format: uuid
        modified_at:
          maxLength: 40
          type:
          - string
          - 'null'
          format: date-time
        fingerprint:
          maxLength: 100
          pattern: ^[A-z0-9]*$
          type:
          - string
          - 'null'
        fingerprint_expression:
          maxLength: 400
          pattern: ^.*$
          type:
          - string
          - 'null'
        mask: {}
        privacy:
          $ref: '#/components/schemas/Privacy'
        search_indexes:
          maxItems: 10
          type:
          - array
          - 'null'
          items:
            type: string
        expires_at:
          maxLength: 40
          type:
          - string
          - 'null'
          format: date-time
        containers:
          pattern: ^(?!.*\/\/)(?=.*\/$)\/[A-z0-9_\-\/]*$
          maxItems: 1
          type:
          - array
          - 'null'
          items:
            type: string
        aliases:
          maxItems: 1
          type:
          - array
          - 'null'
          items:
            type: string
        authentication: {}
        _extras:
          $ref: '#/components/schemas/TokenExtras'
      additionalProperties: false
    BankDetails:
      type: object
      properties:
        routing_number:
          type:
          - string
          - 'null'
        account_number_last4:
          type:
          - string
          - 'null'
      additionalProperties: false
    CursorPagination:
      type: object
      properties:
        page_size:
          type:
          - integer
          - 'null'
          format: int32
        next:
          type:
          - string
          - 'null'
      additionalProperties: false
    ProblemDetails:
      type: object
      properties:
        type:
          type:
          - string
          - 'null'
        title:
          type:
          - string
          - 'null'
        status:
          type:
          - integer
          - 'null'
          format: int32
        detail:
          type:
          - string
          - 'null'
        instance:
          type:
          - string
          - 'null'
      additionalProperties: {}
    CreateTokenRequest:
      type: object
      properties:
        id:
          type:
          - string
          - 'null'
        type:
          type:
          - string
          - 'null'
        data: {}
        encrypted:
          type:
          - string
          - 'null'
        privacy:
          $ref: '#/components/schemas/Privacy'
        metadata:
          type:
          - object
          - 'null'
          additionalProperties:
            type:
            - string
            - 'null'
        search_indexes:
          type:
          - array
          - 'null'
          items:
            type: string
        fingerprint_expression:
          type:
          - string
          - 'null'
        mask: {}
        deduplicate_token:
          type:
          - boolean
          - 'null'
        expires_at:
          type:
          - string
          - 'null'
        containers:
          maxItems: 1
          type:
          - array
          - 'null'
          items:
            type: string
        token_intent_id:
          type:
          - string
          - 'null'
        owner_merchant_id:
          maxLength: 36
          pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          type:
          - string
          - 'null'
          format: uuid
      additionalProperties: false
    TokenExtras:
      type: object
      properties:
        deduplicated:
          type:
          - boolean
          - 'null'
        tsp_details:
          $ref: '#/components/schemas/TokenServiceProviderDetails'
        deduplication_behavior:
          type:
          - string
          - 'null'
        network_token_ids:
          type:
          - array
          - 'null'
          items:
            type: string
        decrypted_payload:
          type:
          - boolean
          - 'null'
      additionalProperties: false
    TokenEnrichmentsCardDetails:
      type: object
      properties:
        bin:
          type:
          - string
          - 'null'
        last4:
          type:
          - string
          - 'null'
      additionalProperties: false
    CardDetails:
      type: object
      properties:
        bin:
          type:
          - string
          - 'null'
        last4:
          type:
          - string
          - 'null'
        expiration_month:
          type:
          - integer
          - 'null'
          format: int32
        expiration_year:
          type:
          - integer
          - 'null'
          format: int32
        brand:
          type:
          - string
          - 'null'
        funding:
          type:
          - string
          - 'null'
        authentication:
          type:
          - string
          - 'null'
        issuer:
          $ref: '#/components/schemas/CardIssuer'
        issuer_country:
          $ref: '#/components/schemas/CardIssuerCountry'
        segment:
          type:
          - string
          - 'null'
        product:
          $ref: '#/components/schemas/CardProduct'
        additional:
          type:
          - array
          - 'null'
          items:
            $ref: '#/components/schemas/AdditionalCardDetails'
      additionalProperties: false
    UpdateTokenRequest:
      type: object
      properties:
        data: {}
        privacy:
          $ref: '#/components/schemas/UpdatePrivacy'
        metadata:
          type:
          - object
          - 'null'
          additionalProperties:
            type:
            - string
            - 'null'
        search_indexes:
          maxItems: 5
          type:
          - array
          - 'null'
          items:
            type: string
        fingerprint_expression:
          maxLength: 400
          pattern: ^.*$
          type:
          - string
          - 'null'
        mask: {}
        expires_at:
          type:
          - string
          - 'null'
        deduplicate_token:
          type:
          - boolean
          - 'null'
        containers:
          maxItems: 1
          type:
          - array
          - 'null'
          items:
            type: string
      additionalProperties: false
    SearchTokensRequestV2:
      type: object
      properties:
        query:
          maxLength: 200
          pattern: ^.*$
          type:
          - string
          - 'null'
        start:
          maxLength: 5000
          pattern: ^.+$
          type:
          - string
          - 'null'
        size:
          maximum: 100
          type:
          - integer
          - 'null'
          format: int32
          exclusiveMinimum: 0
      additionalProperties: false
    AuthenticationResponse:
      type: object
      properties:
        merchant_identifier:
          type:
          - string
          - 'null'
        authentication_data:
          type:
          - string
          - 'null'
        transaction_amount:
          type:
          - string
          - 'null'
      additionalProperties: false
    BinDetailsCountry:
      type: object
      properties:
        alpha2:
          type:
          - string
          - 'null'
        name:
          type:
          - string
          - 'null'
        numeric:
          type:
          - string
          - 'null'
      additionalProperties: false
    AssuranceDetails:
      type: object
      properties:
        account_verified:
          type: boolean
        card_holder_authenticated:
          type: boolean
      additionalProperties: false
    CardIssuerCountry:
      type: object
      properties:
        alpha2:
          type:
          - string
          - 'null'
        name:
          type:
          - string
          - 'null'
        numeric:
          type:
          - string
          - 'null'
      additionalProperties: false
    ValidationProblemDetails:
      type: object
      properties:
        errors:
          type:
          - object
          - 'null'
          additionalProperties:
            type: array
            items:
              type: string
        type:
          type:
          - string
          - 'null'
        title:
          type:
          - string
          - 'null'
        status:
          type:
          - integer
          - 'null'
          format: int32
        detail:
          type:
          - string
          - 'null'
        instance:
          type:
          - string
          - 'null'
      additionalProperties: {}
    BinDetailsProduct:
      type: object
      properties:
        code:
          type:
          - string
          - 'null'
        name:
          type:
          - string
          - 'null'
      additionalProperties: false
    BinDetails:
      type: object
      properties:
        card_brand:
          type:
          - string
          - 'null'
        type:
          type:
          - string
          - 'null'
        prepaid:
          type:
          - boolean
          - 'null'
        card_segment_type:
          type:
          - string
          - 'null'
        bank:
          $ref: '#/components/schemas/BinDetailsBank'
        product:
          $ref: '#/components/schemas/BinDetailsProduct'
        country:
          $ref: '#/components/schemas/BinDetailsCountry'
        reloadable:
          type:
          - boolean
          - 'null'
        pan_or_token:
          type:
          - string
          - 'null'
        account_updater:
          type:
          - boolean
          - 'null'
        alm:
          type:
          - boolean
          - 'null'
        domestic_only:
          type:
          - boolean
          - 'null'
        gambling_blocked:
          type:
          - boolean
          - 'null'
        level2:
          type:
          - boolean
          - 'null'
        level3:
          type:
          - boolean
          - 'null'
        issuer_currency:
          type:
          - string
          - 'null'
        combo_card:
          type:
          - string
          - 'null'
        bin_length:
          type:
          - integer
          - 'null'
          format: int32
        authentication: {}
        cost: {}
      additionalProperties: false
    AdditionalCardDetails:
      type: object
      properties:
        brand:
          type:
          - string
          - 'null'
        funding:
          type:
          - string
          - 'null'
        authentication:
          type:
          - string
          - 'null'
        issuer:
          $ref: '#/components/schemas/CardIssuer'
      additionalProperties: false
    TokenServiceProviderDetails:
      type: object
      properties:
        tsp:
          type:
          - string
          - 'null'
        auth_method:
          type:
          - string
          - 'null'
        message_id:
          type:
          - string
          - 'null'
        eci_indicator:
          type:
          - string
          - 'null'
        assurance_details:
          $ref: '#/components/schemas/AssuranceDetails'
        transaction_id:
          type:
          - string
          - 'null'
        currency_code:
          type:
          - string
          - 'null'
        transaction_amount:
          type:
          - integer
          - 'null'
          format: int64
        cardholder_name:
          type:
          - string
          - 'null'
        device_manufacturer_identifier:
          type:
          - string
          - 'null'
        payment_data_type:
          type:
          - string
          - 'null'
        merchant_token_identifier:
          type:
          - string
          - 'null'
        authentication_responses:
          type:
          - array
          - 'null'
          items:
            $ref: '#/components/schemas/AuthenticationResponse'
        status:
          type:
          - string
          - 'null'
      additionalProperties: false
    UpdatePrivacy:
      type: object
      properties:
        impact_level:
          type:
          - string
          - 'null'
        restriction_policy:
          type:
          - string
          - 'null'
      additionalProperties: false
    CardProduct:
      type: object
      properties:
        code:
          type:
          - string
          - 'null'
      additionalProperties: false
    TokenCursorPaginatedList:
      type: object
      properties:
        pagination:
          $ref: '#/components/schemas/CursorPagination'
        data:
          type:
          - array
          - 'null'
          items:
            $ref: '#/components/schemas/Token'
      additionalProperties: false
    BinDetailsBank:
      type: object
      properties:
        name:
          type:
          - string
          - 'null'
        phone:
          type:
          - string
          - 'null'
        url:
          type:
          - string
          - 'null'
        clean_name:
          type:
          - string
          - 'null'
      additionalProperties: false
    Privacy:
      type: object
      properties:
        classification:
          maxLength: 25
          pattern: ^[A-z]*$
          type:
          - string
          - 'null'
        impact_level:
          maxLength: 10
          pattern: ^(?:low|moderate|high)$
          type:
          - string
          - 'null'
        restriction_policy:
          maxLength: 10
          pattern: ^(?:mask|redact)$
          type:
          - string
          - 'null'
      additionalProperties: false
  securitySchemes:
    ApiKey:
      type: apiKey
      description: Authorization by API Key inside request's BT-API-KEY header
      name: BT-API-KEY
      in: header
x-provenance:
  method: harvested
  publisher: Basis Theory
  source: https://api.basistheory.com/swagger/v1/swagger.json
  note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
    stamped by stamp-openapi-provenance.py (roadmap#793)