> ## Documentation Index
> Fetch the complete documentation index at: https://developer.hellgate.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create token

> Create a new token in the generic scope. This type of token can be used for various use cases that do not involve sensitive card payment credentials.




## OpenAPI

````yaml /products/guardian/openapi.yaml post /api/generic/tokens
openapi: 3.1.0
info:
  title: Guardian API
  version: '1.0'
  contact:
    name: Starfish GmbH & Co. KG
    email: support@hellgate.io
    url: https://hellgate.io/cpa/guardian
  license:
    name: Hellgate API Terms
    url: https://hellgate.io/terms-and-conditions
servers:
  - url: https://{instance}.{env}.on-hellgate.cloud
    description: Managed instance of Guardian
    variables:
      instance:
        default: my-instance
        description: Your unique instance slug, provided during onboarding.
      env:
        default: eu1
        description: Deployment environment (currently eu1).
security: []
tags:
  - name: pci
    description: Management of card payment credentials under the ruling of PCI DSS.
  - name: network
    description: Management of network tokens and cryptograms for secure transactions.
  - name: generic
    description: Management of generic tokens and their schemas for various use cases.
  - name: metadata
    description: Inquiries for card metadata based on PAN, PCI tokens, or network tokens.
  - name: wallet
    description: >-
      Management of wallet tokens ingested from device wallets such as Google
      Pay.
  - name: apikey
    description: Management of API keys for service access.
  - name: webhook
    description: Management of webhooks for event notifications.
  - name: types
    description: Management of types for generic token schemas.
paths:
  /api/generic/tokens:
    post:
      tags:
        - generic
      summary: Create token
      description: >
        Create a new token in the generic scope. This type of token can be used
        for various use cases that do not involve sensitive card payment
        credentials.
      operationId: generic_token_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/generic_token_create_request'
            examples:
              sepa_credentials:
                summary: Example Payload for SEPA Credentials
                value:
                  payload:
                    iban: DE89370400440532013000
                    bic: COBADEFFXXX
                    account_holder_name: John Doe
              api_credentials:
                summary: Example Payload for API Credentials
                value:
                  payload:
                    api_key: abcd1234efgh5678
                    api_secret: s3cr3tK3y!
                  expiration_time: 2592000
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/generic_token'
              examples:
                sepa_credentials:
                  summary: Example Response for SEPA Credentials
                  value:
                    id: 8744c9ea-a02b-4ae6-875c-b64fc333e3ef
                    created_at: '2023-10-01T12:34:56Z'
                api_credentials:
                  summary: Example Response for API Credentials
                  value:
                    id: 8744c9ea-a02b-4ae6-875c-b64fc333e3ef
                    created_at: '2023-10-01T12:34:56Z'
                    expires_at: '2023-10-31T12:34:56Z'
        '401':
          $ref: '#/components/responses/401_UnauthorizedError'
        '403':
          $ref: '#/components/responses/403_ForbiddenError'
        '409':
          $ref: '#/components/responses/409_ConflictError'
        '422':
          $ref: '#/components/responses/422_ValidationError'
      security:
        - bearerAuth: []
        - APIKey: []
components:
  schemas:
    generic_token_create_request:
      type: object
      properties:
        expiration_time:
          example: 3600
          type: integer
          minimum: 1
          maximum: 2592000
          description: |
            The expiry time is used to specify after how many seconds 
            a token should be automatically deleted after creation.
        payload:
          type: object
          description: >-
            The payload is a key-value map, that can contain any information the
            user wants to store in the token.


            * Maximum 20 key-value pairs. * Maximum 20 characters per key. *
            Maximum 80 characters per value.
        metadata:
          $ref: '#/components/schemas/Metadata'
        type_id:
          example: 9e5b3f7d-2c8a-4b6e-a1d9-6f4c8b2e5a7d
          type: string
          format: uuid
          description: >-
            The ID of a type to apply for this payload.

            If provided the payload will be validated against the schema of the
            type and the tokens can be filtered by the type ID as well.
      required:
        - payload
    generic_token:
      type: object
      properties:
        id:
          example: 7b3e9d1f-5a8c-4e2b-9d6f-3c7a1e5b9d4f
          type: string
          format: uuid
        created_at:
          example: '2026-03-10T14:00:00Z'
          type: string
          format: date-time
        expires_at:
          example: '2026-03-10T15:00:00Z'
          type: string
          format: data-time
        metadata:
          $ref: '#/components/schemas/Metadata'
      required:
        - id
        - created_at
    Metadata:
      type: object
      description: |
        Metadata consisting of key-value entries.

          * Maximum 20 key-value pairs.
          * Maximum 20 characters per key.
          * Maximum 80 characters per value.
      example:
        my_key_one: my_value_one
        my_key_two: my_value_two
    ErrorGeneric:
      type: object
      properties:
        code:
          $ref: '#/components/schemas/ErrorStatusCode'
        classifier:
          $ref: '#/components/schemas/ErrorClassifier'
        message:
          $ref: '#/components/schemas/ErrorMessage'
    ErrorValidation:
      type: object
      properties:
        code:
          $ref: '#/components/schemas/ErrorStatusCode'
        classifier:
          $ref: '#/components/schemas/ErrorClassifier'
        message:
          $ref: '#/components/schemas/ErrorMessage'
        validation_errors:
          type: array
          items:
            type: object
            properties:
              path:
                example: $.source.account_number
                type: string
                description: Json-path in the request which points to the validation error
              message:
                example: is required
                type: string
                description: Human readable validation message
    ErrorStatusCode:
      type: integer
      description: The corresponding HTTP status code for the error
    ErrorClassifier:
      type: string
      description: Technical code that helps to identify the error
    ErrorMessage:
      type: string
      description: Human readable representation of the error
  responses:
    401_UnauthorizedError:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorGeneric'
          example:
            code: 401
            message: No valid means of authentication was provided
            classifier: UNAUTHORIZED
    403_ForbiddenError:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorGeneric'
          example:
            code: 403
            message: Not allowed to access this resource or feature
            classifier: FORBIDDEN
    409_ConflictError:
      description: Conflict
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorGeneric'
          example:
            code: 409
            message: Conflict
            classifier: CONFLICT
    422_ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorValidation'
          example:
            code: 422
            classifier: VALIDATION_ERROR
            message: Validation error
            validation_errors:
              - path: json-path
                message: human readable error message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT bearer token obtained via the OAuth2 client-credentials grant from
        the platform Authentication API. The token's scopes gate the endpoints
        it may call, and its audience names the Guardian instance. This is the
        standard way to authenticate to Guardian.
    APIKey:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        Deprecated. Long-lived instance API key, sent as `x-api-key`. Existing
        integrations continue to work, but new ones should use the OAuth2 bearer
        token instead.

````