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

# Create a profile token

> Creates a JWT token for a customer or session profile



## OpenAPI

````yaml https://swish.app/api/2026-07/.well-known/openapi post /profiles/token
openapi: 3.0.0
info:
  title: Swish API
  description: >-
    The Swish API provides endpoints for managing profiles, lists, items,
    subscriptions, notifications, orders, etc. All endpoints require
    authentication using a Bearer token. Responses follow a consistent structure
    with a `data` wrapper for successful responses and standardized error
    formats.
  version: 2026-07
  contact: {}
servers:
  - url: https://swish.app/api/2026-07
security: []
tags: []
paths:
  /profiles/token:
    post:
      tags:
        - Profiles
      summary: Create a profile token
      description: Creates a JWT token for a customer or session profile
      operationId: ProfileController_createToken
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProfileToken'
      responses:
        '201':
          description: The token has been created
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Response'
                  - properties:
                      data:
                        $ref: '#/components/schemas/CreateProfileTokenResult'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - properties:
                      error:
                        allOf:
                          - $ref: '#/components/schemas/Error'
                          - properties:
                              message:
                                type: string
                                example: Validation failed
                              error:
                                type: string
                                example: Bad Request
                              statusCode:
                                type: number
                                example: 400
                              requestId:
                                type: string
                                example: 123e4567-e89b-12d3-a456-426614174000
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - properties:
                      error:
                        allOf:
                          - $ref: '#/components/schemas/Error'
                          - properties:
                              message:
                                type: string
                                example: Failed to authenticate request
                              error:
                                type: string
                                example: Unauthorized
                              statusCode:
                                type: number
                                example: 401
                              requestId:
                                type: string
                                example: 123e4567-e89b-12d3-a456-426614174000
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - properties:
                      error:
                        allOf:
                          - $ref: '#/components/schemas/Error'
                          - properties:
                              message:
                                type: string
                                example: >-
                                  You do not have permission to access this
                                  resource
                              error:
                                type: string
                                example: Forbidden
                              statusCode:
                                type: number
                                example: 403
                              requestId:
                                type: string
                                example: 123e4567-e89b-12d3-a456-426614174000
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - properties:
                      error:
                        allOf:
                          - $ref: '#/components/schemas/Error'
                          - properties:
                              message:
                                type: string
                                example: The requested resource was not found
                              error:
                                type: string
                                example: Not Found
                              statusCode:
                                type: number
                                example: 404
                              requestId:
                                type: string
                                example: 123e4567-e89b-12d3-a456-426614174000
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - properties:
                      error:
                        allOf:
                          - $ref: '#/components/schemas/Error'
                          - properties:
                              message:
                                type: string
                                example: An unexpected error occurred
                              error:
                                type: string
                                example: Internal Server Error
                              statusCode:
                                type: number
                                example: 500
                              requestId:
                                type: string
                                example: 123e4567-e89b-12d3-a456-426614174000
      security:
        - Swish API key: []
        - bearer: []
components:
  schemas:
    CreateProfileToken:
      type: object
      properties:
        customer:
          type: string
          description: A customer GID to create a token for.
          example: gid://shopify/Customer/1234567890
        session:
          type: string
          description: A session GID to link to the customer.
          example: gid://swish/Session/abc123
    Response:
      type: object
      properties:
        data:
          type: object
          description: Response data
      required:
        - data
    CreateProfileTokenResult:
      type: object
      properties:
        token:
          type: string
          description: A Swish API token for the profile
          example: >-
            eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
        profile:
          type: string
          description: The profile associated with the token
          example: gid://swish/Session/abc123
      required:
        - token
        - profile
    ErrorResponse:
      type: object
      properties:
        error:
          description: Error details
          allOf:
            - $ref: '#/components/schemas/Error'
      required:
        - error
    Error:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Something went wrong
        error:
          type: string
          description: The error type
          example: Not Found
        statusCode:
          type: number
          description: The HTTP status code of the error
          example: 404
        requestId:
          type: string
          description: The ID of the request that caused the error
          example: 123e4567-e89b-12d3-a456-426614174000
      required:
        - message
        - error
        - statusCode
        - requestId
  securitySchemes:
    Swish API key:
      scheme: Bearer
      bearerFormat: JWT
      type: http
      description: Enter your JWT token

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.