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

# Exchange a magic token for auth and refresh tokens



## OpenAPI

````yaml /openapi.yaml post /sessions/magic
openapi: 3.0.1
info:
  title: GetSpecs REST API
  description: REST API documentation for GetSpecs.
  version: 1.0.0
servers:
  - url: /v1
  - url: https://demo-api.getspecs.io/v1
security: []
paths:
  /sessions/magic:
    post:
      tags:
        - Session
      summary: Exchange a magic token for auth and refresh tokens
      operationId: sessions#magic
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/requestBodySessionMagic'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/token'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
components:
  schemas:
    requestBodySessionMagic:
      type: object
      properties:
        magic_token:
          type: string
      required:
        - magic_token
    token:
      type: object
      properties:
        auth_token:
          type: string
        refresh_token:
          type: string
    error:
      type: object
      properties:
        error:
          type: string
        errors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                nullable: true
              code:
                type: string
                nullable: true
              message:
                type: string
            required:
              - message

````

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