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

# Créer un fil de discussion

> Starts a discussion thread on a conversation item with a first comment. Each item can have only one thread.

<Note>
  **Scope requis :** `THREADS_WRITE`
</Note>

## Comportement

Démarre un fil de discussion sur un élément de conversation. `content` devient le premier commentaire du fil, et la réponse est le fil complet incluant ce commentaire.

Chaque élément ne peut avoir **qu'un seul fil**. S'il en existe déjà un, la requête retourne une erreur `409` avec le code `THREAD_ALREADY_EXISTS` — retrouvez-le avec [`GET /v2/api/threads`](/fr/v2/api-reference/threads/find-thread) et ajoutez-y un commentaire à la place.

## Mentions

Mentionnez des coéquipiers inline dans `content` avec `@[Display Name](usr-xxxx)` — voir le [guide des mentions](/fr/v2/api-reference/notes/overview#mentions).

## Erreurs

| Statut | Code                          | Quand                                                                       |
| ------ | ----------------------------- | --------------------------------------------------------------------------- |
| `400`  | `INVALID_THREAD_ENTITY_TYPE`  | `entity_type` n'est pas l'un de `CALL`, `TEXT_MESSAGE`, `CONVERSATION_NOTE` |
| `400`  | `EMPTY_NOTE_CONTENT`          | `content` est manquant ou vide                                              |
| `400`  | `NOTE_CONTENT_TOO_LONG`       | `content` dépasse 4 000 caractères                                          |
| `404`  | `CONVERSATION_ITEM_NOT_FOUND` | Aucun élément de conversation avec cet `entity_id`                          |
| `409`  | `THREAD_ALREADY_EXISTS`       | L'élément a déjà un fil                                                     |


## OpenAPI

````yaml POST /v2/api/threads
openapi: 3.0.3
info:
  title: Allo API
  description: >-
    Allo API provides programmatic access to your Allo account, allowing you to
    manage webhooks, retrieve calls and contacts, and send SMS messages.


    All requests to `/v1/api/**` endpoints automatically go through quota
    checking and scope validation.
  version: 1.0.0
  contact:
    name: Allo Support
servers:
  - url: https://api.withallo.com
    description: Production server
security: []
tags:
  - name: Summary Templates
    description: >-
      Manage call summary templates that control how AI-generated call summaries
      are structured for your team.
  - name: Webhooks
    description: >-
      Manage webhook endpoints to receive real-time notifications about events
      in your Allo account. Each endpoint subscribes to one or more event topics
      and is verified with a signing secret.
  - name: Calls
    description: >-
      Retrieve and search call records with filtering and pagination. Filter
      calls by your Allo phone number.
  - name: Contacts
    description: >-
      Search and retrieve contact information with sorting and pagination.
      Includes engagement level tracking.
  - name: SMS
    description: Send SMS messages to phone numbers using your Allo numbers.
  - name: Phone Numbers
    description: Retrieve information about your Allo phone numbers.
  - name: Analytics
    description: Pre-computed call metrics, team performance, and outbound dial funnel
  - name: CRM
    description: Manage people, companies, and deals in your CRM.
  - name: Notes
    description: >-
      Internal team notes on conversations and CRM people, with @mention
      support. Notes are never visible to the contact.
  - name: Threads
    description: >-
      Team discussion threads attached to a conversation item (call, SMS, or
      conversation note). One thread per item.
paths:
  /v2/api/threads:
    post:
      tags:
        - Threads
      summary: Create thread
      description: >-
        Starts a discussion thread on a conversation item with a first comment.
        Each item can have only one thread.
      operationId: createThread
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                entity_type:
                  type: string
                  enum:
                    - CALL
                    - TEXT_MESSAGE
                    - CONVERSATION_NOTE
                  description: Type of the conversation item to attach the thread to.
                entity_id:
                  type: string
                  description: ID of the conversation item (`cll-*`, `msg-*`, or `not-*`).
                  example: cll-abc123
                content:
                  type: string
                  description: >-
                    First comment text (max 4000 characters). Mention teammates
                    inline with `@[Name](usr-...)`.
                  example: Can someone call them back today? @[Jane Doe](usr-abc123)
              required:
                - entity_type
                - entity_id
                - content
            example:
              entity_type: CALL
              entity_id: cll-abc123
              content: Can someone call them back today? @[Jane Doe](usr-abc123)
      responses:
        '201':
          description: Thread created with its first comment
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Thread'
              example:
                data:
                  id: cth-abc123
                  entity_type: CALL
                  entity_id: cll-abc123
                  contact_number: '+14155551234'
                  resolved: false
                  resolved_at: null
                  resolved_by: null
                  comment_count: 1
                  created_at: '2026-07-13T10:00:00'
                  comments:
                    - id: thc-abc123
                      content: >-
                        Can someone call them back today? @[Jane
                        Doe](usr-abc123)
                      user:
                        id: usr-def456
                        name: John Smith
                      mentions:
                        - user_id: usr-abc123
                          name: Jane Doe
                          deleted: false
                      created_at: '2026-07-13T10:00:00'
                      updated_at: '2026-07-13T10:00:00'
        '400':
          $ref: '#/components/responses/ApiValidationError'
        '401':
          $ref: '#/components/responses/ApiUnauthorized'
        '404':
          $ref: '#/components/responses/ApiNotFound'
        '409':
          $ref: '#/components/responses/ApiConflict'
        '429':
          $ref: '#/components/responses/ApiRateLimited'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Thread:
      type: object
      properties:
        id:
          type: string
          description: Thread ID (`cth-*`)
          example: cth-abc123
        entity_type:
          type: string
          enum:
            - CALL
            - TEXT_MESSAGE
            - CONVERSATION_NOTE
          description: Type of the conversation item the thread is attached to.
        entity_id:
          type: string
          description: ID of the conversation item (`cll-*`, `msg-*`, or `not-*`).
          example: cll-abc123
        contact_number:
          type: string
          description: The contact's phone number (E.164).
          example: '+14155551234'
        resolved:
          type: boolean
        resolved_at:
          type: string
          format: date-time
          nullable: true
        resolved_by:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/NoteUser'
        comment_count:
          type: integer
        created_at:
          type: string
          format: date-time
        comments:
          type: array
          items:
            $ref: '#/components/schemas/ThreadComment'
    NoteUser:
      type: object
      description: Author of a note or comment.
      properties:
        id:
          type: string
          example: usr-def456
        name:
          type: string
          nullable: true
          example: John Smith
    ThreadComment:
      type: object
      properties:
        id:
          type: string
          description: Comment ID (`thc-*`)
          example: thc-abc123
        content:
          type: string
          description: Comment text, with mentions inline as `@[Name](usr-...)`.
        user:
          $ref: '#/components/schemas/NoteUser'
        mentions:
          type: array
          items:
            $ref: '#/components/schemas/NoteMention'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
            code:
              type: string
            message:
              type: string
            retryable:
              type: boolean
            request_id:
              type: string
            retry_after_seconds:
              type: integer
              nullable: true
    NoteMention:
      type: object
      description: A user mentioned in the content via `@[Name](usr-...)`.
      properties:
        user_id:
          type: string
          example: usr-abc123
        name:
          type: string
          nullable: true
          example: Jane Doe
        deleted:
          type: boolean
          description: '`true` if the mentioned user has since been removed from the team.'
  responses:
    ApiValidationError:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ApiUnauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ApiNotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ApiConflict:
      description: Conflict with existing resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ApiRateLimited:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````