> ## 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.

# Récupérer le brouillon du flux d'appel

> Returns the working draft of a phone number's call flow. Unlike `GET /v2/api/numbers/{number}/call_flow?status=draft`, this endpoint does NOT fall back to the published flow when no draft exists — it returns `404 CALL_FLOW_DRAFT_NOT_FOUND`. Use it to read a draft's `lock_version` without risk of accidentally holding the published version's lock.

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

## Comportement

Renvoie le **brouillon** de travail du flux d'appel d'un numéro. Le paramètre de chemin `{number}` est le numéro Allo au format E.164 (ex. `+14155551234`).

Contrairement à [Récupérer le flux d'appel](/fr/v2/api-reference/phone-numbers/get-call-flow) avec `?status=draft`, cette route **ne bascule pas** sur le flux publié (ni sur la synthèse de l'IVR héritée) lorsqu'aucun brouillon n'existe — elle renvoie `404 CALL_FLOW_DRAFT_NOT_FOUND`.

La réponse contient une **`confirmation_url`** — le lien où un utilisateur connecté vérifie et publie ce brouillon. Pour le publier directement, appelez [Publier le flux d'appel](/fr/v2/api-reference/phone-numbers/publish-call-flow) avec la `lock_version` de cette réponse.

<Note>
  Préférez cette route au début d'un cycle d'édition. `GET …/call_flow?status=draft` renvoie `200` avec la version *publiée* lorsqu'il n'y a pas de brouillon, si bien qu'un client peut se retrouver avec le `lock_version` de la version publiée — ce qui échoue ensuite à `POST …/call_flow/publish` avec `CALL_FLOW_STALE_LOCK`. Cette route transforme « aucun brouillon » en un `404` explicite.
</Note>

## Erreurs

* `404 CALL_FLOW_DRAFT_NOT_FOUND` — le numéro n'a aucun brouillon de travail. Créez-en un avec `PUT /v2/api/numbers/{number}/call_flow/draft`.
* `404 PHONE_NUMBER_NOT_FOUND` — le numéro ne fait pas partie des numéros de votre compte. Listez-les avec `GET /v2/api/numbers`.


## OpenAPI

````yaml GET /v2/api/numbers/{number}/call_flow/draft
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/numbers/{number}/call_flow/draft:
    get:
      tags:
        - Phone Numbers
      summary: Get call flow draft
      description: >-
        Returns the working draft of a phone number's call flow. Unlike `GET
        /v2/api/numbers/{number}/call_flow?status=draft`, this endpoint does NOT
        fall back to the published flow when no draft exists — it returns `404
        CALL_FLOW_DRAFT_NOT_FOUND`. Use it to read a draft's `lock_version`
        without risk of accidentally holding the published version's lock.
      operationId: getCallFlowDraft
      parameters:
        - name: number
          in: path
          required: true
          description: Allo phone number in E.164 format
          schema:
            type: string
            example: '+14155551234'
      responses:
        '200':
          description: The working draft
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CallFlow'
        '401':
          $ref: '#/components/responses/ApiUnauthorized'
        '404':
          $ref: '#/components/responses/ApiNotFound'
        '429':
          $ref: '#/components/responses/ApiRateLimited'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CallFlow:
      type: object
      description: A version of a phone number's call flow.
      properties:
        id:
          type: string
          nullable: true
          description: >-
            The call flow version ID. Null for a synthesized (never-persisted)
            flow.
          example: cflv-abc123
        flow_id:
          type: string
          nullable: true
          description: The parent call flow ID. Null for a synthesized flow.
          example: cflw-abc123
        version:
          type: integer
          description: Monotonic version number within the flow.
          example: 3
        status:
          type: string
          enum:
            - DRAFT
            - PUBLISHED
            - SYNTHESIZED
          description: >-
            DRAFT (working copy), PUBLISHED (live), or SYNTHESIZED (in-memory
            representation of a legacy IVR-only line).
          example: PUBLISHED
        lock_version:
          type: integer
          description: Optimistic-concurrency token; pass it back on the next draft save.
          example: 0
        schema_version:
          type: integer
          description: The call flow schema version this definition conforms to.
          example: 1
        engine_subset:
          type: string
          enum:
            - NESTED_IVR
            - FULL_FLOW
          example: FULL_FLOW
        number:
          type: string
          nullable: true
          description: >-
            E.164 of the line this flow routes. Null for a never-persisted
            SYNTHESIZED flow.
          example: '+14155551234'
        confirmation_url:
          type: string
          nullable: true
          description: >-
            A link where a signed-in user reviews this draft and publishes it.
            Present only on a `DRAFT` (a `PUBLISHED` or `SYNTHESIZED` version
            has nothing to confirm). Because the public API cannot publish, this
            is how a draft you compose reaches a human to go live. Treat it as
            opaque — pass it through verbatim; never construct or parse it.
          example: https://app.withallo.com/call-flow-draft/cflv-abc123
        entry_node_id:
          type: string
          description: The id of the entry node in `definition.nodes`.
          example: node-22
        definition:
          type: object
          description: The call flow tree document (opaque; camelCase keys).
          additionalProperties: true
    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
  responses:
    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'
    ApiRateLimited:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````