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

# List Tool Contract Revisions

> Requires tools:read. Returns the 100 most recent contract revisions of one saved tool, newest first. A revision records the input and output schemas the agent is held to, and where the tool may run. Private endpoint configuration is never returned.


Requires `tools:read`. Returns the 100 most recent contract revisions of one saved tool, newest first. A contract revision is what a workflow holds the tool to: the input schema the agent must fill, the output schema it can read back, when in the call the tool may run, and on which channels.

```bash theme={null}
curl https://api.goyappr.com/tools/TOOL_ID/workflow-revisions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-company-id: COMPANY_ID"
```

Read the highest `revision` in the list before adding a new one — that number is what you send back as `expected_revision`.

Each row is one contract: `id`, `tool_id`, `revision`, `name`, `description`, `kind`, `input_schema`, `output_schema`, `allowed_phases`, `allowed_channels`, `timeout_ms`, `effect` and `replay_safe` — the fields [Add a tool contract revision](https://docs.goyappr.com/api-reference/tools/create-revision.md) takes, and what it answers — plus `include_call_context` when it is `false`.

Each row carries `created_at`, when that revision was made — the time a header was rotated or a schema changed.

An archived tool's revisions are not read, and none can be added to it: both answer `404 WORKFLOW_TOOL_ARCHIVED`, and the message names [`POST /tools/{id}/restore`](https://docs.goyappr.com/api-reference/tools/restore). Restore it first; its revisions were kept while it was archived.

Private endpoint details are never returned here. The address the tool calls, its header values and a transfer destination stay on the tool itself and are supplied by Yappr at call time, so a revision can be read, copied and diffed without exposing them.


## OpenAPI

````yaml GET /tools/{id}/workflow-revisions
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:
  /tools/{id}/workflow-revisions:
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
          format: uuid
      - in: header
        name: x-company-id
        schema:
          type: string
          format: uuid
        description: >-
          Explicit active workspace. Optional; when sent it must be the API
          key's own workspace — any other value is refused with 403
          WORKSPACE_MISMATCH.
    get:
      tags:
        - Tools
      summary: List a tool's contract revisions
      description: >
        Requires tools:read. Returns the 100 most recent contract revisions of
        one saved tool, newest first. A revision records the input and output
        schemas the agent is held to, and where the tool may run. Private
        endpoint configuration is never returned.
      operationId: listWorkflowToolRevisions
      responses:
        '200':
          description: Contract revisions, newest first.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowToolContractRevisionList'
        '400':
          description: >-
            WORKFLOW_REQUEST_INVALID: a query parameter this route does not
            read. It reads none, and anything sent is refused by name rather
            than ignored.
          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'
        '403':
          description: >
            WORKSPACE_MISMATCH — `x-company-id` named a workspace other than the
            one this API key belongs to.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            WORKFLOW_NOT_FOUND — no such tool in this workspace.
            WORKFLOW_TOOL_ARCHIVED — it is archived; its revisions are not read
            until it is restored with POST /tools/{id}/restore, which the
            message names.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowError'
        '503':
          description: WORKFLOW_STORAGE_UNAVAILABLE — temporary; retry the same request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowError'
components:
  schemas:
    WorkflowToolContractRevisionList:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          maxItems: 100
          description: Newest revision first, capped at the 100 most recent.
          items:
            $ref: '#/components/schemas/WorkflowToolContractRevision'
    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
    WorkflowError:
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          required:
            - code
          properties:
            error:
              type: string
            code:
              type: string
            warnings:
              type: array
              description: >
                On WORKFLOW_VALIDATION_FAILED from Check or publish, the
                advisories beside the issues, in the shape of
                WorkflowValidation's warnings - strict_off_guidance when
                strict_mode is off, and every advisory about a binding or an
                input. The compiler's own graph advisories
                (during_output_advisory, sequence_branch_advisory,
                before_reference_missing_fallback, override_needs_strict,
                after_ending_coverage, after_any_end_waits,
                before_budget_inbound) arrive once the document compiles.
              items:
                type: object
                required:
                  - code
                  - message
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  path:
                    type: string
                    maxLength: 1000
                  node_id:
                    type: string
                    maxLength: 64
                  label:
                    type: string
                    maxLength: 200
                    description: The step's label. Present only with node_id.
                  tool_name:
                    type: string
                    maxLength: 200
                  field:
                    type: string
                    maxLength: 200
            issues:
              type: array
              maxItems: 100
              items:
                type: object
                required:
                  - code
                  - path
                  - message
                properties:
                  code:
                    type: string
                    maxLength: 100
                  path:
                    type: string
                    maxLength: 1000
                  message:
                    type: string
                    maxLength: 2000
                  node_id:
                    type: string
                    maxLength: 64
                    description: >-
                      The step the issue belongs to - a conversation step, a
                      before-call step, a follow-up or a step inside a sequence,
                      by its `id`. An issue about a binding names the first step
                      that runs or offers it; absent only when no single step is
                      concerned (a binding no step uses, a schema).
                  label:
                    type: string
                    maxLength: 200
                    description: >-
                      That step's label, as the workflow document spells it - on
                      every code. Present only with `node_id`.
                  tool_name:
                    type: string
                    maxLength: 200
                    description: >-
                      On an issue about a binding, the name of the tool it runs.
                      `label` is never the tool's name.
                  field:
                    type: string
                    maxLength: 200
                    description: >-
                      On an issue about one input of a binding
                      (`/bindings/{n}/inputs/{field}`), that input's name.
    WorkflowToolContractRevision:
      type: object
      description: >
        One immutable contract revision of a saved tool. Private endpoint
        configuration (URL, header values, transfer destination) is never
        included: it stays on the tool itself and is supplied by Yappr at call
        time.
      required:
        - id
        - tool_id
        - revision
        - name
        - kind
        - input_schema
        - output_schema
      properties:
        id:
          type: string
          format: uuid
        tool_id:
          type: string
          format: uuid
        revision:
          type: integer
          minimum: 1
          description: >-
            Increments by one per revision of this tool. Use the highest value
            as expected_revision for the next write.
        created_at:
          type: string
          format: date-time
          description: When this revision was made. On every row of the list.
        name:
          type: string
          description: Copied from the saved tool. It cannot be set through this endpoint.
        description:
          type: string
        kind:
          type: string
          enum:
            - http
            - transfer
          description: >-
            Derived from the saved tool's own type; it cannot be set through
            this endpoint.
        input_schema:
          type: object
          additionalProperties: true
        output_schema:
          type: object
          additionalProperties: true
        allowed_phases:
          type: array
          items:
            type: string
            enum:
              - before
              - during
              - after
          description: >-
            Defaults to all three. Transfer tools are always ["during"],
            whatever you send.
        allowed_channels:
          type: array
          items:
            enum:
              - phone
              - web
            type: string
          description: >-
            Defaults to both. Transfer tools are always ["phone"], whatever you
            send.
        timeout_ms:
          type: integer
          default: 30000
        effect:
          type: string
          description: >-
            Defaults to "write". Transfer tools are always "terminal", whatever
            you send.
        replay_safe:
          type: boolean
          default: false
          description: Transfer tools are always false, whatever you send.
        include_call_context:
          type: boolean
          default: true
          description: >
            Whether every request this tool makes carries the call under `call`
            (see CallPackage). Returned only when it is false, because true is
            what every tool does unless you say otherwise. Turn it off for an
            endpoint that wants nothing but the inputs you mapped; the inputs
            themselves still read the call through {{call.field}} either way.
  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.