SendSeven GmbH Contact Tokens API

The Contact Tokens API from SendSeven GmbH — 3 operation(s) for contact tokens.

GitHub OpenAPI

Operations 3

POST /api/v1/contact-tokens Create Contact Token #
DELETE /api/v1/contact-tokens/{token_id} Revoke Contact Token #
POST /api/v1/contacts/{contact_id}/contact-tokens/revoke Revoke Contact Tokens For Contact #

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/sendseven-com:sendseven-com-contact-tokens-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

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

OpenAPI Specification

sendseven-com-contact-tokens-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: SendSeven Contact Tokens API
  description: Unified messaging API for WhatsApp, Telegram, SMS, and more
  version: '20261124.1227'
servers:
- url: https://api.sendseven.com
  description: Production
tags:
- name: Contact Tokens
paths:
  /api/v1/contact-tokens:
    post:
      tags:
      - Contact Tokens
      summary: Create Contact Token
      description: 'Create a contact token for the live chat widget


        Mints a short-lived, opaque token (`s7ct_…`) for ONE contact that is

        redeemable only on `widget_id`. Pass it to the widget as

        `SendSevenConfig.contactToken`; the chat then starts bound to that contact

        and AI agents receive the exposed fields and `context` as verified data.


        Contact resolution (first hit wins): `contact.external_id` mapping →

        `contact_id` → a contact holding one of the `methods` you mark

        `verified: true` (claims never match) → created when `create_if_missing`

        is true (requires `contacts:create`).


        Methods (`email`, `phone`, `whatsapp`) are attached to the contact;

        `verified: true` stores them as verified, `false` as an unverified claim

        (an already-verified method is never downgraded). A method held by a

        different contact is a conflict: `on_conflict: "error"` (default) returns

        409 `identifier_conflict` and changes nothing; `on_conflict: "merge"`

        merges those contacts into this one (only when your method is

        `verified: true` AND the other contact''s copy is verified too; any other

        conflict is not attached and is listed in `skipped`). Merge requires

        `contacts:update`.


        `save` / `save_if_empty` write standard fields (`name`, `first_name`,

        `last_name`, `language`) or active custom fields to the contact now

        (`save_if_empty` only fills empty fields). `context` is shared with the

        chat only and never stored on the contact. Everything is one

        transaction.


        Legacy shape: scalar `contact.email` / `contact.phone` and `expose` keep

        working (`expose` is deprecated).


        The token is returned **only in this response**.


        Errors: 403 `insufficient_scope`; 404 `widget_not_found` /

        `contact_not_found`; 409 `identifier_conflict` / `merge_failed`; 422

        `invalid_method_type`, `invalid_method_value`, `invalid_on_conflict`,

        `unknown_field`, `invalid_field_value`, `invalid_save`,

        `unknown_custom_field`, `unknown_standard_field`, `context_too_large`,

        `invalid_ttl`, `invalid_max_redemptions`, `invalid_contact`; 429

        `rate_limited` (120 per minute per credential and per workspace).


        High-privilege scope: not grantable to OAuth apps.


        **Required Scopes:** `contact_tokens:create`, `contacts:read` (+ `contacts:create` for `create_if_missing`, + `contacts:update` to change an existing contact: attach methods, link `external_id`, `save`, or `on_conflict: "merge"`)'
      operationId: create_contact_token_api_v1_contact_tokens_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactTokenCreate'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactTokenResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /api/v1/contact-tokens/{token_id}:
    delete:
      tags:
      - Contact Tokens
      summary: Revoke Contact Token
      description: 'Revoke a contact token


        The token can no longer be redeemed and every chat session context created

        from it stops being used immediately. Idempotent: revoking an already

        revoked token succeeds.


        **Required Scopes:** `contact_tokens:create`'
      operationId: revoke_contact_token_api_v1_contact_tokens__token_id__delete
      security:
      - HTTPBearer: []
      parameters:
      - name: token_id
        in: path
        required: true
        schema:
          type: string
          title: Token Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/contacts/{contact_id}/contact-tokens/revoke:
    post:
      tags:
      - Contact Tokens
      summary: Revoke Contact Tokens For Contact
      description: 'Revoke all contact tokens of a contact


        Use it on logout or when a user''s access changes. Every unrevoked token of

        the contact is revoked and their chat session context stops being used.


        **Required Scopes:** `contact_tokens:create`'
      operationId: revoke_contact_tokens_for_contact_api_v1_contacts__contact_id__contact_tokens_revoke_post
      security:
      - HTTPBearer: []
      parameters:
      - name: contact_id
        in: path
        required: true
        schema:
          type: string
          title: Contact Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactTokenRevokeResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    ContactTokenContact:
      properties:
        contact_id:
          anyOf:
          - type: string
            maxLength: 36
          - type: 'null'
          title: Contact Id
          description: Existing contact id
        external_id:
          anyOf:
          - type: string
            maxLength: 255
          - type: 'null'
          title: External Id
          description: Your user id. Mapped to the contact once and reused (same mapping as signed widget identity).
        methods:
          anyOf:
          - items:
              $ref: '#/components/schemas/ContactTokenMethod'
            type: array
            maxItems: 10
          - type: 'null'
          title: Methods
          description: Contact methods (email / phone / whatsapp), each verified or a claim. Max 10.
        on_conflict:
          anyOf:
          - type: string
            maxLength: 10
          - type: 'null'
          title: On Conflict
          description: '`error` (default): 409 `identifier_conflict` when a method belongs to another contact. `merge`: merge those contacts into this one (verified methods only; requires `contacts:update`).'
        email:
          anyOf:
          - type: string
            maxLength: 320
          - type: 'null'
          title: Email
          description: 'Legacy: email for this user (use `methods`)'
        phone:
          anyOf:
          - type: string
            maxLength: 64
          - type: 'null'
          title: Phone
          description: 'Legacy: phone number, E.164 preferred (use `methods`)'
        name:
          anyOf:
          - type: string
            maxLength: 255
          - type: 'null'
          title: Name
          description: Display name, used only when a contact is created
        create_if_missing:
          type: boolean
          title: Create If Missing
          description: Create the contact when nothing matches (requires `contacts:create`)
          default: false
      type: object
      title: ContactTokenContact
      description: 'Who the token is for: ``contact_id``, or identifiers to resolve / create.'
    ContactTokenMethod:
      properties:
        type:
          type: string
          maxLength: 20
          title: Type
          description: '`email`, `phone` or `whatsapp`'
        value:
          type: string
          maxLength: 320
          minLength: 1
          title: Value
          description: The address / number (WhatsApp with or without a leading +)
        verified:
          type: boolean
          title: Verified
          description: 'true: you have verified this method; it is used to find the contact and stored as verified. false (default): attached as an unverified claim and never used to find the contact.'
          default: false
      type: object
      required:
      - type
      - value
      title: ContactTokenMethod
      description: A contact method sent with the token (write-back model).
    DeleteResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Whether deletion succeeded
          default: true
        id:
          type: string
          title: Id
          description: ID of deleted resource
        message:
          anyOf:
          - type: string
          - type: 'null'
          title: Message
          default: Resource deleted successfully
      type: object
      required:
      - id
      title: DeleteResponse
      description: Response for resource deletion
    ContactTokenCreate:
      properties:
        widget_id:
          type: string
          maxLength: 36
          minLength: 1
          title: Widget Id
          description: Live chat widget the token is redeemable on
        contact:
          $ref: '#/components/schemas/ContactTokenContact'
        expose:
          $ref: '#/components/schemas/ContactTokenExpose'
        context:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Context
          description: Any JSON object (max 4 KB serialized, 30 keys) shared with the chat as verified context. Never stored on the contact.
        save:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Save
          description: 'Fields written to the contact when the token is created (replaces the value). Keys: name, first_name, last_name, language, or active custom field keys. Requires `contacts:update` (or `contacts:create` for a contact created by this call).'
        save_if_empty:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Save If Empty
          description: Like `save`, but written only where the field is empty.
        ttl_seconds:
          type: integer
          title: Ttl Seconds
          description: Redeem window in seconds (30-3600, default 600)
          default: 600
        grant_ttl_seconds:
          type: integer
          title: Grant Ttl Seconds
          description: How long the context stays valid in the chat session after redeem (60-604800, default 86400)
          default: 86400
        max_redemptions:
          type: integer
          title: Max Redemptions
          description: How often the token may be redeemed (page reloads, tabs), 1-50
          default: 10
      type: object
      required:
      - widget_id
      - contact
      title: ContactTokenCreate
      example:
        contact:
          create_if_missing: true
          external_id: crm-123
          methods:
          - type: email
            value: anna@example.com
            verified: true
          - type: whatsapp
            value: '+4917012345678'
            verified: false
          name: Anna Weber
          on_conflict: error
        context:
          open_orders: 2
        save:
          plan: Scale
        save_if_empty:
          company: Acme GmbH
        ttl_seconds: 600
        widget_id: 3f6c1d2e-8a1b-4c5d-9e0f-123456789abc
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ContactTokenExpose:
      properties:
        standard_fields:
          items:
            type: string
          type: array
          maxItems: 20
          title: Standard Fields
          description: 'Standard fields shared with the chat: name, first_name, last_name, email, phone, language, country, timezone, company, created_at, channel'
        custom_fields:
          items:
            type: string
          type: array
          maxItems: 50
          title: Custom Fields
          description: Custom field keys shared with the chat (values are read when the token is redeemed)
      type: object
      title: ContactTokenExpose
    ContactTokenResponse:
      properties:
        id:
          type: string
          title: Id
          description: Token id (use it to revoke)
        token:
          type: string
          title: Token
          description: The token. Returned ONLY in this response; pass it to the widget as `contactToken`.
        token_prefix:
          type: string
          title: Token Prefix
          description: First characters of the token, for display/debugging
        widget_id:
          type: string
          title: Widget Id
        contact_id:
          type: string
          title: Contact Id
        expires_at:
          type: string
          format: date-time
          title: Expires At
          description: Redeem deadline
        grant_expires_in:
          type: integer
          title: Grant Expires In
          description: Seconds the context stays valid in a chat session after redeem
        max_redemptions:
          type: integer
          title: Max Redemptions
        created:
          type: boolean
          title: Created
          description: True when this call created the contact
          default: false
        merged_contact_ids:
          items:
            type: string
          type: array
          title: Merged Contact Ids
          description: 'Contacts merged into this one (`on_conflict: merge`)'
        skipped:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Skipped
          description: 'Methods not attached, e.g. `{type, value, reason: "unverified_conflict"}`'
      type: object
      required:
      - id
      - token
      - token_prefix
      - widget_id
      - contact_id
      - expires_at
      - grant_expires_in
      - max_redemptions
      title: ContactTokenResponse
    ContactTokenRevokeResponse:
      properties:
        success:
          type: boolean
          title: Success
          default: true
        id:
          type: string
          title: Id
          description: Contact id
        revoked:
          type: integer
          title: Revoked
          description: Number of tokens revoked
      type: object
      required:
      - id
      - revoked
      title: ContactTokenRevokeResponse
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer