SignalWire PubSub Tokens API

Endpoints related to creating & managing PubSub Tokens

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/signalwire-pubsub-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

signalwire-pubsub-tokens-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: SignalWire REST PubSub Tokens API
  version: 1.0.0
  contact:
    name: SignalWire
    url: https://support.signalwire.com/portal/en/newticket?departmentId=1029313000000006907&layoutId=1029313000000074011
    email: support@signalwire.com
  license:
    name: MIT
    url: https://github.com/signalwire/docs/blob/main/LICENSE
  termsOfService: https://signalwire.com/legal/signalwire-cloud-agreement
  description: Endpoints related to creating & managing PubSub Tokens
servers:
- url: https://{space_name}.signalwire.com
  description: SignalWire API
  variables:
    space_name:
      default: '{Your_Space_Name}'
      description: Your SignalWire Space name
security:
- SignalWireBasicAuth: []
tags:
- name: PubSub Tokens
  description: Endpoints related to creating & managing PubSub Tokens
  externalDocs:
    url: https://signalwire.com/docs/apis
    description: Developer documentation on PubSub API endpoints
paths:
  /api/pubsub/tokens:
    post:
      operationId: create_token
      summary: Create PubSub token
      description: 'Generate a PubSub Token to be used to authenticate clients to the PubSub Service.


        #### Permissions


        The API token used to authenticate must have the following scope(s) enabled to make a successful request: _PubSub_.


        [Learn more about API scopes](/docs/platform/your-signalwire-api-space).'
      parameters: []
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubSub.PubSubToken'
        '400':
          description: The request is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode400'
        '401':
          description: Access is unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode401'
        '422':
          description: The request contains invalid parameters. See errors for details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubSub.PubSubToken422Error'
        '500':
          description: An internal server error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode500'
      tags:
      - PubSub Tokens
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PubSub.NewPubSubToken'
components:
  schemas:
    Types.StatusCodes.StatusCode401:
      type: object
      required:
      - error
      properties:
        error:
          type: string
          enum:
          - Unauthorized
      unevaluatedProperties:
        not: {}
      description: Access is unauthorized.
    Types.StatusCodes.RestApiErrorItem:
      type: object
      required:
      - type
      - code
      - message
      - url
      properties:
        type:
          type: string
          description: The category of error.
          examples:
          - validation_error
        code:
          type: string
          description: A specific error code.
          examples:
          - invalid_parameter
        message:
          type: string
          description: A description of what caused the error.
          examples:
          - Name must be present
        attribute:
          anyOf:
          - type: string
          - type: 'null'
          description: The request parameter that caused the error, if applicable.
          examples:
          - name
        url:
          type: string
          description: A link to documentation about this error.
          examples:
          - https://signalwire.com/docs/apis/error-codes
      unevaluatedProperties:
        not: {}
      description: Details about a specific error.
    PubSub.PubSubToken422Error:
      type: object
      required:
      - errors
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Types.StatusCodes.RestApiErrorItem'
          description: List of validation errors.
      unevaluatedProperties:
        not: {}
      description: The request contains invalid parameters. See errors for details.
      examples:
      - statusCode: 422
        errors:
        - type: validation_error
          code: not_a_valid_json
          message: Permissions must be valid JSON
          attribute: permissions
          url: https://signalwire.com/docs/apis/error-codes
    PubSub.PubSubToken:
      type: object
      required:
      - token
      properties:
        token:
          type: string
          description: A PubSub Token to be used to authenticate clients to the PubSub Service.
          examples:
          - eyJ0eXAiOiJWUlQiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2MjIxMjAxMjMsI...wMCwicnNlIjo5MDB9-BqG-DqC5LhpsdMWEFjhVkTBpQ
      unevaluatedProperties:
        not: {}
    PubSub.PubSubPermissionWithWrite:
      type: object
      required:
      - write
      properties:
        read:
          type: boolean
          description: Gives the token read access to the channel.
          examples:
          - true
        write:
          type: boolean
          description: Gives the token write access to the channel.
          examples:
          - false
      unevaluatedProperties:
        not: {}
      title: Write Permission
    PubSub.PubSubPermissionWithRead:
      type: object
      required:
      - read
      properties:
        read:
          type: boolean
          description: Gives the token read access to the channel.
          examples:
          - true
        write:
          type: boolean
          description: Gives the token write access to the channel.
          examples:
          - false
      unevaluatedProperties:
        not: {}
      title: Read Permission
    PubSub.NewPubSubToken:
      type: object
      required:
      - ttl
      - channels
      properties:
        ttl:
          type: integer
          minimum: 1
          maximum: 43200
          description: The maximum time, in minutes, for which the access token will be valid. Between 1 and 43,200 (30 days).
          examples:
          - 15
        channels:
          allOf:
          - $ref: '#/components/schemas/PubSub.PubSubChannels'
          minProperties: 1
          maxProperties: 500
          description: 'Each channel with `write` and `read` objects with boolean as values. Max of 500 channels inside main `channels`.

            Either `read`, `write`, or both are required inside each channel and default to false.

            Each channel name can be up to 250 characters. Must be valid JSON.'
          examples:
          - channela:
              read: true
              write: false
            channelb:
              read: true
        member_id:
          type: string
          maxLength: 250
          description: The unique identifier of the member. Up to 250 characters. If not specified, a random UUID will be generated.
          examples:
          - John Doe
        state:
          allOf:
          - $ref: '#/components/schemas/PubSub.PubSubState'
          description: An arbitrary JSON object available to store stateful application information in. Must be valid JSON and have a maximum size of 2,000 characters.
          examples:
          - display_name: Joe
            an_array:
            - foo
            - bar
            - baz
          default: {}
      unevaluatedProperties:
        not: {}
    Types.StatusCodes.StatusCode500:
      type: object
      required:
      - error
      properties:
        error:
          type: string
          enum:
          - Internal Server Error
      unevaluatedProperties:
        not: {}
      description: An internal server error occurred.
    PubSub.PubSubChannels:
      type: object
      unevaluatedProperties:
        anyOf:
        - $ref: '#/components/schemas/PubSub.PubSubPermissionWithRead'
        - $ref: '#/components/schemas/PubSub.PubSubPermissionWithWrite'
      description: 'User-defined channel names. Each channel is an object with `read` and/or `write` properties.

        Max of 500 channels. Either `read`, `write`, or both are required inside each channel and default to `false`.

        Each channel name can be up to 250 characters. Must be valid JSON.'
      examples:
      - channela:
          read: true
          write: false
        channelb:
          read: true
    Types.StatusCodes.StatusCode400:
      type: object
      required:
      - error
      properties:
        error:
          type: string
          enum:
          - Bad Request
      unevaluatedProperties:
        not: {}
      description: The request is invalid.
    PubSub.PubSubState:
      type: object
      unevaluatedProperties: {}
      description: An arbitrary JSON object available to store stateful application information in. Must be valid JSON and have a maximum size of 2,000 characters.
      examples:
      - display_name: Joe
        an_array:
        - foo
        - bar
        - baz
  securitySchemes:
    SignalWireBasicAuth:
      type: http
      scheme: Basic
      description: 'SignalWire Basic Authentication using Project ID and API Token.


        The client sends HTTP requests with the Authorization header containing

        the word Basic followed by a space and a base64-encoded string of project_id:token.

        The project ID will be used as the username and the API token as the password.


        Example:

        ```

        Authorization: Basic base64(project_id:token)

        ```'
      x-fern-basic:
        username:
          name: project_id
          env: SIGNALWIRE_PROJECT_ID
        password:
          name: api_token
          env: SIGNALWIRE_API_TOKEN
    SignalWireBearerAuth:
      type: http
      scheme: Bearer
      description: 'SignalWire Bearer Token Authentication for subscriber endpoints.

        The client sends HTTP requests with the Authorization header containing

        the word Bearer followed by a space and the subscriber token.


        Example:

        ```

        Authorization: Bearer <subscriber_token>

        ```'