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

# Create a new web chat thread

> Create a new web chat thread for server-side integrations. Use X-API-Key or Clerk auth.



## OpenAPI

````yaml post /api/v1/threads/web
openapi: 3.0.0
info:
  version: 1.0.0
  title: Feather AI API
servers:
  - url: https://prod.featherhq.com
    description: Production environment
security: []
paths:
  /api/v1/threads/web:
    post:
      tags:
        - SMS Threads
      summary: Create a new web chat thread
      description: >-
        Create a new web chat thread for server-side integrations. Use X-API-Key
        or Clerk auth.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                agentId:
                  type: string
                  format: uuid
                metadata:
                  type: object
                  additionalProperties:
                    type: string
                variables:
                  type: object
                  additionalProperties:
                    type: string
              required:
                - agentId
      responses:
        '200':
          description: Web chat thread created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  thread:
                    type: object
                    properties:
                      id:
                        type: string
                      organizationId:
                        type: string
                      agentVersionId:
                        type: string
                      toPhoneNumber:
                        type: string
                      fromPhoneNumber:
                        type: string
                        nullable: true
                      fromPhoneNumberId:
                        type: string
                        nullable: true
                      leadId:
                        type: string
                        nullable: true
                      isActive:
                        type: boolean
                      createdAt:
                        type: string
                      updatedAt:
                        type: string
                      closedAt:
                        type: string
                        nullable: true
                      closedReason:
                        type: string
                        nullable: true
                      metadata:
                        type: object
                        nullable: true
                        additionalProperties:
                          type: string
                      variables:
                        type: object
                        nullable: true
                        additionalProperties:
                          type: string
                      agentId:
                        type: string
                      agentDetails:
                        type: object
                        properties:
                          id:
                            type: string
                          name:
                            type: string
                          description:
                            type: string
                            nullable: true
                          agentType:
                            type: string
                            enum:
                              - CALL
                              - TEXT
                        required:
                          - id
                          - name
                          - description
                          - agentType
                      agentVersionDetails:
                        type: object
                        properties:
                          id:
                            type: string
                          version:
                            type: number
                          name:
                            type: string
                          mode:
                            type: string
                            enum:
                              - FLOW
                              - PROMPT
                          smsMaxTokens:
                            type: number
                            nullable: true
                          smsTemperature:
                            type: number
                            nullable: true
                          discardInboundSms:
                            type: boolean
                        required:
                          - id
                          - version
                          - name
                          - mode
                          - smsMaxTokens
                          - smsTemperature
                          - discardInboundSms
                    required:
                      - id
                      - organizationId
                      - agentVersionId
                      - toPhoneNumber
                      - fromPhoneNumber
                      - fromPhoneNumberId
                      - leadId
                      - isActive
                      - createdAt
                      - updatedAt
                      - closedAt
                      - closedReason
                      - agentId
                      - agentDetails
                      - agentVersionDetails
                required:
                  - thread
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    default: 400
                  message:
                    type: string
                    default: Bad request
                  code:
                    type: string
                    enum:
                      - BAD_REQUEST
                    default: BAD_REQUEST
                  success:
                    type: boolean
                    enum:
                      - false
                    default: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    default: 500
                  message:
                    type: string
                    default: Internal server error
                  code:
                    type: string
                    enum:
                      - INTERNAL_SERVER_ERROR
                    default: INTERNAL_SERVER_ERROR
                  success:
                    type: boolean
                    enum:
                      - false
                    default: false
      security:
        - ApiKey: []
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-Key

````