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

# Give an agent a connected app

> Requires agents:update. Gives the agent a connected account: its default actions (or the ones named in actions) are made ready, bound once each and offered on every conversation step. The draft is saved, and published in the same request when the draft had no other unpublished change and publish is not false; otherwise live is false and not_live_reason says why (draft_has_other_changes, agent_not_published, publish_not_requested, publish_refused with the compiler's issues, publish_unavailable, or inputs_missing - a required configuration ID with no default, such as a spreadsheet, is never guessed: the action names it in missing_inputs and the write is not published until you set it) and the draft keeps the change - publish with POST /agents/{id}/workflow/publish; when live is true the answer carries settings_updated_at, the agent's new settings token. A default action the app cannot offer to a voice agent is left out and named in skipped_actions with why; one named in actions is refused. When the actions are still being prepared after about twelve seconds, or the app's default actions are not chosen yet because its action list is still being read (an app outside the curated list, the first time), the answer is 503 WORKFLOW_TOOL_CONTROL_UNAVAILABLE with Retry-After and nothing is saved: send the same request again. An API key that makes an app's actions ready for the first time also needs tools:create (tools:update to rebuild them).
Action inputs: an item of actions may be {"action": slug, "inputs": {"<input>": source}} to set how some of its inputs are filled - Fixed (literal), AI (model), Choose from a list (model with options) or from the call (request, stored, step); see ActionInputSource. Inputs you leave out take the catalogue's default (GET /tool-connections/{id}/actions, inputs[].default_source): a calendar is Fixed to the main one, everything the conversation fills is AI. A Fixed or from-the-call input is never asked of the agent.
A saved webhook or call transfer is given to every step with {"tool_id": ..., "inputs": {...}} instead of connection_id (entry id tg_..., its binding t_...); a call transfer needs the phone channel. This is the default place for a call transfer, as it is in the dashboard (Tools & integrations, and the canvas section "Available to every conversation step"); bind one to chosen steps in the workflow only when those steps need it alone, such as a different destination on each. A transfer runs on phone calls only: on a browser call the agent's call to it is refused with error_code unsupported_transfer_channel, and the agent is told to say that transfers work on phone calls. Ids of the shapes i_..., tg_... and t_... (and o_... for a step's own settings) are kept for these entries: do not use them for bindings of your own.


Requires `agents:update`. Gives the agent a connected account, by its id from [`GET /tool-connections`](https://docs.goyappr.com/api-reference/tool-connections/list). The agent can use the app's default actions on every step of its calls, at once — no tool to build, no step to wire.

```bash theme={null}
curl -X POST https://api.goyappr.com/agents/AGENT_ID/integrations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"connection_id": "0b8f4c2e-5a1d-4e6b-9c3f-7d2a1e9b4c60"}'
```

| Field | Type | |
| - | - | - |
| `connection_id` | uuid | A ready connected account. Send this or `tool_id`. |
| `actions` | `"default"` or list | Optional. The app's defaults when left out, or 1-24 actions from [`GET /tool-connections/{id}/actions`](https://docs.goyappr.com/api-reference/tool-connections/actions), each a slug or `{"action": slug, "inputs": {...}}` (see below). |
| `tool_id` | uuid | A saved webhook or call transfer to give every step, instead of `connection_id` (see below). |
| `inputs` | object | With `tool_id` only: that tool's inputs, by name. |
| `publish` | boolean | Optional, default `true`. Publish the agent when its draft had no other unpublished change. |
| `expected_version` | integer | Optional. The draft version you read; another one is `409 WORKFLOW_CONFLICT`. |
| `replace_action_tools` | boolean | Optional. Replace this agent's separate tools for the account with the whole integration (see `separate_action_tools` on the list). |

The answer is `201`:

```json theme={null}
{
  "integration": { "id": "i_0b8f4c2e", "app": "googlecalendar", "app_name": "Google Calendar", "status": "live", "...": "..." },
  "skipped_actions": [],
  "draft_version": 13,
  "live": true,
  "settings_updated_at": "2026-10-22T07:14:03.120451+00:00"
}
```

When `live` is `true`, `settings_updated_at` is the agent's new settings token (publishing moves it, as [publish](https://docs.goyappr.com/api-reference/workflows/publish.md) does): send it as `expected_updated_at` on your next [`PATCH /agents/{id}`](https://docs.goyappr.com/api-reference/agents/update).

When `live` is `false`, `not_live_reason` says why and the change is saved in the draft:

| `not_live_reason` | What to do |
| - | - |
| `draft_has_other_changes` | The draft held other unpublished changes, so nothing was published for you. Publish when ready. |
| `inputs_missing` | An action needs a configuration ID that has no default (a spreadsheet, a channel, a board), so the agent would have to guess it. The integration is saved, its action lists the input in `missing_inputs`, and `issues` gives the PATCH that sets it. Nothing is published until it is set. |
| `agent_not_published` | The agent has never been published. Publish it. |
| `publish_not_requested` | You sent `publish: false`. |
| `publish_refused` | The publish was refused; `issues` names each problem as [publish](https://docs.goyappr.com/api-reference/workflows/publish.md) does. |
| `publish_unavailable` | Publishing was unavailable; publish again. |

The first time an app is used, its actions are prepared, which can take a few seconds. If they are still being prepared after about twelve seconds (a large app's catalogue can be slow the first time), the answer is `503 WORKFLOW_TOOL_CONTROL_UNAVAILABLE` with `Retry-After`, and nothing is saved: send the same request again. The same happens, the first time, for an app outside the curated list while its action list is still being read: its default actions are chosen over the whole list ([`GET /tool-connections/{id}/actions`](https://docs.goyappr.com/api-reference/tool-connections/actions) says `defaults_final: false` until then). A default action is never left out because it was slow to read. [`POST /tool-connections/{id}/actions/prepare`](https://docs.goyappr.com/api-reference/tool-connections/prepare-actions) prepares them ahead of time.

Which actions are default: a curated set for the most used apps (Google Calendar: find free time, list events, book, change and cancel an event; Gmail: send an email and draft an email — never reading the mailbox), and for every other app the provider's important actions without destructive or administrative ones, reads first, at most 12. A default the app cannot offer to a voice agent is left out and named in `skipped_actions`, each with `action`, `reason` (`not_eligible`, `needs_setup`, `action_version_deprecated`, `changed_meanwhile`: send the request again, `account_unavailable`: reconnect the account, `action_unknown`, `build_failed`: try again in a minute, or a failed build's own lowercase code) and a plain-language `message`; an action you name that it cannot offer is refused with `422 INTEGRATION_ACTION_UNAVAILABLE`, each named in `issues` at `/actions/<n>`.

Limits: 8 integrations and 64 integration actions per agent, 24 actions per integration.

An API key preparing an app's actions for the first time also needs `tools:create` (`tools:update` to rebuild them after a reconnect); otherwise `403 WORKFLOW_ACTOR_DENIED`.

Other refusals: `404 TOOL_CONNECTION_NOT_FOUND`, `409 INTEGRATION_ALREADY_ASSIGNED` (change its actions with [PATCH](https://docs.goyappr.com/api-reference/agents/integrations-update.md)), `422 TOOL_CONNECTION_NOT_READY` (reconnect the account), `422 AGENT_ENGINE_UNSUPPORTED`, `422 INTEGRATION_LIMIT`, `403 WORKFLOW_ENVIRONMENT_MISMATCH` (the account belongs to another plane).

## Set how each input is filled

Every input of an action has a source: **Fixed** (`{"kind": "literal", "value": …}`, never shown to the agent), **from the call** (`request`, `stored` or `step`), **AI** (`{"kind": "model", "path": "/<input>"}`, the agent fills it from the conversation) or **Choose from a list** (a model source with `options`, the agent picks one by its label). Inputs you leave out take the catalogue's default from [`GET /tool-connections/{id}/actions`](https://docs.goyappr.com/api-reference/tool-connections/actions) (`inputs[].default_source`): a calendar is Fixed to the account's main calendar, and what the conversation fills is AI.

Book on the clinic's calendar and let the agent pick the times:

```bash theme={null}
curl -X POST https://api.goyappr.com/agents/AGENT_ID/integrations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"connection_id": "0b8f4c2e-5a1d-4e6b-9c3f-7d2a1e9b4c60",
       "actions": [
         {"action": "GOOGLECALENDAR_FIND_FREE_SLOTS", "inputs": {"items": {"kind": "literal", "value": ["c_1a2b3c@group.calendar.google.com"]}}},
         {"action": "GOOGLECALENDAR_CREATE_EVENT", "inputs": {"calendar_id": {"kind": "literal", "value": "c_1a2b3c@group.calendar.google.com"}}}
       ]}'
```

Pick the calendar ids from [`GET /tool-connections/{id}/options/calendars`](https://docs.goyappr.com/api-reference/tool-connections/options). Each action in the answer carries `binding_id`, `inputs` (its sources now), `input_specs` and `bindable`. A bad source is `422 INPUT_SOURCE_INVALID`, each one named in `issues` by path (`/actions/0/inputs/items`). Change sources later with [PATCH](https://docs.goyappr.com/api-reference/agents/integrations-update.md) and `inputs`.

## A webhook or call transfer on every step

Send `tool_id` (a saved HTTP or transfer tool from [`GET /tools`](https://docs.goyappr.com/api-reference/tools/list)) instead of `connection_id` to give it to every conversation step, like an app:

```bash theme={null}
curl -X POST https://api.goyappr.com/agents/AGENT_ID/integrations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tool_id": "5c1e9a20-3b4d-4e5f-8a6b-7c8d9e0f1a2b", "inputs": {"phone": {"kind": "literal", "value": "{{call.caller_number}}"}}}'
```

A call transfer belongs here by default: the dashboard gives one to every conversation step too (the agent's Tools & integrations, and on the canvas the section "Available to every conversation step"), the way it does an app. Send just its id:

```bash theme={null}
curl -X POST https://api.goyappr.com/agents/AGENT_ID/integrations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tool_id": "7d2a1e9b-4c60-4b8f-9c3f-0b8f4c2e5a1d"}'
```

Bind a transfer to chosen steps in the workflow (a step's `available_binding_ids`, or an `action` step of its own when its success and its failure each need a path) only when those steps need it alone, for example a different destination on each.

A transfer runs on phone calls only. On a browser call (the dashboard's test, a shared link, the Web SDK) nothing is dialled: the agent's call to it is answered `error_code: "unsupported_transfer_channel"`, and the agent is told to say in one sentence that transfers work on phone calls. [`GET /calls/{id}`](https://docs.goyappr.com/api-reference/calls/get) shows that answer in the call's tool calls, as `agent_was_told`. Test a transfer with a phone call.

The answer's `integration` is `{"id": "tg_5c1e9a20", "kind": "webhook", "tool_id": …, "name": …, "binding_id": "t_5c1e9a20", "inputs": {…}, "overrides": [], "status": "live"}`. Inputs you leave out are filled by the agent. Refusals: `404 TOOL_NOT_FOUND`, `409 INTEGRATION_ALREADY_ASSIGNED`, `422 TOOL_GRANT_KIND` (not a webhook or transfer), `422 TOOL_GRANT_CHANNEL` (a transfer on an agent without phone calls), `422 INTEGRATION_LIMIT` (8 per agent).

> [!NOTE]
>
> Tell the agent in its instructions which sheet, board or channel to use for Google Sheets, monday.com and Slack.


## OpenAPI

````yaml POST /agents/{id}/integrations
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:
  /agents/{id}/integrations:
    post:
      tags:
        - Agents
      summary: Give an agent a connected app
      description: >
        Requires agents:update. Gives the agent a connected account: its default
        actions (or the ones named in actions) are made ready, bound once each
        and offered on every conversation step. The draft is saved, and
        published in the same request when the draft had no other unpublished
        change and publish is not false; otherwise live is false and
        not_live_reason says why (draft_has_other_changes, agent_not_published,
        publish_not_requested, publish_refused with the compiler's issues,
        publish_unavailable, or inputs_missing - a required configuration ID
        with no default, such as a spreadsheet, is never guessed: the action
        names it in missing_inputs and the write is not published until you set
        it) and the draft keeps the change - publish with POST
        /agents/{id}/workflow/publish; when live is true the answer carries
        settings_updated_at, the agent's new settings token. A default action
        the app cannot offer to a voice agent is left out and named in
        skipped_actions with why; one named in actions is refused. When the
        actions are still being prepared after about twelve seconds, or the
        app's default actions are not chosen yet because its action list is
        still being read (an app outside the curated list, the first time), the
        answer is 503 WORKFLOW_TOOL_CONTROL_UNAVAILABLE with Retry-After and
        nothing is saved: send the same request again. An API key that makes an
        app's actions ready for the first time also needs tools:create
        (tools:update to rebuild them).

        Action inputs: an item of actions may be {"action": slug, "inputs":
        {"<input>": source}} to set how some of its inputs are filled - Fixed
        (literal), AI (model), Choose from a list (model with options) or from
        the call (request, stored, step); see ActionInputSource. Inputs you
        leave out take the catalogue's default (GET
        /tool-connections/{id}/actions, inputs[].default_source): a calendar is
        Fixed to the main one, everything the conversation fills is AI. A Fixed
        or from-the-call input is never asked of the agent.

        A saved webhook or call transfer is given to every step with {"tool_id":
        ..., "inputs": {...}} instead of connection_id (entry id tg_..., its
        binding t_...); a call transfer needs the phone channel. This is the
        default place for a call transfer, as it is in the dashboard (Tools &
        integrations, and the canvas section "Available to every conversation
        step"); bind one to chosen steps in the workflow only when those steps
        need it alone, such as a different destination on each. A transfer runs
        on phone calls only: on a browser call the agent's call to it is refused
        with error_code unsupported_transfer_channel, and the agent is told to
        say that transfers work on phone calls. Ids of the shapes i_..., tg_...
        and t_... (and o_... for a step's own settings) are kept for these
        entries: do not use them for bindings of your own.
      operationId: addAgentIntegration
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                connection_id:
                  type: string
                  format: uuid
                  description: >-
                    The connected account, as GET /tool-connections lists it. It
                    must be ready. Send this or tool_id.
                tool_id:
                  type: string
                  format: uuid
                  description: >-
                    A saved webhook or call transfer (GET /tools) to give every
                    step. Send this or connection_id; with it, only inputs,
                    publish and expected_version are read.
                inputs:
                  type: object
                  description: >-
                    With tool_id only: the tool's inputs, by name. Inputs left
                    out are filled by the agent (AI).
                  additionalProperties:
                    $ref: '#/components/schemas/ActionInputSource'
                actions:
                  description: >-
                    "default" (or left out) for the app's default actions, or
                    1-24 distinct actions from GET
                    /tool-connections/{id}/actions, each a slug or {"action":
                    slug, "inputs": {"<input>": source or null}}.
                  oneOf:
                    - type: string
                      const: default
                    - type: array
                      minItems: 1
                      maxItems: 24
                      items:
                        oneOf:
                          - type: string
                            pattern: ^[A-Z0-9_]{1,200}$
                          - type: object
                            additionalProperties: false
                            required:
                              - action
                            properties:
                              action:
                                type: string
                                pattern: ^[A-Z0-9_]{1,200}$
                              inputs:
                                type: object
                                additionalProperties:
                                  oneOf:
                                    - $ref: '#/components/schemas/ActionInputSource'
                                    - type: 'null'
                publish:
                  type: boolean
                  default: true
                  description: >-
                    Publish the agent when its draft had no other unpublished
                    change.
                expected_version:
                  type: integer
                  minimum: 1
                  description: >-
                    The draft version you read; a different one is 409
                    WORKFLOW_CONFLICT.
                replace_action_tools:
                  type: boolean
                  default: false
                  description: >-
                    Replace the agent's separate tools for this account (see
                    separate_action_tools) with the whole integration. Their
                    actions join the default set.
            examples:
              defaults:
                value:
                  connection_id: 0b8f4c2e-5a1d-4e6b-9c3f-7d2a1e9b4c60
              calendarFixed:
                summary: Find free time on one calendar; the agent fills the times
                value:
                  connection_id: 0b8f4c2e-5a1d-4e6b-9c3f-7d2a1e9b4c60
                  actions:
                    - action: GOOGLECALENDAR_FIND_FREE_SLOTS
                      inputs:
                        items:
                          kind: literal
                          value:
                            - c_1a2b3c@group.calendar.google.com
              webhook:
                summary: A saved webhook on every step
                value:
                  tool_id: 5c1e9a20-3b4d-4e5f-8a6b-7c8d9e0f1a2b
                  inputs:
                    phone:
                      kind: literal
                      value: '{{call.caller_number}}'
              transfer:
                summary: >-
                  A saved call transfer on every conversation step (the default
                  place for one)
                value:
                  tool_id: 7d2a1e9b-4c60-4b8f-9c3f-0b8f4c2e5a1d
      responses:
        '201':
          description: >-
            The integration (or the webhook or call transfer) was added to the
            draft, and live says whether it is on calls now.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/IntegrationWriteResult'
                  - $ref: '#/components/schemas/ToolGrantWriteResult'
        '400':
          description: >-
            AGENT_INTEGRATION_REQUEST_INVALID: the body is not JSON, holds a
            field this request does not read (inputs at the top level with
            connection_id, or connection_id, actions or replace_action_tools
            with tool_id), or publish, replace_action_tools or expected_version
            has the wrong type. Each field is named in issues.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            INSUFFICIENT_SCOPE (agents:update), WORKFLOW_ACTOR_DENIED (the key
            may not build an app's actions: add tools:create), or
            WORKFLOW_ENVIRONMENT_MISMATCH (the account is connected on another
            plane).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            AGENT_NOT_FOUND, TOOL_CONNECTION_NOT_FOUND or TOOL_NOT_FOUND (no
            saved tool with tool_id).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            INTEGRATION_ALREADY_ASSIGNED: the account (or the webhook or
            transfer) is already given to this agent; change it with PATCH.
            WORKFLOW_CONFLICT: expected_version is not the draft version
            (current_version names it).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            AGENT_ENGINE_UNSUPPORTED, TOOL_CONNECTION_NOT_READY (reconnect the
            account), INTEGRATION_ACTION_UNKNOWN or
            INTEGRATION_ACTION_UNAVAILABLE (each action named in issues at
            /actions/<n>), INPUT_SOURCE_INVALID (an input the action does not
            take, a source kind not allowed here, a malformed fixed value or
            list; each named in issues by path, such as
            /actions/0/inputs/items), INTEGRATION_LIMIT (at most 8 integrations
            and 64 integration actions per agent, and 8 webhooks and call
            transfers on every step), TOOL_GRANT_KIND (tool_id is not a webhook
            or a call transfer), TOOL_GRANT_CHANNEL (a call transfer on an agent
            without phone calls), INTEGRATION_SWITCH_UNAVAILABLE
            (replace_action_tools with nothing replaceable),
            WORKFLOW_DOCUMENT_INVALID (the agent has no draft).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: >-
            WORKFLOW_TOOL_CONTROL_UNAVAILABLE: the actions are still being
            prepared (Retry-After) or the action service is away. Nothing was
            saved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ActionInputSource:
      type: object
      description: >
        Where an action input's value comes from - the workflow's own input
        sources (see the workflow document's bindings). Fixed is {"kind":
        "literal", "value": ...}: the agent never sees it, and it is sent as is
        (a literal may be one call reference such as "{{call.caller_number}}",
        or a relative time such as
        "{{call.time.start_of_today.Asia/Jerusalem}}", resolved when the step
        runs). AI is {"kind": "model", "path": "/<input>"}: the agent fills it
        from the conversation. Choose from a list is a model source with
        options: the agent picks one of 1-20 {value, label} choices by its
        label. From the call: request (a call request field), stored (saved
        context) or step (an earlier step's result), each with an optional
        fallback {"value": ...}. Fixed and from-the-call values are left out of
        what the agent is asked for, and a value it sends for them anyway is
        ignored.
      required:
        - kind
      properties:
        kind:
          type: string
          enum:
            - literal
            - model
            - request
            - stored
            - step
        value:
          description: 'literal: the fixed value.'
        path:
          type: string
          description: >-
            model: "/<input>". request, stored, step: a pointer into the value
            read, such as /phone.
        options:
          type: array
          minItems: 1
          maxItems: 20
          description: >-
            model only: the choices the agent picks from, each value listed
            once. Text inputs (or a list of text) only.
          items:
            type: object
            additionalProperties: false
            required:
              - value
              - label
            properties:
              value:
                type: string
                minLength: 1
                maxLength: 500
              label:
                type: string
                minLength: 1
                maxLength: 120
        scope:
          type: string
          enum:
            - before
            - during
          description: 'step: a before-call step or an action step.'
        step_id:
          type: string
        fallback:
          type: object
          required:
            - value
          properties:
            value: {}
          description: Sent when the value read is missing.
      example:
        kind: literal
        value:
          - c_1a2b3c@group.calendar.google.com
    IntegrationWriteResult:
      type: object
      required:
        - integration
        - draft_version
        - live
      properties:
        integration:
          $ref: '#/components/schemas/Integration'
        draft_version:
          type: integer
        live:
          type: boolean
          description: The change is on the agent's calls now.
        not_live_reason:
          type: string
          enum:
            - draft_has_other_changes
            - agent_not_published
            - publish_not_requested
            - publish_refused
            - publish_unavailable
            - inputs_missing
        issues:
          type: array
          items:
            type: object
          description: >-
            With publish_refused: what the compiler refused, as POST
            /agents/{id}/workflow/publish names it. With inputs_missing: each
            required input still without a source (missing_input_source, path
            /actions/<n>/inputs/<input>), with the PATCH that sets it.
        skipped_actions:
          type: array
          description: >-
            Default actions the app cannot offer to a voice agent, left out of
            the integration, each with why. Empty when every default was given.
            An action named in actions is never skipped: it is refused (422
            INTEGRATION_ACTION_UNAVAILABLE).
          items:
            type: object
            required:
              - action
              - reason
              - message
            properties:
              action:
                type: string
                example: GOOGLECALENDAR_DELETE_EVENT
              reason:
                type: string
                description: >-
                  not_eligible, needs_setup, action_version_deprecated,
                  changed_meanwhile (send the request again),
                  account_unavailable (reconnect the account), action_unknown,
                  build_failed (try again in a minute), or the lowercase code of
                  a failed build.
                example: action_version_deprecated
              message:
                type: string
                example: >-
                  Google Calendar cannot offer GOOGLECALENDAR_DELETE_EVENT to an
                  agent: this version of it is deprecated.
        settings_updated_at:
          type: string
          format: date-time
          description: >-
            Present when live is true: publishing moved the agent's settings
            token, as POST /agents/{id}/workflow/publish answers it. Send it as
            expected_updated_at on your next PATCH /agents/{id}.
    ToolGrantWriteResult:
      type: object
      required:
        - integration
        - draft_version
        - live
      properties:
        integration:
          $ref: '#/components/schemas/ToolGrant'
        draft_version:
          type: integer
        live:
          type: boolean
        not_live_reason:
          type: string
          enum:
            - draft_has_other_changes
            - agent_not_published
            - publish_not_requested
            - publish_refused
            - publish_unavailable
        settings_updated_at:
          type: string
          format: date-time
    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
    Integration:
      type: object
      description: A connected account given to the whole agent.
      required:
        - id
        - app
        - app_name
        - connection
        - actions
        - status
      properties:
        id:
          type: string
          example: i_0b8f4c2e
        app:
          type: string
          example: googlecalendar
        app_name:
          type: string
          example: Google Calendar
        connection:
          type: object
          properties:
            id:
              type: string
              format: uuid
            label:
              type: string
              example: Clinic calendar
            state:
              type: string
              example: ready
            ready:
              type: boolean
        actions:
          type: array
          items:
            $ref: '#/components/schemas/GrantedAction'
        status:
          type: string
          enum:
            - live
            - not_live
            - building
            - reconnect_required
    ToolGrant:
      type: object
      description: >-
        A saved webhook or call transfer given to every conversation step of the
        agent.
      required:
        - id
        - kind
        - tool_id
        - name
        - binding_id
        - inputs
        - overrides
        - status
      properties:
        id:
          type: string
          example: tg_5c1e9a20
        kind:
          type: string
          enum:
            - webhook
            - transfer
        tool_id:
          type: string
          format: uuid
        name:
          type: string
          example: Send lead to CRM
        binding_id:
          type: string
          example: t_5c1e9a20
          description: 'Its binding: PATCH its inputs keyed by this id.'
        inputs:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/ActionInputSource'
        overrides:
          type: array
          items:
            type: object
        status:
          type: string
          enum:
            - live
            - not_live
            - unavailable
          description: 'unavailable: the tool is no longer in the workspace.'
    GrantedAction:
      allOf:
        - $ref: '#/components/schemas/ConnectionAction'
        - type: object
          properties:
            binding_id:
              type: string
              example: i_0b8f4c2e_find_free_slots
              description: The binding this action runs as on every step.
            inputs:
              type: object
              description: The agent's source for each input, by input name.
              additionalProperties:
                $ref: '#/components/schemas/ActionInputSource'
            input_specs:
              type: array
              items:
                $ref: '#/components/schemas/ActionInputSpec'
            bindable:
              type: boolean
              description: >-
                The account's tool for this action takes the agent's own
                calendar. False on a tool built before that: the first write
                that sets a calendar rebuilds it (a new revision of the same
                tool), so you can send it anyway.
            missing_inputs:
              type: array
              items:
                type: string
              example:
                - spreadsheet_id
              description: >-
                Required inputs that have no source yet - a configuration ID
                with no default (a spreadsheet, a channel, a board) starts with
                none, because the agent cannot guess it. Omitted when none. Set
                each with PATCH /agents/{id}/integrations/{integration_id} and
                inputs; until then the integration is saved but not published
                (not_live_reason inputs_missing).
            overrides:
              type: array
              description: >-
                Steps with their own settings for this action (the workflow's
                binding_overrides).
              items:
                type: object
                required:
                  - node_id
                  - binding_id
                  - inputs
                properties:
                  node_id:
                    type: string
                  binding_id:
                    type: string
                    example: o_k3j9x0a2b1
                  inputs:
                    type: object
                    additionalProperties:
                      $ref: '#/components/schemas/ActionInputSource'
    ConnectionAction:
      type: object
      description: One thing a connected app can do on calls.
      required:
        - action
        - name
        - description
        - effect
        - default
      properties:
        action:
          type: string
          example: GOOGLECALENDAR_FIND_FREE_SLOTS
        name:
          type: string
          example: Find free time
        name_he:
          type:
            - string
            - 'null'
          example: חיפוש זמן פנוי
        description:
          type: string
          description: One line for a person.
        effect:
          type: string
          enum:
            - read
            - write
            - delete
        default:
          type: boolean
          description: On when the app is added without a list of actions.
        description_he:
          type:
            - string
            - 'null'
          description: One spoken-Hebrew line, for a curated action.
          example: בודק מתי היומן פנוי בטווח שעות
        inputs:
          type: array
          description: >-
            How each input is set, configuration inputs (which calendar) first.
            Absent for an action the catalogue has no word on.
          items:
            $ref: '#/components/schemas/ActionInputSpec'
    ActionInputSpec:
      type: object
      description: >
        One input of an action. role config is a setting of the agent (which
        calendar, which sheet), usually Fixed; role conversation is filled from
        the call, usually by the agent (AI). default_source is what a new
        binding gets when you do not set it - null for a configuration ID with
        no default (a spreadsheet, a channel, a board): the agent cannot guess
        one, so you set it.
      required:
        - name
        - label
        - role
        - required
        - default_source
      properties:
        name:
          type: string
          example: items
        label:
          type: string
          example: Calendar
        label_he:
          type: string
          example: יומן
        role:
          type: string
          enum:
            - config
            - conversation
        resource:
          type:
            - string
            - 'null'
          enum:
            - calendar
            - sheet
            - channel
            - board
            - event_type
            - null
          description: >-
            Set when the account can list the choices: GET
            /tool-connections/{id}/options/calendars for calendar.
        shape:
          type: string
          enum:
            - value
            - one_item_array
          description: >-
            one_item_array: the tool takes a list, and you fix it to a list of
            one id (["primary"]).
        required:
          type: boolean
        default_source:
          oneOf:
            - $ref: '#/components/schemas/ActionInputSource'
            - type: 'null'
  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.