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

> Authenticate a widget user — authenticate the contacts. Use when authenticating widget visitors against your own identity provider.

# Authenticate a widget user



## OpenAPI

````yaml post /widget/authenticate-user
openapi: 3.1.0
info:
  title: OpenCX API
  description: >

    OpenCX is an AI-powered, all-in-one platform for customer support and
    outbound communications.


    Use this API to manage your OpenCX organization's AI agents, actions,
    conversations, contacts, and more.


    To get started, generate a new API key from the dashboard.


    ## Authentication

    All API endpoints require authentication using a Bearer token. You can
    generate an API key from your OpenCX dashboard.


    ## Rate Limiting

    API requests are rate limited to ensure fair usage. The current limits are:

    - 100 requests per minute for standard endpoints

    - 1000 requests per minute for streaming endpoints


    ## Error Handling

    The API uses standard HTTP status codes and returns detailed error messages
    in the response body.
  version: 1.0-beta
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.open.cx
    description: Production
security:
  - bearerAuth: []
paths:
  /widget/authenticate-user:
    post:
      summary: Authenticate a widget user
      description: authenticate the contacts
      operationId: authenticateWidgetUser
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthenticateUserPayloadDto'
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VerifiedWidgetContactTokenResponseDto'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    AuthenticateUserPayloadDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/AuthenticateUserPayloadDtoInput'
      type: object
      properties:
        email:
          type: string
          format: email
          pattern: >-
            ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
        name:
          type: string
        avatar_url:
          anyOf:
            - type: string
            - type: 'null'
        phone:
          type: string
        language:
          $ref: '#/components/schemas/LanguageIsoCodeValues'
        customData:
          type: object
          propertyNames:
            type: string
          additionalProperties:
            anyOf:
              - type: string
              - type: number
              - type: boolean
        chat_context:
          type: string
        http_action_overrides:
          $ref: '#/components/schemas/PublicAPIHttpOverrides'
      required:
        - email
    VerifiedWidgetContactTokenResponseDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/VerifiedWidgetContactTokenResponseDto'
      type: object
      properties:
        token:
          type: string
          description: The JWT token to use for further requests
        contact:
          type: object
          properties:
            id:
              type: string
          required:
            - id
          additionalProperties: false
      required:
        - token
        - contact
      additionalProperties: false
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
    LanguageIsoCodeValues:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/LanguageIsoCodeValuesInput'
      type: string
      enum:
        - en
        - fr
        - de
        - nl
        - pl
        - pt
        - es
        - it
        - ru
        - ja
        - ko
        - zh
        - ar
        - tr
        - sv
        - da
        - 'no'
        - fi
        - el
        - cs
        - hu
        - th
        - vi
        - id
        - he
        - hi
        - uk
        - ro
        - bg
        - hr
        - sk
        - sl
        - sr
        - et
        - lv
        - lt
        - is
        - ga
        - ms
        - tl
        - fa
        - bn
        - ta
        - te
        - ur
        - sw
        - zu
        - af
        - sq
        - hy
        - az
        - eu
        - be
        - bs
        - ca
        - cy
        - ku
        - ckb
        - kmr
    PublicAPIHttpOverrides:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/PublicAPIHttpOverridesInput'
      type: object
      properties:
        query_params:
          type: object
          propertyNames:
            type: string
          additionalProperties:
            type: string
        path_params:
          type: object
          propertyNames:
            type: string
          additionalProperties:
            type: string
        body_params:
          type: object
          propertyNames:
            type: string
          additionalProperties:
            type: string
        headers:
          type: object
          propertyNames:
            type: string
          additionalProperties:
            type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````