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

# Connect with app

> Validates a security code provided by an assistant device and establishes a connection between a mobile app user and an assistant. The mobile app user's token is passed in the body.



## OpenAPI

````yaml api-reference/openapi.json post /connect
openapi: 3.0.0
info:
  title: Cati Main Server API
  version: 1.0.0
  description: >-
    API for managing Cati assistant users, app users, contacts, media,
    notifications and preferences.
servers:
  - url: /
security: []
paths:
  /connect:
    post:
      tags:
        - Authentication & Users
      summary: Connect Mobile App User to Assistant
      description: >-
        Validates a security code provided by an assistant device and
        establishes a connection between a mobile app user and an assistant. The
        mobile app user's token is passed in the body.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectAssistantRequest'
      responses:
        '200':
          description: Connection successful. Returns assistant details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectAssistantResponse'
        '400':
          description: Invalid input.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Invalid or expired user token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Database or server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ConnectAssistantRequest:
      type: object
      required:
        - token
        - code
      properties:
        token:
          type: string
          description: JWT Access Token of the mobile app user attempting to connect.
          example: eyJ...
        code:
          type: string
          description: Security code obtained from the assistant device.
          example: AbC1dE2fG3
    ConnectAssistantResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessResponse'
        - type: object
          properties:
            assistant:
              type: object
              properties:
                id:
                  type: integer
                  example: 101
                name:
                  type: string
                  example: Cati Owner
                image:
                  type: string
                  nullable: true
                  example: http://example.com/image.jpg
                phone:
                  type: string
                  example: '+34612345678'
    ErrorResponse:
      type: object
      properties:
        status:
          type: string
          example: error
        message:
          type: string
          example: Database connection failed
    SuccessResponse:
      type: object
      properties:
        status:
          type: string
          example: success
        message:
          type: string
          example: Operation completed successfully

````