Basis Theory Tokens API

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

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-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 email required.

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.0.1
info:
  title: Basis Theory 3D Secure Tokens API
  description: The Basis Theory API is a PCI Level 1 compliant tokenization and data vault platform. It lets developers tokenize, store, and use sensitive data - cardholder data, PII, PHI, and bank account numbers - without that data touching their own systems. The API exposes Tokens, batch Tokenize / Detokenize, Applications, the detokenizing Proxy (pre-configured and ephemeral), serverless Reactors, 3D Secure, Tenants, Logs, and Webhooks. All requests are authenticated with a `BT-API-KEY` request header.
  termsOfService: https://basistheory.com/terms
  contact:
    name: Basis Theory Support
    email: support@basistheory.com
    url: https://developers.basistheory.com
  version: '1.0'
servers:
- url: https://api.basistheory.com
  description: Production environment (PRODUCTION tenants)
- url: https://api.test.basistheory.com
  description: Test environment (TEST tenants)
security:
- ApiKey: []
tags:
- name: Tokens
  description: Create, retrieve, search, update, and delete tokens.
paths:
  /tokens:
    post:
      operationId: createToken
      tags:
      - Tokens
      summary: Create a token
      description: Tokenizes a single piece of sensitive data and stores it in the vault.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTokenRequest'
      responses:
        '201':
          description: The created token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Token'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/ValidationProblem'
  /v2/tokens:
    get:
      operationId: listTokens
      tags:
      - Tokens
      summary: List tokens
      description: Returns a cursor-paginated list of tokens for the tenant.
      parameters:
      - name: id
        in: query
        description: Filter by one or more token ids.
        schema:
          type: array
          items:
            type: string
      - name: type
        in: query
        description: Filter by one or more token types.
        schema:
          type: array
          items:
            type: string
      - name: start
        in: query
        description: Cursor for the next page of results.
        schema:
          type: string
      - name: size
        in: query
        description: Number of results to return per page.
        schema:
          type: integer
          default: 20
      responses:
        '200':
          description: A paginated list of tokens.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenCursorPaginatedList'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
  /tokens/{id}:
    get:
      operationId: getToken
      tags:
      - Tokens
      summary: Get a token
      parameters:
      - $ref: '#/components/parameters/TokenId'
      responses:
        '200':
          description: The requested token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Token'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
    patch:
      operationId: updateToken
      tags:
      - Tokens
      summary: Update a token
      description: Partially updates a token using JSON merge patch semantics.
      parameters:
      - $ref: '#/components/parameters/TokenId'
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/UpdateTokenRequest'
      responses:
        '200':
          description: The updated token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Token'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationProblem'
    delete:
      operationId: deleteToken
      tags:
      - Tokens
      summary: Delete a token
      parameters:
      - $ref: '#/components/parameters/TokenId'
      responses:
        '204':
          description: The token was deleted.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  responses:
    Forbidden:
      description: The application lacks the required permission.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
    ValidationProblem:
      description: The request failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationProblemDetails'
    Unauthorized:
      description: The BT-API-KEY header is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
  schemas:
    Token:
      type: object
      properties:
        id:
          type: string
        tenant_id:
          type: string
          format: uuid
        type:
          type: string
          description: The token type, e.g. token, card, bank, social_security_number.
        data:
          description: The token data (masked unless detokenized).
        mask:
          description: The masking expression applied to the data.
        fingerprint:
          type: string
        fingerprint_expression:
          type: string
        containers:
          type: array
          items:
            type: string
        metadata:
          type: object
          additionalProperties:
            type: string
        search_indexes:
          type: array
          items:
            type: string
        expires_at:
          type: string
          format: date-time
        created_by:
          type: string
          format: uuid
        created_at:
          type: string
          format: date-time
        modified_at:
          type: string
          format: date-time
    CreateTokenRequest:
      type: object
      required:
      - type
      - data
      properties:
        id:
          type: string
        type:
          type: string
        data:
          description: The sensitive value to tokenize. May be a primitive or an object.
        mask:
          description: A masking expression used to reveal a non-sensitive portion of the data.
        containers:
          type: array
          items:
            type: string
        metadata:
          type: object
          additionalProperties:
            type: string
        search_indexes:
          type: array
          items:
            type: string
        fingerprint_expression:
          type: string
        deduplicate_token:
          type: boolean
        expires_at:
          type: string
          format: date-time
    ValidationProblemDetails:
      type: object
      properties:
        title:
          type: string
        status:
          type: integer
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
    UpdateTokenRequest:
      type: object
      properties:
        data: {}
        mask: {}
        metadata:
          type: object
          additionalProperties:
            type: string
        search_indexes:
          type: array
          items:
            type: string
        fingerprint_expression:
          type: string
    CursorPagination:
      type: object
      properties:
        next:
          type: string
        previous:
          type: string
    ProblemDetails:
      type: object
      properties:
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
    TokenCursorPaginatedList:
      type: object
      properties:
        pagination:
          $ref: '#/components/schemas/CursorPagination'
        data:
          type: array
          items:
            $ref: '#/components/schemas/Token'
  parameters:
    TokenId:
      name: id
      in: path
      required: true
      description: The unique identifier of the token.
      schema:
        type: string
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: BT-API-KEY
      description: Authenticate every request with a Basis Theory Application key supplied in the BT-API-KEY request header.