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

# Create Web Call Request

> Requires calls:create. Creates a browser call on a workflow agent (with or without steps before it answers or follow-ups after the call), and returns the capability the browser needs to follow and start it. Nothing is dialled, no call record is created and no line is held: the caller's browser starts the call itself once the steps are done.

Use this when an agent's mint answers `protocol: "call_request"`. An agent the mint answers `offer` for does not need it - POST /calls with `type: "web"` mints a session token and the browser sends one offer, exactly as before.

The `start_capability` is returned once and stored only as a hash. It authorises this one request's read, cancel and start and nothing else, it dies with the request, and it is safe to hand to a browser: it cannot read another request, a phone request, or anything about the workspace.


Requires `calls:create`. Creates a **browser** call on a workflow agent (with or without steps before
it answers or follow-ups after the call), and
hands back the one capability the browser needs to follow it and start it.

Nothing is dialled here. No call record is created, no line is held and no
minutes are charged: the caller's browser starts the call itself, once the steps
are done. That is the whole reason this endpoint exists — a browser call used to
be one request that took a line and created a peer in the same breath, which
left before-call steps nowhere to run.

```bash theme={null}
curl -X POST https://api.goyappr.com/call-requests \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-company-id: COMPANY_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "web",
    "agent_id": "AGENT_ID",
    "variables": { "LeadName": "David" }
  }'
```

```json theme={null}
{
  "request_id": "9f1c…",
  "run_id": "4ab2…",
  "channel": "web",
  "status": "preparing",
  "preparation_status": "pending",
  "call_id": null,
  "expires_at": "2026-09-16T00:15:00Z",
  "start_capability": "…",
  "status_url": "https://api.goyappr.com/web-call/call-requests/9f1c…",
  "cancel_url": "https://api.goyappr.com/web-call/call-requests/9f1c…/cancel",
  "start_url": "https://api.goyappr.com/web-call/call-requests/9f1c…/start"
}
```

## Which agents need this

Ask the mint. `POST /calls` with `type: "web"` answers with `protocol`:

| `protocol` | What the browser does |
| - | - |
| `offer` | Sends one SDP offer with the session token. Unchanged, and what most agents use. |
| `call_request` | Creates the call here, polls it, and starts it when it is ready. |

`@goyappr/client` does this for you — pass `session.protocol` through to
`startSession`. An older client that sends a one-shot offer to an agent the
mint answered `call_request` for is refused with
`409 workflow_preparation_required`, and the refusal
costs nothing: the token is not spent and no line is taken, so the same token
can create the request instead.

## The capability

`start_capability` is returned **once** and stored only as a hash. It authorises
this one request's read, cancel and start, and nothing else — not another
request, not a phone request, not anything about the workspace — so it is safe
to hand to a browser. Send it as `x-yappr-call-request-key`. It dies with the
request at `expires_at`.

That is why the three URLs are browser routes on the API host
(`/web-call/call-requests/…`) that take the capability instead of your key: your
secret key never has to reach a browser.

## Asking again with the same key

Send an `Idempotency-Key` and a retry is safe: the same key with the same body
does not create a second request. It answers **`200`** with the request **as it
is now** — a request whose steps already failed reads `failed` with its
`error_code`, not `preparing` — with `replayed: true`, the three URLs, and **no**
`start_capability`. The capability that works was returned once, by the first
create, and is stored only as a hash, so keep it from that answer. The same key
with a different body is `409 WORKFLOW_IDEMPOTENCY_CONFLICT`.

A browser that presents a Web SDK session token again gets the same answer: the
token is the create's key. That holds until the token runs out — even in its last
five minutes, when a token that has not created a request yet is refused with
`409 SESSION_TOKEN_EXPIRES_TOO_SOON`.

## Following it

Poll `status_url` until `status` is `ready`, then start it. The read carries
`preparation_steps` — one entry per authored before-call step, in document
order, each with the author's own `label` — so a waiting caller can be shown
what is running rather than a silent spinner, and your server's
[`GET /call-requests/{id}`](https://docs.goyappr.com/api-reference/calls/request-get) carries the same
array, with the failed step's `error_code` and `http_status`. Step **results**
are never included: a before-call result is data the agent is given, not
something a browser may read.

```json theme={null}
{
  "status": "preparing",
  "preparation_status": "running",
  "preparation_steps": [
    { "id": "lookup_caller", "label": "Look up the caller", "status": "running" }
  ]
}
```

`cancel_url` stops a request that has not been started. A browser call holds no
line while it prepares, but the steps are work this workspace paid for, so
cancelling when the caller changes their mind is worth doing rather than letting
it expire.

## Statuses

The same states a phone request has, and they mean the same things. See
[Get Call Request](https://docs.goyappr.com/api-reference/calls/request-get.md). The one difference is what
`dispatching` means here: a browser request reaches it when the caller claims
their start and the peer is being negotiated, rather than when a number is being
dialled. It reads `dispatched` as soon as the voice server has answered the
browser, and stays `dispatched` after the call ends; how the call went is on
[`GET /calls/{id}`](https://docs.goyappr.com/api-reference/calls/get) under `call_id`. The call's end
reaches its workflow like a phone call's, so follow-ups on `any_end` or
`call.ended` run on a browser call too.

## Refusals

| HTTP | Code | When |
| - | - | - |
| `404` | `AGENT_NOT_FOUND` | This workspace has no agent with that id. |
| `409` | `WORKFLOW_AGENT_INACTIVE` | The agent exists but is switched off. `PATCH /agents/{id}` with `{"is_active": true}`, then ask again. A copy made with [`POST /agents/{id}/duplicate`](https://docs.goyappr.com/api-reference/agents/duplicate) starts switched off, so this is the usual answer on a freshly duplicated agent. |
| `409` | `WORKFLOW_NOT_ENABLED` | The agent does not run a workflow. Mint the session with [`POST /calls`](https://docs.goyappr.com/api-reference/calls/create) `{"type": "web"}` instead. |
| `409` | `WORKFLOW_UNPUBLISHED` | The agent has no published version yet. [Publish](https://docs.goyappr.com/api-reference/workflows/publish.md) it first. |
| `400` | `BAD_REQUEST` | `type` is not `"web"` — a phone call is created with [`POST /calls`](https://docs.goyappr.com/api-reference/calls/create) — or `agent_id` is missing. |

Being switched off is reported before being unpublished, because switching it on
is the step you are missing: publishing an agent nobody can call would not make
the call happen.


## OpenAPI

````yaml POST /call-requests
openapi: 3.1.0
info:
  title: Yappr API
  description: >
    Create and manage AI voice agents, purchase phone numbers, configure tools,
    and initiate calls — all via REST.
  version: 1.0.0
  contact:
    url: https://goyappr.com
servers:
  - url: https://api.goyappr.com
    description: Production
security:
  - apiKey: []
paths:
  /call-requests:
    post:
      tags:
        - Calls
      summary: Create web call request
      description: >
        Requires calls:create. Creates a browser call on a workflow agent (with
        or without steps before it answers or follow-ups after the call), and
        returns the capability the browser needs to follow and start it. Nothing
        is dialled, no call record is created and no line is held: the caller's
        browser starts the call itself once the steps are done.


        Use this when an agent's mint answers `protocol: "call_request"`. An
        agent the mint answers `offer` for does not need it - POST /calls with
        `type: "web"` mints a session token and the browser sends one offer,
        exactly as before.


        The `start_capability` is returned once and stored only as a hash. It
        authorises this one request's read, cancel and start and nothing else,
        it dies with the request, and it is safe to hand to a browser: it cannot
        read another request, a phone request, or anything about the workspace.
      operationId: createWebCallRequest
      parameters:
        - in: header
          name: Idempotency-Key
          required: false
          schema:
            type: string
            maxLength: 200
          description: >
            Visible ASCII, space excluded. The same key with the same body
            answers 200 with the request as it is now and no start_capability
            (see the 200 response); with a different body it is a conflict.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - type
                - agent_id
              additionalProperties: false
              properties:
                type:
                  type: string
                  enum:
                    - web
                  description: A phone call is created with POST /calls.
                agent_id:
                  type: string
                  format: uuid
                variables:
                  type: object
                  description: >-
                    Values the workflow's request schema declares. Rendered into
                    the prompt and readable by before-call steps.
                metadata:
                  type: object
                  description: >-
                    Stored on the call record and echoed to tools. Reserved
                    platform key names are refused.
                workflow_revision_id:
                  type: string
                  format: uuid
                  description: >-
                    Pin a published version of this agent's workflow instead of
                    following the current one.
      responses:
        '200':
          description: >
            This Idempotency-Key already created a request (with the same body).
            The request as it is now - the CallRequest fields, `request_id`,
            `type`, `agent_id`, `accepted_at`, the three URLs and `replayed:
            true` - and no `start_capability`: the one that works was returned
            once, by the first create, and is stored only as a hash. A request
            that already failed reads `failed` with its `error_code` here, not
            `preparing`.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/CallRequest'
                  - type: object
                    required:
                      - request_id
                      - replayed
                      - status_url
                      - cancel_url
                      - start_url
                    properties:
                      request_id:
                        type: string
                        format: uuid
                      type:
                        type: string
                        enum:
                          - web
                      agent_id:
                        type:
                          - string
                          - 'null'
                        format: uuid
                      accepted_at:
                        type:
                          - string
                          - 'null'
                        format: date-time
                      replayed:
                        type: boolean
                        enum:
                          - true
                      status_url:
                        type: string
                        format: uri
                      cancel_url:
                        type: string
                        format: uri
                      start_url:
                        type: string
                        format: uri
        '202':
          description: Accepted. The steps have not run yet.
          content:
            application/json:
              schema:
                type: object
                required:
                  - request_id
                  - run_id
                  - channel
                  - status
                  - preparation_status
                  - expires_at
                  - start_capability
                  - status_url
                  - cancel_url
                  - start_url
                properties:
                  id:
                    type: string
                    format: uuid
                    description: Same value as request_id on this channel.
                  request_id:
                    type: string
                    format: uuid
                  run_id:
                    type: string
                    format: uuid
                  call_id:
                    type:
                      - string
                      - 'null'
                    description: >-
                      Always null here. A browser call has no call record until
                      it is started.
                  type:
                    type: string
                    enum:
                      - web
                  channel:
                    type: string
                    enum:
                      - web
                  status:
                    type: string
                    enum:
                      - preparing
                      - scheduled
                  preparation_status:
                    type: string
                    enum:
                      - pending
                  agent_id:
                    type: string
                    format: uuid
                  accepted_at:
                    type: string
                    format: date-time
                  expires_at:
                    type: string
                    format: date-time
                    description: >-
                      After this the request is abandoned and the capability
                      stops working.
                  start_capability:
                    type: string
                    description: >-
                      Returned once. Send it as the x-yappr-call-request-key
                      header on read, cancel and start.
                  status_url:
                    type: string
                    format: uri
                  cancel_url:
                    type: string
                    format: uri
                  start_url:
                    type: string
                    format: uri
        '400':
          description: >-
            INVALID_AGENT_ID, or a variables/metadata value that is not an
            object, or a body whose type is not "web".
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            MISSING_KEY, INVALID_KEY or EXPIRED_KEY - the key was not accepted.
            A valid key without the scope this operation needs is 403
            INSUFFICIENT_SCOPE, naming the scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: AGENT_NOT_FOUND - this workspace has no agent with that id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >
            WORKFLOW_AGENT_INACTIVE - the agent exists but is switched off;
            PATCH it with is_active true and ask again. A copy made with POST
            /agents/{id}/duplicate starts switched off, so this is the usual
            answer on a freshly duplicated agent. WORKFLOW_UNPUBLISHED - this
            agent's workflow has never been published. WORKFLOW_NOT_ENABLED -
            this agent does not run a workflow, so it has nothing to prepare;
            mint a browser session with POST /calls {"type":"web"} instead.
            WORKFLOW_IDEMPOTENCY_CONFLICT - this key was used with a different
            body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            WORKFLOW_REQUEST_INVALID or WORKFLOW_PIN_INVALID — the body or the
            pinned revision is not usable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: WORKFLOW_ADMISSION_UNAVAILABLE — temporary; retry the same request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CallRequest:
      type: object
      description: >
        Lifecycle record for one accepted call on a workflow agent. An outbound
        phone call returns its identity as `request_id` from POST /calls; a
        browser call is created directly with POST /call-requests. Either way
        this object is what you poll and what you cancel, and the two follow the
        same states.
      required:
        - id
        - run_id
        - channel
        - status
        - preparation_status
        - expires_at
      properties:
        id:
          type: string
          format: uuid
        run_id:
          type: string
          format: uuid
          description: Shared lifecycle identity. It does not grant access to call history.
        agent_id:
          type: string
          format: uuid
          description: >-
            The agent the request was made for. On GET /call-requests/{id}, the
            browser's poll and a replayed create.
        channel:
          type: string
          enum:
            - phone
            - web
          description: >
            `phone` is dialled by the platform once it is ready. `web` is
            started by the caller's own browser with POST
            /call-requests/{id}/start, because the microphone is there and not
            here.
        preparation_steps:
          type: array
          description: >
            On GET /call-requests/{id} (either channel) and the browser's poll.
            One entry per before-call step the workflow declares, in document
            order, whatever ran - so a waiting caller can be shown what is
            running, and a server can see which step failed and what its tool
            answered. Empty only between accepting the request and freezing the
            workflow version it runs. Step results are never included.
          items:
            type: object
            required:
              - id
              - label
              - status
            properties:
              id:
                type: string
              label:
                type: string
                description: The author's own name for the step.
              status:
                type: string
                enum:
                  - waiting
                  - inactive
                  - running
                  - pending
                  - unknown
                  - succeeded
                  - failed
                  - blocked
                  - skipped
                  - not_run
                  - cancelled
                description: >
                  waiting (not started yet); inactive (it runs only if an
                  earlier step's route chooses it, and none has yet); running
                  (sent, waiting for the answer); pending (its address accepted
                  the request without a final answer, such as an HTTP 202 -
                  settled as failed in a moment); unknown (the request may or
                  may not have reached its address - a timeout or a dropped
                  connection - settled as failed in a moment, never sent twice);
                  succeeded; failed; blocked (not sent, or its answer was not
                  usable); skipped (its condition said no, no route chose it, a
                  step it depends on was skipped, or an earlier step stopped the
                  preparation); or not_run - the preparation ended (failed,
                  cancelled or ran out of time) before this step ran; or
                  cancelled - the request was cancelled while this step was
                  running, and whatever it answered is not used. waiting,
                  inactive, running, pending and unknown are seen while the
                  request is preparing. A finished preparation reads succeeded,
                  failed, blocked, skipped, not_run and cancelled (an inactive
                  step it never reached reads not_run; a step a cancel overtook
                  reads cancelled, never running), except one that ended
                  preparation_interrupted: the step it was running keeps the
                  status it had.
              error_code:
                type: string
                description: >
                  Only on a step that did not succeed: what its tool answered,
                  in the platform's own codes - `downstream_http_error` (the
                  address answered an HTTP error; see `http_status`),
                  `http_timeout`, `http_network_error`, `url_resolves_private`,
                  `output_schema_invalid` and the like. Never the response
                  itself.
              http_status:
                type: integer
                description: >
                  Only on a step whose address answered: its HTTP status. A 4xx
                  other than 408 and 429 answers the same way on every retry
                  until the tool changes.
              refused_call:
                type: boolean
                description: >
                  true only on the step whose route refused the call (the
                  request reads failed with error_code before_declined). A step
                  refused on a failure keeps its error_code and http_status; one
                  refused on its answer reads succeeded. Absent on every other
                  step.
        status:
          type: string
          enum:
            - preparing
            - scheduled
            - ready
            - dispatching
            - dispatched
            - failed
            - expired
            - cancelled
            - dispatch_unknown
          description: >
            `scheduled` waits for the workspace's next calling window;
            `preparing` and `ready` cover pre-call work; `dispatching` and
            `dispatched` mean the call is being placed or has been placed;
            `dispatch_unknown` means placement is still being confirmed and must
            not be retried blindly; `failed`, `expired` and `cancelled` are
            final.
        preparation_status:
          type: string
          enum:
            - pending
            - running
            - ready
            - failed
            - expired
            - cancelled
            - declined
          description: >
            Progress of the pre-call step only. A preparation that fails or runs
            out of time does not always fail the request - an agent configured
            to continue with whatever is available still calls, with whatever
            the preparation produced. `declined` is a decision rather than a
            failure - a before-call step refused the call, so nothing is
            dialled, no call record is created, and the failure policy does not
            apply.
        workflow_revision_id:
          type:
            - string
            - 'null'
          format: uuid
          description: The published version of the agent frozen for this request.
        call_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Set once a call record exists. Pass it to the call-by-id endpoint.
        expires_at:
          type: string
          format: date-time
          description: >-
            After this moment a request that has not finished is abandoned and
            no call is placed. A request that already failed keeps status failed
            and its error_code.
        error_code:
          type:
            - string
            - 'null'
          description: >
            Present only when status is failed or expired. An expired request is
            always `request_expired`. On a failed one the preparation's own code
            wins wherever it recorded one - `step_failed` when a before-call
            step failed and its failure setting stops the call
            (`preparation_steps` names the step and what its tool answered),
            `before_declined` for a refusal, `preparation_interrupted` when the
            platform could not finish running the steps (a fault on its side,
            never a tool's answer; no step is sent twice - create a new
            request), `preparation_unavailable` when the steps could not be run
            at all, `promotion_stalled` when the agent's latest settings were
            still not ready 30 s after the request was due (retry shortly) - and
            where it recorded nothing the value is `before_declined` for a
            refusal and `request_failed` for anything else.
        execution:
          $ref: '#/components/schemas/CallExecution'
    Error:
      type: object
      required:
        - error
        - code
      description: >
        Every error response - the secret-key API and the browser data plane
        alike - carries a

        human-readable `error` and a stable machine `code`, and a refusal that
        names what is

        wrong with the request carries `issues[]` too. Branch on `code`, never
        on the `error`

        text. A refusal that names nothing more specific carries the code its
        status means:

        `BAD_REQUEST` (400), `UNAUTHORIZED` (401, the browser data plane; the
        secret-key API

        answers `MISSING_KEY`, `INVALID_KEY` or `EXPIRED_KEY`), `BILLING_ERROR`
        (402),

        `FORBIDDEN` (403), `NOT_FOUND` (404), `METHOD_NOT_ALLOWED` (405),
        `CONFLICT` (409),

        `GONE` (410), `PAYLOAD_TOO_LARGE` (413), `UNSUPPORTED_MEDIA_TYPE` (415),

        `UNPROCESSABLE_REQUEST` (422), `RATE_LIMIT` (429), `INTERNAL_ERROR`
        (500),

        `UPSTREAM_ERROR` (502), `SERVICE_UNAVAILABLE` (503), `UPSTREAM_TIMEOUT`
        (504). Some

        refusals add members of their own beside these (a call request's
        `status`, a workflow's

        `current_version`); the operation says which.
      properties:
        error:
          type: string
          description: The refusal, in one sentence for a person. Its wording may change.
        code:
          type: string
          description: The stable code to branch on.
        issues:
          type: array
          description: >
            Each thing at fault, on a 400 or 422 that names them: every query
            parameter or body field, not just the first. `path` is the
            parameter's name or the field's location.
          items:
            type: object
            required:
              - code
              - message
            properties:
              code:
                type: string
                description: >-
                  query_param_unknown, query_param_repeated, query_param_blank,
                  query_param_invalid, field_unknown, field_required,
                  field_invalid, or the route's own word.
              path:
                type: string
              message:
                type: string
    CallExecution:
      type: object
      additionalProperties: false
      description: >
        **Execution history — how the platform carried the call out**, beside
        the

        conversation itself. Returned on `GET /calls/{id}` and `GET
        /call-requests/{id}`

        when execution history is enabled for the workspace; absent otherwise.
        Ask for a

        page of it with the `execution_limit` and `execution_cursor` query
        parameters.


        This is an investigation view, not an authority: it is read-only, it is
        retained

        for a limited window, and it never carries the platform's own plumbing.


        **The members below are the whole of this block.** They are written down

        because the API projects onto exactly this list before the response is
        written:

        anything else the platform knows about a call — delivery row ids,
        internal job

        and journal counts, storage-retention flags, internal hostnames, its own

        diagnostic notes — is dropped rather than published, and every URL here
        is

        rewritten onto the public API base whatever the platform recorded. A
        field you

        do not see below will not appear, and a field you do see will not change
        shape.
      properties:
        version:
          type: string
          const: execution-visibility-v1
        audience:
          type: string
          const: company
          description: >-
            Whose view this is. A company-authorized read is the only one this
            API returns.
        subject:
          type: string
          enum:
            - call
            - tool_test
        run_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Shared lifecycle identity of the request and the call it became.
        request_id:
          type:
            - string
            - 'null'
          format: uuid
        call_id:
          type:
            - string
            - 'null'
          format: uuid
        tool_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Tool tests only.
        test_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Tool tests only.
        workflow_revision_id:
          type:
            - string
            - 'null'
          format: uuid
          description: The published version of the agent this run was frozen on.
        strict:
          type:
            - boolean
            - 'null'
          description: Whether the run was admitted under the agent's strict setting.
        owner:
          type: string
          enum:
            - workflow
            - legacy
          description: >-
            Which authoring model owns the run - `workflow` for a workflow
            agent; `legacy` for a call of an agent that runs no workflow (a
            prompt agent, and every call from before workflows), whose history
            is what the call itself recorded (history.coverage
            legacy_best_effort). Such a call reads execution_status included,
            not none.
        channel:
          type:
            - string
            - 'null'
          enum:
            - phone
            - web
            - null
        direction:
          type:
            - string
            - 'null'
          enum:
            - inbound
            - outbound
            - web
            - null
        refresh_after_ms:
          type:
            - integer
            - 'null'
          description: >-
            How long to wait before asking again while work is still running. On
            GET /calls/{id}, null once the call has settled (summary.is_settled
            true): nothing on it will change.
        supplementary:
          type: string
          enum:
            - complete
            - partial
            - not_loaded
          description: >-
            Whether the conversation-side records beside this block were loaded
            for this response.
        supplementary_errors:
          type: array
          description: >-
            Reason codes for anything the read beside this block could not load.
            Empty when `supplementary` is `complete`.
          items:
            type: string
        links:
          type: object
          additionalProperties: false
          description: >
            Public API URLs for the related records, and the only three link
            members there are. Each one is rewritten onto this API's own base
            before it is published.
          properties:
            request:
              type: string
              format: uri
            call_detail:
              type: string
              format: uri
            tool_test:
              type: string
              format: uri
        summary:
          type: object
          additionalProperties: false
          description: Where the call got to, rolled up.
          properties:
            revision:
              type: string
              description: >-
                Monotonic revision of this snapshot, as a string so a large
                value survives JavaScript.
            as_of:
              type: string
              format: date-time
            run_status:
              type:
                - string
                - 'null'
              enum:
                - accepted
                - materialized
                - cancelled
                - failed
                - completed
                - null
              description: >
                Where the call's run is. `materialized` while its window is open
                - a call's follow-ups can still start until the window closes,
                which is hours after the call is accepted - and `completed` once
                the window has closed and every phase of the run, its post-call
                jobs and its call attempts have ended. A follow-up that failed
                does not make the run `failed`: read that on the follow-up's own
                row. `failed` and `cancelled` mean the call was refused,
                abandoned or cancelled before it ran.
            call_state:
              type: string
            physical_end_observed:
              type:
                - boolean
                - 'null'
              description: >-
                Whether the carrier confirmed the line was down, rather than the
                platform inferring it.
            follow_up_state:
              type: string
              enum:
                - not_started
                - running
                - succeeded
                - failed
                - unknown
                - cancelled
                - unavailable
              description: >-
                On GET /calls/{id}, one word for the call's follow_ups member
                and its trigger timeline rows together: failed, running,
                not_started (follow_ups waiting), cancelled (follow_ups
                skipped), unknown, succeeded - the first that fits. unavailable
                when nothing ran and nothing is explained, and on a call request
                (read the call).
            settlement:
              type: string
              enum:
                - unsettled
                - settled
                - unavailable
            is_settled:
              type:
                - boolean
                - 'null'
              description: >
                On GET /calls/{id}, true (with settlement `settled`) once the
                call has ended, its analysis and cost are final, and nothing of
                its own is still running, waiting or due; a browser session that
                ended before anyone connected reads the same. Stop polling then.
                Null while that cannot be said yet.
            settlement_reasons:
              type: array
              description: Reason codes for an unsettled call.
              items:
                type: string
            counts:
              type: object
              additionalProperties: false
              description: >
                Counts by phase and then by status, for the customer's own work
                only - `invocations` (steps the agent ran) and `attempts` (tries
                those took). Internal platform job and journal counts are not
                included. Phase and status keys are lowercase identifiers and
                the values are whole numbers; a bucket holding no counts is
                omitted rather than sent empty.
              properties:
                invocations:
                  type: object
                  propertyNames:
                    pattern: ^[a-z][a-z_]{0,39}$
                  additionalProperties:
                    type: object
                    propertyNames:
                      pattern: ^[a-z][a-z_]{0,39}$
                    additionalProperties:
                      type: integer
                attempts:
                  type: object
                  propertyNames:
                    pattern: ^[a-z][a-z_]{0,39}$
                  additionalProperties:
                    type: object
                    propertyNames:
                      pattern: ^[a-z][a-z_]{0,39}$
                    additionalProperties:
                      type: integer
            active_work:
              type: array
              description: Work still running or waiting at the moment of this snapshot.
              items:
                type: object
                additionalProperties: false
                properties:
                  id:
                    type: string
                    format: uuid
                  phase:
                    type: string
                    enum:
                      - before
                      - during
                      - after
                      - platform
                  kind:
                    type: string
                  status:
                    type: string
                  reason_code:
                    type:
                      - string
                      - 'null'
                  deadline_at:
                    type:
                      - string
                      - 'null'
                    format: date-time
            active_work_truncated:
              type: boolean
              description: True when more work was running than this list shows.
            latest_problem:
              type:
                - object
                - 'null'
              additionalProperties: false
              description: >-
                The most recent piece of work that failed or was blocked, in the
                same shape as active_work.
              properties:
                id:
                  type: string
                  format: uuid
                phase:
                  type: string
                  enum:
                    - before
                    - during
                    - after
                    - platform
                kind:
                  type: string
                status:
                  type: string
                reason_code:
                  type:
                    - string
                    - 'null'
                deadline_at:
                  type:
                    - string
                    - 'null'
                  format: date-time
            next_deadline_at:
              type:
                - string
                - 'null'
              format: date-time
            artifacts:
              type: array
              description: >-
                Readiness of each thing the call produces - recording,
                transcript, analysis, lead, billing.
              items:
                type: object
                additionalProperties: false
                properties:
                  artifact:
                    type: string
                    enum:
                      - recording
                      - transcript
                      - analysis
                      - lead
                      - billing
                  status:
                    type: string
                    enum:
                      - pending
                      - running
                      - succeeded
                      - empty
                      - skipped
                      - failed
                      - not_expected
                      - unavailable
                  version:
                    type: integer
                  output_revision:
                    type: integer
                  attempts:
                    type: integer
                  deadline_at:
                    type:
                      - string
                      - 'null'
                    format: date-time
                  reason_code:
                    type:
                      - string
                      - 'null'
                    description: >
                      Why the artifact is not `succeeded`. On `GET /calls/{id}`
                      the `analysis` entry agrees with the call's `analysis`
                      member: a pass that left no summary reads `failed` /
                      `no_summary` here too. A `lead` entry that reads `skipped`
                      names why: `web_call_no_phone` (a browser rehearsal has no
                      caller's number), `transcript_too_short` (fewer than two
                      turns) or `no_phone_number`.
        history:
          type: object
          additionalProperties: false
          description: The page of history you were given, and how to get the next one.
          properties:
            high_water_mark:
              type: string
              description: Furthest journal position this snapshot covers, as a string.
            retained_from_sequence:
              type: string
              description: Earliest position still retained, as a string.
            coverage:
              type: string
              enum:
                - canonical
                - legacy_best_effort
            coverage_started_at:
              type:
                - string
                - 'null'
              format: date-time
            complete:
              type: boolean
              description: >-
                True when this page is the whole history: on GET /calls/{id}, a
                settled call with no next_url and nothing expired.
            gaps:
              type: array
              description: >-
                Why this page may not be the whole history. Empty when complete
                is true.
              items:
                type: string
            retained_until:
              type:
                - string
                - 'null'
              format: date-time
            filters:
              type: object
              additionalProperties: false
              description: The filters this page was read under, echoed back.
              properties:
                phase:
                  type:
                    - string
                    - 'null'
                  enum:
                    - before
                    - during
                    - after
                    - platform
                    - null
                kind:
                  type:
                    - string
                    - 'null'
                status:
                  type:
                    - string
                    - 'null'
            limit:
              type: integer
            next_url:
              type:
                - string
                - 'null'
              format: uri
              description: Next page, on the public API base. Null on the last page.
            refresh_url:
              type: string
              format: uri
              description: This same page again, on the public API base.
        items:
          type: array
          description: >
            The time-ordered rows themselves - one per step, attempt, phase
            boundary or platform event the call produced. `sequence` is a string
            so a large journal position survives JavaScript. `input` and
            `output` are bounded, redacted previews of the customer's own
            evidence, never raw credentials.
          items:
            type: object
            additionalProperties: false
            properties:
              id:
                type: string
                format: uuid
              sequence:
                type: string
                description: >-
                  Journal position, as a string so a large value survives
                  JavaScript.
              phase:
                type: string
                enum:
                  - before
                  - during
                  - after
                  - platform
              kind:
                type: string
              event:
                type: string
              status:
                type:
                  - string
                  - 'null'
              call_id:
                type:
                  - string
                  - 'null'
                format: uuid
              request_id:
                type:
                  - string
                  - 'null'
                format: uuid
              phase_id:
                type:
                  - string
                  - 'null'
                format: uuid
              invocation_id:
                type:
                  - string
                  - 'null'
                format: uuid
              attempt_id:
                type:
                  - string
                  - 'null'
                format: uuid
              receipt_id:
                type:
                  - string
                  - 'null'
                format: uuid
              attempt_number:
                type:
                  - integer
                  - 'null'
              outer_run:
                type:
                  - integer
                  - 'null'
              inner_attempt:
                type:
                  - integer
                  - 'null'
              reason_code:
                type:
                  - string
                  - 'null'
              late:
                type: boolean
                description: >-
                  True when the row arrived after the page it belongs to was
                  already read.
              selected:
                type:
                  - boolean
                  - 'null'
              should_execute:
                type:
                  - boolean
                  - 'null'
              edges_truncated:
                type: boolean
              action:
                type:
                  - object
                  - 'null'
                additionalProperties: false
                description: The step this row is about, where it is one.
                properties:
                  name:
                    type: string
                  type:
                    type: string
                    enum:
                      - http
                      - app
                      - sequence
                      - end_call
                      - transfer
                      - platform
                  binding_id:
                    type:
                      - string
                      - 'null'
                    format: uuid
                  activation:
                    type:
                      - string
                      - 'null'
                  tool_id:
                    type:
                      - string
                      - 'null'
                    format: uuid
                  tool_revision_id:
                    type:
                      - string
                      - 'null'
                    format: uuid
                  schema_version:
                    type:
                      - string
                      - 'null'
                  adapter_version:
                    type:
                      - string
                      - 'null'
                  compatibility_version:
                    type:
                      - string
                      - 'null'
                  connection_id:
                    type:
                      - string
                      - 'null'
                    format: uuid
                  connection_label:
                    type:
                      - string
                      - 'null'
                  connection_generation:
                    type:
                      - integer
                      - 'null'
              field_errors:
                type: array
                description: Validation failures, by path into the step's own input.
                items:
                  type: object
                  additionalProperties: false
                  properties:
                    path:
                      type: string
                    code:
                      type: string
              edges:
                type: array
                description: >
                  Links to other rows of this same block. Only edges pointing at
                  something you can read here are included - an invocation, a
                  phase, or an artifact.
                items:
                  type: object
                  additionalProperties: false
                  properties:
                    relation:
                      type: string
                      enum:
                        - parent
                        - depends_on
                        - triggered_by
                        - replay_of
                        - receipt_for
                    kind:
                      type: string
                      enum:
                        - invocation
                        - phase
                        - artifact
                    id:
                      type: string
                      format: uuid
              timing:
                type: object
                additionalProperties: false
                properties:
                  occurred_at:
                    type:
                      - string
                      - 'null'
                    format: date-time
                  recorded_at:
                    type: string
                    format: date-time
                  queued_at:
                    type:
                      - string
                      - 'null'
                    format: date-time
                  claimed_at:
                    type:
                      - string
                      - 'null'
                    format: date-time
                  dispatched_at:
                    type:
                      - string
                      - 'null'
                    format: date-time
                    description: When the request actually left, never a claim timestamp.
                  completed_at:
                    type:
                      - string
                      - 'null'
                    format: date-time
                  queue_ms:
                    type:
                      - integer
                      - 'null'
                  validation_ms:
                    type:
                      - integer
                      - 'null'
                  network_ms:
                    type:
                      - integer
                      - 'null'
                  total_ms:
                    type:
                      - integer
                      - 'null'
                  audio_offset_ms:
                    type:
                      - integer
                      - 'null'
                    description: Where in the recording this happened, where that is known.
                  audio_clock_id:
                    type:
                      - string
                      - 'null'
              retry:
                type: object
                additionalProperties: false
                properties:
                  eligibility:
                    type: string
                    enum:
                      - not_eligible
                      - automatic
                      - manual
                      - unknown
                  reason_code:
                    type:
                      - string
                      - 'null'
                  next_at:
                    type:
                      - string
                      - 'null'
                    format: date-time
                  automatic_recovery_stopped:
                    type: boolean
              input:
                type: object
                additionalProperties: false
                description: Bounded, redacted preview of what went into the step.
                properties:
                  value:
                    description: >-
                      The preview itself - any JSON, exactly as the platform
                      recorded it, or null when there is none.
                  availability:
                    type: string
                    enum:
                      - available
                      - not_applicable
                      - unavailable
                  unavailable_reason:
                    type:
                      - string
                      - 'null'
                  redacted:
                    type: boolean
                  truncated:
                    type: boolean
                  omitted:
                    type: array
                    description: What was left out of the preview, and why.
                    items:
                      type: object
                      additionalProperties: false
                      properties:
                        path:
                          type: string
                        reason:
                          type: string
                          enum:
                            - configured_sensitive
                            - credential
                            - private_reference
                            - diagnostic
                            - secret_value
                            - url
                            - depth_limit
                            - byte_limit
                            - node_limit
                            - item_limit
                            - string_limit
                            - unavailable
                  omitted_metadata_truncated:
                    type: boolean
                  expanded:
                    type: boolean
              output:
                type: object
                additionalProperties: false
                description: Bounded, redacted preview of what the step returned.
                properties:
                  value:
                    description: >-
                      The preview itself - any JSON, exactly as the platform
                      recorded it, or null when there is none.
                  availability:
                    type: string
                    enum:
                      - available
                      - not_applicable
                      - unavailable
                  unavailable_reason:
                    type:
                      - string
                      - 'null'
                  redacted:
                    type: boolean
                  truncated:
                    type: boolean
                  omitted:
                    type: array
                    description: What was left out of the preview, and why.
                    items:
                      type: object
                      additionalProperties: false
                      properties:
                        path:
                          type: string
                        reason:
                          type: string
                          enum:
                            - configured_sensitive
                            - credential
                            - private_reference
                            - diagnostic
                            - secret_value
                            - url
                            - depth_limit
                            - byte_limit
                            - node_limit
                            - item_limit
                            - string_limit
                            - unavailable
                  omitted_metadata_truncated:
                    type: boolean
                  expanded:
                    type: boolean
              expansion_url:
                type:
                  - string
                  - 'null'
                format: uri
                description: >-
                  This row on its own, with fuller previews. On the public API
                  base.
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Your Yappr API key (e.g. `ypr_live_...`). Generate one in the dashboard
        under **Settings → API Keys**. No key is `401 MISSING_KEY`; a key that
        is not one of ours, or is revoked, is `401 INVALID_KEY`; an expired one
        is `401 EXPIRED_KEY`. A valid key without the scope an operation needs
        is `403 INSUFFICIENT_SCOPE` on every operation, and the message names
        the scope. Every response, a 401 included, carries X-RateLimit-Limit,
        X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a
        minute per API key. Every 429, whatever its code, carries Retry-After
        (whole seconds, never zero): the per-key budget's `RATE_LIMIT` asks for
        what is left of the minute, a route's daily cap (`RATE_LIMITED`) for the
        time until that cap resets. All four headers are listed in
        Access-Control-Expose-Headers, so a browser can read them. A path the
        API does not serve (an unknown sub-path, an id left empty) is `404
        ROUTE_NOT_FOUND`, and a method a served path does not take is `405
        METHOD_NOT_ALLOWED` with an `Allow` header; both are answered before any
        scope check, and nothing is read or changed. A trailing slash is ignored
        where it cannot be an id left empty (`POST /calls/` is `POST /calls`)
        and refused where it can (`GET /calls/`). A doubled slash inside a path
        is merged into one before the request reaches the API (`GET //calls` is
        `GET /calls`).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.