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

# Stage an inbound SIP call

> Pre-initialize a call (agent configuration, variables initialization, and resources) before an inbound SIP call arrives, reducing cold-start latency to near zero.

**Async:** Returns the `call_id` immediately. Poll `GET /v1/calls/{call_id}` and wait for the status to become `staged` before triggering the SIP call.

**Sync:** Blocks until the call is ready (status `staged`) or a timeout occurs (HTTP 408).

Once staged, trigger the inbound SIP call with the header:
```
X-Rounded-Call-Id: {call_id}
```
This ensures the call is routed to the staged agent.

**Call status flow:** `initiated` → `staged` → `ringing` → `in_progress` → `completed`

If no SIP call arrives within the staging timeout (60s), the call is marked `no_answer` and cleaned up.

**Tip:** If your agent uses *Call context: Variables initialization* to load data when processing a call, prefer using this endpoint to prepare it beforehand.



## OpenAPI

````yaml /api-reference-v1/openapi.json post /v1/calls/stage
openapi: 3.1.0
info:
  title: Rounded API
  description: Rounded API
  version: 1.0.0
servers:
  - url: https://api.callrounded.com
security:
  - ApiKeyHeader: []
paths:
  /v1/calls/stage:
    post:
      tags:
        - calls
      summary: Stage an inbound SIP call
      description: >-
        Pre-initialize a call (agent configuration, variables initialization,
        and resources) before an inbound SIP call arrives, reducing cold-start
        latency to near zero.


        **Async:** Returns the `call_id` immediately. Poll `GET
        /v1/calls/{call_id}` and wait for the status to become `staged` before
        triggering the SIP call.


        **Sync:** Blocks until the call is ready (status `staged`) or a timeout
        occurs (HTTP 408).


        Once staged, trigger the inbound SIP call with the header:

        ```

        X-Rounded-Call-Id: {call_id}

        ```

        This ensures the call is routed to the staged agent.


        **Call status flow:** `initiated` → `staged` → `ringing` → `in_progress`
        → `completed`


        If no SIP call arrives within the staging timeout (60s), the call is
        marked `no_answer` and cleaned up.


        **Tip:** If your agent uses *Call context: Variables initialization* to
        load data when processing a call, prefer using this endpoint to prepare
        it beforehand.
      operationId: stage_sip_call_v1_calls_stage_post
      parameters:
        - name: sync
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              If true, block until the call is ready (status 'staged') or
              timeout.
            default: false
            title: Sync
          description: If true, block until the call is ready (status 'staged') or timeout.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StageSipCallApiRequest'
      responses:
        '201':
          description: Call staging initiated (async) or call staged and ready (sync)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StageSipCallApiResponse'
                type: object
                title: Response Stage Sip Call V1 Calls Stage Post
          headers:
            ratelimit-limit:
              description: The number of requests allowed in the current rate limit period
              schema:
                type: integer
            ratelimit-remaining:
              description: >-
                The number of requests remaining in the current rate limit
                period
              schema:
                type: integer
            x-ratelimit-limit-minute:
              description: >-
                The number of requests allowed in the current minute window, if
                rate limit is set to minutes.
              schema:
                type: integer
            x-ratelimit-remaining-minute:
              description: >-
                The number of requests remaining in the current minute window,
                if rate limit is set to minutes.
              schema:
                type: integer
            x-ratelimit-limit-hour:
              description: >-
                The number of requests allowed in the current hour window, if
                rate limit is set to hourly.
              schema:
                type: integer
            x-ratelimit-remaining-hour:
              description: >-
                The number of requests remaining in the current hour window, if
                rate limit is set to hourly.
              schema:
                type: integer
            x-ratelimit-limit-<seconds>:
              description: >-
                The number of requests allowed in the current <seconds> window,
                where <seconds> is the number of seconds, if rate limit is set
                to seconds.
              schema:
                type: integer
            x-ratelimit-remaining-<seconds>:
              description: >-
                The number of requests remaining in the current <seconds>
                window, where <seconds> is the number of seconds, if rate limit
                is set to seconds.
              schema:
                type: integer
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseError'
              example:
                error:
                  message: Bad request
                  type: api_error
                  status: 400
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseError'
              examples:
                auth_error:
                  summary: Error from the API Service
                  value:
                    message: Unauthorized
                    type: auth_error
                    status: 401
                gateway_error:
                  summary: Error from the API Gateway
                  value:
                    message: Unauthorized
                    type: gateway_auth_error
                    status: 401
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseError'
              example:
                error:
                  message: Access forbidden
                  type: api_error
                  status: 403
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseError'
              example:
                error:
                  message: The request endpoint does not exist
                  type: http_error
                  status: 404
        '408':
          description: Sync mode timeout — call did not reach 'staged' status in time
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseError'
              example:
                error:
                  message: Invalid request body
                  type: validation_error
                  status: 422
                  details:
                    - field: email
                      message: Invalid email format
        '429':
          description: Rate Limit Exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseError'
              example:
                error:
                  message: API rate limit exceeded
                  type: gateway_rate_limit_error
                  status: 429
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseError'
              example:
                error:
                  message: An unexpected error occurred
                  type: generic_error
                  status: 500
components:
  schemas:
    StageSipCallApiRequest:
      properties:
        from_number:
          type: string
          title: From Number
          description: The caller's phone number in E.164 format.
          examples:
            - '+33912345678'
        to_number:
          type: string
          title: To Number
          description: The destination phone number in E.164 format.
          examples:
            - '+33612345678'
        agent_id:
          type: string
          format: uuid
          title: Agent Id
          description: The ID of the agent that will handle the call.
          examples:
            - 411b82c8-462a-4e1b-89bc-10ab3ce1ed29
        dynamic_variables_values:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: integer
                  - type: number
                  - type: boolean
                  - type: string
                    format: date-time
                  - type: object
              type: object
            - type: 'null'
          title: Dynamic Variables Values
          description: >-
            Initial variable values to inject into the agent conversation before
            it starts.
      type: object
      required:
        - from_number
        - to_number
        - agent_id
      title: StageSipCallApiRequest
      description: >-
        Request body for staging an inbound SIP call.


        This endpoint is only supported for **inbound** calls. Staging
        pre-initializes

        the call (agent configuration, variables, and resources) before the
        actual

        inbound SIP call arrives, reducing cold-start latency to near zero.


        Once staged, the inbound SIP call must include the header

        ``X-Rounded-Call-Id: <call_id>`` so it is routed to the staged call.
    StageSipCallApiResponse:
      properties:
        message:
          type: string
          title: Message
        data:
          $ref: '#/components/schemas/StageSipCallApiResponseData'
        error:
          anyOf:
            - $ref: '#/components/schemas/ApiResponseError'
            - type: 'null'
        status:
          type: integer
          title: Status
          default: 201
      type: object
      required:
        - message
        - data
      title: StageSipCallApiResponse
      description: >-
        Response from staging a SIP call.


        The ``call_id`` is used to:


        - Poll ``GET /v1/calls/{call_id}`` to check when the status becomes
        ``staged`` (call ready).

        - Pass as the ``X-Rounded-Call-Id`` SIP header value when triggering the
        inbound call.
    ApiResponseError:
      properties:
        message:
          type: string
          title: Message
        type:
          type: string
          title: Type
        status:
          type: integer
          title: Status
        details:
          anyOf:
            - items:
                $ref: '#/components/schemas/ApiResponseErrorDetail'
              type: array
            - type: 'null'
          title: Details
      type: object
      required:
        - message
        - type
        - status
      title: ApiResponseError
      example:
        details:
          - field: email
            message: Invalid email format
        message: An error occurred while processing your request
        status: 400
        type: generic_error
    StageSipCallApiResponseData:
      properties:
        call_id:
          type: string
          title: Call Id
          description: >-
            The unique identifier for the staged call. Use this value as the
            `X-Rounded-Call-Id` SIP header when triggering the inbound call.
      type: object
      required:
        - call_id
      title: StageSipCallApiResponseData
    ApiResponseErrorDetail:
      properties:
        field:
          anyOf:
            - type: string
            - type: 'null'
          title: Field
        message:
          type: string
          title: Message
      type: object
      required:
        - message
      title: ApiResponseErrorDetail
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        The API Key created in [Rounded Studio](https://app.callrounded.com).

        - You can create it by going to the "API Keys" settings of your profile.

        - Need help? You can email us at
        [team@callrounded.com](mailto:team@callrounded.com) or join our [Discord
        community](https://discord.gg/en537j5z75).

````