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

# Generate token

> Login to generate Blend API access tokens. Returns a JWT access token and refresh token. The access token expires in 60 minutes, and the refresh token expires in 7 days.



## OpenAPI

````yaml /openapi-public.yml post /api/v1/auth/login
openapi: 3.0.3
info:
  title: Blend API
  version: 1.0.0
  description: API for Blend
servers:
  - url: https://api.byblend.com
    description: Blend production server
security:
  - bearerAuth: []
tags:
  - name: Orders
    description: Order management endpoints
  - name: Patients
    description: Patient management endpoints
  - name: Reports
    description: Reporting endpoints
  - name: Products and Materials
    description: Product catalog and inventory endpoints
  - name: Electronic Prescriptions
    description: Electronic prescription management endpoints
  - name: Authentication
    description: Authentication endpoints
  - name: Notifications
    description: User management endpoints
  - name: Prescribers
paths:
  /api/v1/auth/login:
    post:
      tags:
        - Authentication
      summary: Generate token
      description: >-
        Login to generate Blend API access tokens. Returns a JWT access token
        and refresh token. The access token expires in 60 minutes, and the
        refresh token expires in 7 days.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthenticationLogin'
      responses:
        '200':
          description: Successful response with access tokens and user details
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/AuthenticationToken'
                  - type: object
                    properties:
                      user:
                        $ref: '#/components/schemas/AuthenticationUser'
      security: []
components:
  schemas:
    AuthenticationLogin:
      type: object
      properties:
        email:
          type: string
          description: Email address
          example: chad@byblend.com
        password:
          type: string
          description: Password
          example: ch4db13nd$$
      required:
        - email
        - password
    AuthenticationToken:
      type: object
      properties:
        access_token:
          type: string
          description: Access token
          example: eyJhbGciOiJIAzI1NiIsInR5cCI6IkpXVCJ9...
        refresh_token:
          type: string
          description: Refresh token
          example: eyJhbGciOiJIAzI1NiIsInR5cCI6IkpXVCJ9...
        expires_at:
          type: string
          description: Expiration date and time of the refresh token
          example: '2025-03-27T12:00:00Z'
    AuthenticationUser:
      type: object
      allOf:
        - $ref: '#/components/schemas/ID'
        - $ref: '#/components/schemas/Timestamps'
        - type: object
          properties:
            email:
              type: string
              description: Email address
              example: chad@byblend.com
            first_name:
              type: string
              description: First name
              example: Chad
            last_name:
              type: string
              description: Last name
              example: Birkenstock
            is_active:
              type: boolean
              description: Whether the user is active
              example: true
            role:
              type: string
              description: Role of the user
              example: admin
    ID:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier
          example: 0227d1e5-ba9a-42b5-8fe2-38882aa65708
    Timestamps:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          description: Date and time of creation
          example: '2025-03-15T12:00:00Z'
        updated_at:
          type: string
          format: date-time
          description: Date and time of last update
          example: '2025-03-15T12:00:00Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````