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

# Authenticate

> Generates a unique token for API communication. This endpoint prompts the user to confirm or deny the connection.



## OpenAPI

````yaml post /auth
openapi: 3.0.0
info:
  title: Daytalog API
  version: 0.1.0
servers:
  - url: http://localhost:5252
security:
  - ApiKeyAuth: []
paths:
  /auth:
    post:
      summary: Authenticate
      description: >-
        Generates a unique token for API communication. This endpoint prompts
        the user to confirm or deny the connection.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthRequest'
      responses:
        '200':
          description: Token issued
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthResponse'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '403':
          description: Denied by user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthNotApproved'
        '408':
          description: Authentication request timed out after 60 seconds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimedOutResponse'
      security: []
components:
  schemas:
    AuthRequest:
      type: object
      required:
        - appName
      properties:
        appName:
          type: string
          example: MyApp
    AuthResponse:
      type: object
      properties:
        token:
          type: string
          example: 295b78d3-a817-4db9-a595-e1643ceb3735
    ValidationErrorResponse:
      type: object
      properties:
        error:
          type: string
          example: Validation Error
        details:
          type: array
          items:
            type: object
            properties:
              prop:
                type: string
              message:
                type: string
    AuthNotApproved:
      type: object
      properties:
        error:
          type: string
          example: access not approved
    TimedOutResponse:
      type: object
      properties:
        error:
          type: string
          example: Authentication request timed out
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-token

````