Tesser API Keys API

The API Keys API from Tesser — 3 operation(s) for api keys.

OpenAPI Specification

tesser-api-keys-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Tesser Accounts API Keys API
  description: The Tesser Payments Platform API documentation.
  version: v1
  contact: {}
servers: []
security:
- bearer: []
tags:
- name: API Keys
paths:
  /v1/keys:
    post:
      description: Creates an Auth0 M2M application and returns client credentials. Use these credentials to fetch access tokens from Auth0.
      operationId: keys_createApiKey
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateApiKeyRequestDto'
      responses:
        '201':
          description: The API key has been successfully created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateApiKeyResponseDto'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '404':
          description: Workspace not found
      security:
      - bearer: []
      summary: Create a new API key
      tags:
      - API Keys
      x-internal: true
      x-zuplo-route:
        corsPolicy: anything-goes
        handler:
          export: forwardToBackend
          module: $import(./modules/forward-to-backend)
        policies:
          inbound:
          - set-backend-secret-inbound
          - auth0-jwt-auth-inbound
          - forward-user-info-inbound
    get:
      operationId: keys_listApiKeys
      parameters: []
      responses:
        '200':
          description: List of API keys
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListApiKeysResponseDto'
        '401':
          description: Unauthorized
      security:
      - bearer: []
      summary: List all API keys for the workspace
      tags:
      - API Keys
      x-internal: true
      x-zuplo-route:
        corsPolicy: anything-goes
        handler:
          export: forwardToBackend
          module: $import(./modules/forward-to-backend)
        policies:
          inbound:
          - set-backend-secret-inbound
          - auth0-jwt-auth-inbound
          - forward-user-info-inbound
  /v1/keys/{id}:
    get:
      operationId: keys_getApiKey
      parameters:
      - name: id
        required: true
        in: path
        description: API key ID
        schema:
          type: string
      responses:
        '200':
          description: API key details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyDto'
        '401':
          description: Unauthorized
        '404':
          description: API key not found
      security:
      - bearer: []
      summary: Get a specific API key
      tags:
      - API Keys
      x-internal: true
      x-zuplo-route:
        corsPolicy: anything-goes
        handler:
          export: forwardToBackend
          module: $import(./modules/forward-to-backend)
        policies:
          inbound:
          - set-backend-secret-inbound
          - auth0-jwt-auth-inbound
          - forward-user-info-inbound
    delete:
      operationId: keys_deleteApiKey
      parameters:
      - name: id
        required: true
        in: path
        description: API key ID
        schema:
          type: string
      responses:
        '200':
          description: API key has been deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteApiKeyResponseDto'
        '401':
          description: Unauthorized
        '404':
          description: API key not found
      security:
      - bearer: []
      summary: Delete an API key
      tags:
      - API Keys
      x-internal: true
      x-zuplo-route:
        corsPolicy: anything-goes
        handler:
          export: forwardToBackend
          module: $import(./modules/forward-to-backend)
        policies:
          inbound:
          - set-backend-secret-inbound
          - auth0-jwt-auth-inbound
          - forward-user-info-inbound
  /v1/keys/{id}/revoke:
    put:
      description: Deletes the Auth0 M2M application, instantly invalidating all tokens.
      operationId: keys_revokeApiKey
      parameters:
      - name: id
        required: true
        in: path
        description: API key ID
        schema:
          type: string
      responses:
        '200':
          description: API key has been revoked
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RevokeApiKeyResponseDto'
        '400':
          description: API key is already revoked
        '401':
          description: Unauthorized
        '404':
          description: API key not found
      security:
      - bearer: []
      summary: Revoke an API key
      tags:
      - API Keys
      x-internal: true
      x-zuplo-route:
        corsPolicy: anything-goes
        handler:
          export: forwardToBackend
          module: $import(./modules/forward-to-backend)
        policies:
          inbound:
          - set-backend-secret-inbound
          - auth0-jwt-auth-inbound
          - forward-user-info-inbound
components:
  schemas:
    ListApiKeysResponseDto:
      type: object
      properties:
        message:
          type: string
        data:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
                pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
              name:
                type: string
              description:
                type: string
                nullable: true
              maskedClientId:
                type: string
              status:
                type: string
                enum:
                - active
                - revoked
              lastUsedAt:
                type: string
                format: date-time
                pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                nullable: true
              createdAt:
                type: string
                format: date-time
                pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
              updatedAt:
                type: string
                format: date-time
                pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            required:
            - id
            - name
            - description
            - maskedClientId
            - status
            - lastUsedAt
            - createdAt
            - updatedAt
      required:
      - message
      - data
    CreateApiKeyResponseDto:
      type: object
      properties:
        message:
          type: string
        data:
          type: object
          properties:
            apiKey:
              type: object
              properties:
                id:
                  type: string
                  format: uuid
                  pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                name:
                  type: string
                description:
                  type: string
                  nullable: true
                maskedClientId:
                  type: string
                status:
                  type: string
                  enum:
                  - active
                  - revoked
                lastUsedAt:
                  type: string
                  format: date-time
                  pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                  nullable: true
                createdAt:
                  type: string
                  format: date-time
                  pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                updatedAt:
                  type: string
                  format: date-time
                  pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
              required:
              - id
              - name
              - description
              - maskedClientId
              - status
              - lastUsedAt
              - createdAt
              - updatedAt
            clientId:
              type: string
            clientSecret:
              type: string
            tokenEndpoint:
              type: string
              format: uri
            audience:
              type: string
          required:
          - apiKey
          - clientId
          - clientSecret
          - tokenEndpoint
          - audience
      required:
      - message
      - data
    ApiKeyDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        name:
          type: string
        description:
          type: string
          nullable: true
        maskedClientId:
          type: string
        status:
          type: string
          enum:
          - active
          - revoked
        lastUsedAt:
          type: string
          format: date-time
          pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          nullable: true
        createdAt:
          type: string
          format: date-time
          pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        updatedAt:
          type: string
          format: date-time
          pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
      required:
      - id
      - name
      - description
      - maskedClientId
      - status
      - lastUsedAt
      - createdAt
      - updatedAt
    DeleteApiKeyResponseDto:
      type: object
      properties:
        message:
          type: string
      required:
      - message
    RevokeApiKeyResponseDto:
      type: object
      properties:
        message:
          type: string
        data:
          type: object
          properties:
            apiKey:
              type: object
              properties:
                id:
                  type: string
                  format: uuid
                  pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                name:
                  type: string
                description:
                  type: string
                  nullable: true
                maskedClientId:
                  type: string
                status:
                  type: string
                  enum:
                  - active
                  - revoked
                lastUsedAt:
                  type: string
                  format: date-time
                  pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                  nullable: true
                createdAt:
                  type: string
                  format: date-time
                  pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                updatedAt:
                  type: string
                  format: date-time
                  pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
              required:
              - id
              - name
              - description
              - maskedClientId
              - status
              - lastUsedAt
              - createdAt
              - updatedAt
          required:
          - apiKey
      required:
      - message
      - data
    CreateApiKeyRequestDto:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 100
        description:
          type: string
          maxLength: 500
      required:
      - name
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: "Enter your JWT token.\n\nTo obtain a token, make a request to Auth0:\n\n```bash\ncurl --request POST \\\n  --url https://dev-awqy75wdabpsnsvu.us.auth0.com/oauth/token \\\n  --header 'content-type: application/json' \\\n  --data '{\n    \"client_id\":\"YOUR_CLIENT_ID\",\n    \"client_secret\":\"YOUR_CLIENT_SECRET\",\n    \"audience\":\"https://sandbox.tesserx.co\",\n    \"grant_type\":\"client_credentials\"\n  }'\n```\n\nThe response will contain an `access_token` field which should be used as the Bearer token."