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

# Change an integration's actions

> Requires agents:update. With actions: replaces the integration's actions ("default" for the app's defaults); each item may carry inputs as in POST. Actions kept keep their binding and the sources their inputs have (except those you send); dropped ones leave every step, with any step's own settings for them. With inputs alone: the actions stay and only the named inputs change, keyed by action slug ({"GOOGLECALENDAR_FIND_FREE_SLOTS": {"items": source}}); null puts an input back to the catalogue's default. For a webhook or call transfer on every step (tg_...), inputs is keyed by its binding id ({"t_5c1e9a20": {"<input>": source}}). A write that fixes a calendar on an action whose tool was built before it could take one rebuilds that tool first (a new revision of the same tool). Saved and published by the same rule as POST.


Requires `agents:update`. Replaces which actions of the account the agent may use. Send the full list, or `"default"` for the app's defaults. Actions you keep keep their binding; actions you drop leave every step. Saved and published by the same rule as [adding one](https://docs.goyappr.com/api-reference/agents/integrations-add.md).

```bash theme={null}
curl -X PATCH https://api.goyappr.com/agents/AGENT_ID/integrations/i_0b8f4c2e \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"actions": ["GOOGLECALENDAR_FIND_FREE_SLOTS", "GOOGLECALENDAR_EVENTS_LIST"], "expected_version": 13}'
```

Fewer actions keep the agent focused: an availability-only agent needs only find free time and list events.

The answer is `200` with the same shape as adding one: `integration`, `skipped_actions` (with `"default"`, the defaults the app cannot offer, each with why), `draft_version`, `live`, and `settings_updated_at` when `live` is `true`. With `"default"` while an app outside the curated list is still having its action list read the first time, the answer is `503 WORKFLOW_TOOL_CONTROL_UNAVAILABLE` with `Retry-After` and nothing is saved.

Each item of `actions` may also be `{"action": slug, "inputs": {...}}`, as when [adding one](https://docs.goyappr.com/api-reference/agents/integrations-add.md#set-how-each-input-is-filled). An action you keep keeps the sources its inputs have, except the ones you send.

## Change only how inputs are filled

Send `inputs` instead of `actions`, keyed by action slug. `null` puts an input back to the catalogue's default. Let the agent choose between two calendars by name:

```bash theme={null}
curl -X PATCH https://api.goyappr.com/agents/AGENT_ID/integrations/i_0b8f4c2e \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"inputs": {"GOOGLECALENDAR_FIND_FREE_SLOTS": {"items": {"kind": "model", "path": "/items",
        "options": [{"value": "primary", "label": "Front desk"}, {"value": "c_1a2b3c@group.calendar.google.com", "label": "Clinic"}]}}},
       "expected_version": 13}'
```

For a webhook or call transfer on every step (`tg_…`), key `inputs` by its `binding_id`: `{"inputs": {"t_5c1e9a20": {"note": {"kind": "literal", "value": "From the voice agent"}}}}`.

When a calendar is fixed on an action whose tool was built before it could take one, the tool is rebuilt first (a new revision of the same tool); `bindable` on [the list](https://docs.goyappr.com/api-reference/agents/integrations-list.md) says which those are. You do not have to do anything about it.

Refusals: `404 INTEGRATION_NOT_FOUND`, `409 WORKFLOW_CONFLICT`, `422 INPUT_SOURCE_INVALID` (each bad source named by path), `422 INTEGRATION_ACTION_UNKNOWN`, `422 INTEGRATION_ACTION_UNAVAILABLE`, `422 INTEGRATION_LIMIT`, `422 TOOL_CONNECTION_NOT_READY`.


## OpenAPI

````yaml PATCH /agents/{id}/integrations/{integration_id}
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/{integration_id}:
    patch:
      tags:
        - Agents
      summary: Change an integration's actions or how their inputs are filled
      description: >
        Requires agents:update. With actions: replaces the integration's actions
        ("default" for the app's defaults); each item may carry inputs as in
        POST. Actions kept keep their binding and the sources their inputs have
        (except those you send); dropped ones leave every step, with any step's
        own settings for them. With inputs alone: the actions stay and only the
        named inputs change, keyed by action slug
        ({"GOOGLECALENDAR_FIND_FREE_SLOTS": {"items": source}}); null puts an
        input back to the catalogue's default. For a webhook or call transfer on
        every step (tg_...), inputs is keyed by its binding id ({"t_5c1e9a20":
        {"<input>": source}}). A write that fixes a calendar on an action whose
        tool was built before it could take one rebuilds that tool first (a new
        revision of the same tool). Saved and published by the same rule as
        POST.
      operationId: updateAgentIntegration
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
            format: uuid
        - name: integration_id
          in: path
          required: true
          schema:
            type: string
            example: i_0b8f4c2e
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              description: Send actions or inputs, not both.
              properties:
                actions:
                  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'
                inputs:
                  type: object
                  description: >-
                    Only how inputs are filled: {"<action slug>": {"<input>":
                    source or null}}, or for a webhook or transfer
                    {"<binding_id>": {...}}.
                  additionalProperties:
                    type: object
                    additionalProperties:
                      oneOf:
                        - $ref: '#/components/schemas/ActionInputSource'
                        - type: 'null'
                publish:
                  type: boolean
                  default: true
                expected_version:
                  type: integer
                  minimum: 1
            examples:
              actions:
                value:
                  actions:
                    - GOOGLECALENDAR_FIND_FREE_SLOTS
                    - GOOGLECALENDAR_EVENTS_LIST
              chooseCalendar:
                summary: Let the agent choose between two calendars
                value:
                  inputs:
                    GOOGLECALENDAR_FIND_FREE_SLOTS:
                      items:
                        kind: model
                        path: /items
                        options:
                          - value: primary
                            label: Front desk
                          - value: c_1a2b3c@group.calendar.google.com
                            label: Clinic
                  expected_version: 13
      responses:
        '200':
          description: The integration (or webhook or transfer) as it is now.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/IntegrationWriteResult'
                  - $ref: '#/components/schemas/ToolGrantWriteResult'
        '400':
          description: >-
            AGENT_INTEGRATION_REQUEST_INVALID (actions and inputs both sent),
            each field named in issues.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            AGENT_NOT_FOUND, INTEGRATION_NOT_FOUND, or TOOL_NOT_FOUND (the
            webhook or transfer was deleted: remove the entry).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: WORKFLOW_CONFLICT.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            AGENT_INTEGRATION_REQUEST_INVALID (neither actions nor inputs;
            actions on a webhook or transfer), INPUT_SOURCE_INVALID (each bad
            source named by path, such as
            /inputs/GOOGLECALENDAR_FIND_FREE_SLOTS/items),
            TOOL_CONNECTION_NOT_READY, INTEGRATION_ACTION_UNKNOWN,
            INTEGRATION_ACTION_UNAVAILABLE, INTEGRATION_LIMIT.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: >-
            WORKFLOW_TOOL_CONTROL_UNAVAILABLE: still preparing, or "default"
            asked while an app outside the curated list is still having its
            action list read (Retry-After); 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.