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

# Get workflow version

> Read one published version with its complete workflow document.

Requires `agents:read`. Returns one published version of the agent together
with the workflow document it ran. Use it to look at an older version before you
[restore it](https://docs.goyappr.com/api-reference/workflows/restore.md).

**id** `string` *required*

Local agent UUID.

**version\_id** `string` *required*

The version's `id`, from `data[].id` of [List workflow versions](https://docs.goyappr.com/api-reference/workflows/versions.md).

```bash theme={null}
curl 'https://api.goyappr.com/agents/AGENT_ID/workflow/versions/VERSION_ID' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'x-company-id: COMPANY_ID'
```

The answer has everything a row of the list has (`id`, `version`,
`draft_version`, `content_hash`, `compiler_version`, `environment`,
`published_at`, `source`, `source_run_id`, `restored_from_version`) plus:

| Field | Meaning |
| - | - |
| `document` | The complete workflow document of that version, with exact numbers. |
| `is_current` | `true` when callers reach this version now. |

An id that is not a UUID, an id that names nothing, and the id of another
agent's version all answer `404 WORKFLOW_NOT_FOUND`. The route takes no query
parameters: one is refused with `400 WORKFLOW_REQUEST_INVALID`.

Reading a version changes nothing. To make it live again, see
[Restore workflow version](https://docs.goyappr.com/api-reference/workflows/restore.md).


## OpenAPI

````yaml GET /agents/{id}/workflow/versions/{version_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}/workflow/versions/{version_id}:
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: version_id
        required: true
        schema:
          type: string
          format: uuid
        description: >-
          A version's id, from `data[].id` of GET
          /agents/{id}/workflow/versions.
      - 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:
        - Workflows
      summary: Read one published workflow version
      description: >
        Requires agents:read. Returns one published version of the agent with
        its complete workflow document, the exact text that version ran. Use it
        to look at an older version before restoring it. `is_current` says
        whether callers reach this version now. Takes no query parameters.
      operationId: getWorkflowVersion
      responses:
        '200':
          description: The version and its document.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowVersionDetail'
        '400':
          description: 'WORKFLOW_REQUEST_INVALID: a query parameter (this route reads none).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowError'
        '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: the agent is unavailable in this company, or the
            id is not a version of this agent (an id that is not a UUID, an
            unknown id and another agent's version all answer the same).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowError'
components:
  schemas:
    WorkflowVersionDetail:
      allOf:
        - $ref: '#/components/schemas/WorkflowRevisionSummary'
        - $ref: '#/components/schemas/WorkflowVersionProvenance'
        - type: object
          required:
            - document
            - is_current
          properties:
            draft_version:
              type: integer
              minimum: 1
            compiler_version:
              type: string
            document:
              $ref: '#/components/schemas/WorkflowDocument'
            is_current:
              type: boolean
              description: True when callers reach this version now.
    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.
    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
    WorkflowRevisionSummary:
      type: object
      required:
        - id
        - version
        - content_hash
        - published_at
      properties:
        id:
          type: string
          format: uuid
        version:
          type: integer
          minimum: 1
        content_hash:
          type: string
          pattern: ^[a-f0-9]{64}$
        published_at:
          type: string
          format: date-time
        environment:
          type: string
          enum:
            - local
            - testing
            - production
          readOnly: true
          description: >
            The deployment plane that compiled and stored this revision. Decided
            by the deployment, never sent by the caller; the hosted API stores
            as testing. A call loads only a version stored on the plane it runs
            on, and publishing and calling through the same API are the same
            plane. See the List workflow versions page.
    WorkflowVersionProvenance:
      type: object
      properties:
        source:
          type:
            - string
            - 'null'
          enum:
            - teach
            - restore
            - null
          description: >-
            How the version came to be. `teach` - published by Teach from a test
            call; `restore` - published by a restore (including an undo of a
            Teach run); null - published by a person from the editor or the API.
        source_run_id:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            The Teach run that published this version. Null unless source is
            teach.
        restored_from_version:
          type:
            - integer
            - 'null'
          minimum: 1
          description: >-
            The version number this one is a copy of. Null unless source is
            restore.
    WorkflowDocument:
      additionalProperties: false
      properties:
        schema_version:
          const: '1'
          default: '1'
          title: Schema Version
          type: string
        id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Id
          type: string
        name:
          maxLength: 200
          minLength: 1
          title: Name
          type: string
        strict_mode:
          default: false
          title: Strict Mode
          type: boolean
        global_instructions:
          default: ''
          description: >-
            Prose may read a Before-call step's output as
            {{before.<step_id>.<dotted.path>}}, optionally ending with |text
            used when the value is missing. The publisher validates the step and
            the path; the value is substituted once, at session start. {{option
            one|option two}} - two or more plain-text options separated by |,
            the first not starting with before. or call. - is a random
            variation: one option is said, picked once per call.
          maxLength: 100000
          title: Global Instructions
          type: string
        channels:
          items:
            enum:
              - phone
              - web
            type: string
          minItems: 1
          title: Channels
          type: array
        request_schema:
          additionalProperties:
            $ref: '#/components/schemas/WorkflowV1JsonValue'
          title: Request Schema
          type: object
        stored_schema:
          additionalProperties:
            $ref: '#/components/schemas/WorkflowV1JsonValue'
          title: Stored Schema
          type: object
        bindings:
          items:
            $ref: '#/components/schemas/WorkflowV1ToolBinding'
          maxItems: 512
          title: Bindings
          type: array
        before:
          $ref: '#/components/schemas/WorkflowV1BeforePhase'
        conversation:
          $ref: '#/components/schemas/WorkflowV1ConversationGraph'
        after:
          items:
            $ref: '#/components/schemas/WorkflowV1AfterTrigger'
          maxItems: 64
          title: After
          type: array
        sequences:
          items:
            $ref: '#/components/schemas/WorkflowV1ToolSequence'
          maxItems: 64
          title: Sequences
          type: array
        editor:
          $ref: '#/components/schemas/WorkflowV1EditorMetadata'
        integrations:
          description: >-
            Tools & integrations this agent may use on every step: connected
            apps (one entry per connected account, at most 8) and saved webhooks
            or call transfers (one entry per tool, at most 8). Each action names
            a binding in bindings; the save path offers every one of them on
            every conversation step. Manage them with /agents/{id}/integrations
            rather than by hand.
          items:
            anyOf:
              - $ref: '#/components/schemas/WorkflowV1IntegrationGrant'
              - $ref: '#/components/schemas/WorkflowV1ToolGrant'
          maxItems: 16
          title: Integrations
          type: array
      required:
        - id
        - name
        - conversation
      title: WorkflowDefinition
      type: object
    WorkflowV1JsonValue:
      anyOf:
        - type: 'null'
        - type: boolean
        - type: number
        - type: string
        - type: array
          items:
            $ref: '#/components/schemas/WorkflowV1JsonValue'
        - type: object
          additionalProperties:
            $ref: '#/components/schemas/WorkflowV1JsonValue'
    WorkflowV1ToolBinding:
      additionalProperties: false
      properties:
        id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Id
          type: string
        tool_revision_id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Tool Revision Id
          type: string
        tool_revision_policy:
          default: follow_current
          enum:
            - follow_current
            - pinned
          title: Tool Revision Policy
          type: string
        inputs:
          additionalProperties:
            discriminator:
              mapping:
                artifact: '#/$defs/ArtifactSource'
                extract: '#/$defs/ExtractSource'
                literal: '#/$defs/LiteralSource'
                model: '#/$defs/ModelSource'
                request: '#/$defs/ContextSource'
                sequence: '#/$defs/ContextSource'
                step: '#/$defs/StepSource'
                stored: '#/$defs/ContextSource'
              propertyName: kind
            oneOf:
              - $ref: '#/components/schemas/WorkflowV1LiteralSource'
              - $ref: '#/components/schemas/WorkflowV1ModelSource'
              - $ref: '#/components/schemas/WorkflowV1ContextSource'
              - $ref: '#/components/schemas/WorkflowV1StepSource'
              - $ref: '#/components/schemas/WorkflowV1ArtifactSource'
              - $ref: '#/components/schemas/WorkflowV1ExtractSource'
          title: Inputs
          type: object
      required:
        - id
        - tool_revision_id
      title: ToolBinding
      type: object
    WorkflowV1BeforePhase:
      additionalProperties: false
      properties:
        steps:
          items:
            $ref: '#/components/schemas/WorkflowV1SequenceStep'
          maxItems: 256
          title: Steps
          type: array
        on_failure:
          default: stop_admission
          enum:
            - stop_admission
            - continue_with_available
          title: On Failure
          type: string
      title: BeforePhase
      type: object
    WorkflowV1ConversationGraph:
      additionalProperties: false
      properties:
        entry_node_id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Entry Node Id
          type: string
        nodes:
          items:
            discriminator:
              mapping:
                action: '#/$defs/ActionNode'
                conversation: '#/$defs/ConversationNode'
                end: '#/$defs/EndNode'
                sequence: '#/$defs/SequenceNode'
              propertyName: type
            oneOf:
              - $ref: '#/components/schemas/WorkflowV1ConversationNode'
              - $ref: '#/components/schemas/WorkflowV1ActionNode'
              - $ref: '#/components/schemas/WorkflowV1SequenceNode'
              - $ref: '#/components/schemas/WorkflowV1EndNode'
          maxItems: 256
          minItems: 1
          title: Nodes
          type: array
        edges:
          items:
            discriminator:
              mapping:
                conversation: '#/$defs/ConversationEdge'
                result: '#/$defs/ResultEdge'
              propertyName: kind
            oneOf:
              - $ref: '#/components/schemas/WorkflowV1ConversationEdge'
              - $ref: '#/components/schemas/WorkflowV1ResultEdge'
          maxItems: 1024
          title: Edges
          type: array
        global_edges:
          items:
            $ref: '#/components/schemas/WorkflowV1GlobalEdge'
          maxItems: 128
          title: Global Edges
          type: array
      required:
        - entry_node_id
        - nodes
      title: ConversationGraph
      type: object
    WorkflowV1AfterTrigger:
      additionalProperties: false
      properties:
        id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Id
          type: string
        event:
          enum:
            - call.answered
            - call.ended
            - call.failed
            - call.no_answer
            - ai_session.ended
            - transfer.accepted
            - transfer.answered
            - transfer.failed
            - transcript.ready
            - analysis.ready
            - recording.ready
            - lead.ready
            - billing.ready
            - any_end
            - request.failed
          title: Event
          type: string
        steps:
          items:
            $ref: '#/components/schemas/WorkflowV1SequenceStep'
          maxItems: 256
          title: Steps
          type: array
        when:
          anyOf:
            - discriminator:
                mapping:
                  all_of: '#/$defs/AllOf'
                  any_of: '#/$defs/AnyOf'
                  compare: '#/$defs/Comparison'
                  not: '#/$defs/NotCondition'
                propertyName: kind
              oneOf:
                - $ref: '#/components/schemas/WorkflowV1Comparison'
                - $ref: '#/components/schemas/WorkflowV1AllOf'
                - $ref: '#/components/schemas/WorkflowV1AnyOf'
                - $ref: '#/components/schemas/WorkflowV1NotCondition'
            - type: 'null'
          default: null
          description: >-
            Optional. An "Only if" on this follow-up: the steps run only when
            the condition holds for the call. Reads the call itself ({"kind":
            "call", "path": "/status"}) and fixed values, and only the facts
            this trigger's event guarantees: how the call ended (result, who
            ended it, duration) on an ending, the disposition and collected
            fields on analysis.ready, direction and channel on any event. When
            it does not hold, every step is recorded as skipped (guard_false)
            and the follow-up counts as done.
          title: When
      required:
        - id
        - event
      title: AfterTrigger
      type: object
    WorkflowV1ToolSequence:
      additionalProperties: false
      properties:
        id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Id
          type: string
        name:
          maxLength: 200
          minLength: 1
          title: Name
          type: string
        description:
          default: ''
          maxLength: 10000
          title: Description
          type: string
        input_schema:
          additionalProperties:
            $ref: '#/components/schemas/WorkflowV1JsonValue'
          title: Input Schema
          type: object
        output_schema:
          additionalProperties:
            $ref: '#/components/schemas/WorkflowV1JsonValue'
          title: Output Schema
          type: object
        output_mapping:
          additionalProperties:
            $ref: '#/components/schemas/WorkflowV1StepSource'
          title: Output Mapping
          type: object
        steps:
          items:
            $ref: '#/components/schemas/WorkflowV1SequenceStep'
          maxItems: 128
          minItems: 1
          title: Steps
          type: array
      required:
        - id
        - name
        - steps
      title: ToolSequence
      type: object
    WorkflowV1EditorMetadata:
      additionalProperties: false
      properties:
        positions:
          additionalProperties:
            $ref: '#/components/schemas/WorkflowV1Position'
          title: Positions
          type: object
      title: EditorMetadata
      type: object
    WorkflowV1IntegrationGrant:
      additionalProperties: false
      properties:
        id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Id
          type: string
        connection_id:
          pattern: ^[a-f0-9-]{36}$
          title: Connection Id
          type: string
        app:
          pattern: ^[a-z0-9_]{1,100}$
          title: App
          type: string
        actions:
          items:
            $ref: '#/components/schemas/WorkflowV1IntegrationAction'
          maxItems: 24
          minItems: 1
          title: Actions
          type: array
      required:
        - id
        - connection_id
        - app
        - actions
      title: IntegrationGrant
      type: object
    WorkflowV1ToolGrant:
      additionalProperties: false
      description: >-
        A saved webhook or call transfer the agent may use on every conversation
        step.


        Lives in the same `integrations` list as the app grants (the two shapes

        share no member, so the list stays unambiguous). `binding_id` names one

        binding in `bindings` that runs `tool_id`; the save path offers it on
        every

        conversation step, as it does an app grant's actions.
      properties:
        id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Id
          type: string
        tool_id:
          pattern: ^[a-f0-9-]{36}$
          title: Tool Id
          type: string
        binding_id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Binding Id
          type: string
      required:
        - id
        - tool_id
        - binding_id
      title: ToolGrant
      type: object
    WorkflowV1LiteralSource:
      additionalProperties: false
      properties:
        kind:
          const: literal
          title: Kind
          type: string
        value:
          $ref: '#/components/schemas/WorkflowV1JsonValue'
      required:
        - kind
        - value
      title: LiteralSource
      type: object
    WorkflowV1ModelSource:
      additionalProperties: false
      properties:
        kind:
          const: model
          title: Kind
          type: string
        path:
          pattern: ^/[^/]+$
          title: Path
          type: string
        options:
          anyOf:
            - items:
                $ref: '#/components/schemas/WorkflowV1ModelOption'
              maxItems: 20
              minItems: 1
              type: array
            - type: 'null'
          default: null
          description: >-
            Optional. The values the agent may choose from for this input, each
            with the label it reads. Only on a During-call binding; string
            values only.
          title: Options
      required:
        - kind
        - path
      title: ModelSource
      type: object
    WorkflowV1ContextSource:
      additionalProperties: false
      properties:
        kind:
          enum:
            - request
            - stored
            - sequence
          title: Kind
          type: string
        path:
          pattern: ^(|/.*)$
          title: Path
          type: string
        fallback:
          anyOf:
            - $ref: '#/components/schemas/WorkflowV1Fallback'
            - type: 'null'
          default: null
      required:
        - kind
        - path
      title: ContextSource
      type: object
    WorkflowV1StepSource:
      additionalProperties: false
      properties:
        kind:
          const: step
          title: Kind
          type: string
        scope:
          default: local
          enum:
            - local
            - before
            - during
          title: Scope
          type: string
        step_id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Step Id
          type: string
        path:
          pattern: ^(|/.*)$
          title: Path
          type: string
        fallback:
          anyOf:
            - $ref: '#/components/schemas/WorkflowV1Fallback'
            - type: 'null'
          default: null
      required:
        - kind
        - step_id
        - path
      title: StepSource
      type: object
    WorkflowV1ArtifactSource:
      additionalProperties: false
      properties:
        kind:
          const: artifact
          title: Kind
          type: string
        artifact:
          enum:
            - transcript
            - analysis
            - recording
            - lead
            - billing
          title: Artifact
          type: string
        path:
          pattern: ^(|/.*)$
          title: Path
          type: string
        fallback:
          anyOf:
            - $ref: '#/components/schemas/WorkflowV1Fallback'
            - type: 'null'
          default: null
      required:
        - kind
        - artifact
        - path
      title: ArtifactSource
      type: object
    WorkflowV1ExtractSource:
      additionalProperties: false
      properties:
        kind:
          const: extract
          title: Kind
          type: string
        instruction:
          description: >-
            A value the finished call is asked for by description, such as "the
            time slot the caller agreed to". Only on an After-call step. `type`
            is worked out from the tool input when left out. When the call does
            not say it: `fallback` is used, else `on_missing` decides - "skip"
            skips the step (the default for a required input), "fail" fails it.
            `fallback` and `on_missing` are not written together. Never sent as
            a guess.
          maxLength: 500
          minLength: 1
          title: Instruction
          type: string
        type:
          anyOf:
            - enum:
                - text
                - number
                - yes_no
                - date
                - datetime
              type: string
            - type: 'null'
          default: null
          title: Type
        on_missing:
          anyOf:
            - enum:
                - skip
                - fail
              type: string
            - type: 'null'
          default: null
          title: On Missing
        fallback:
          anyOf:
            - $ref: '#/components/schemas/WorkflowV1Fallback'
            - type: 'null'
          default: null
      required:
        - kind
        - instruction
      title: ExtractSource
      type: object
    WorkflowV1SequenceStep:
      additionalProperties: false
      description: >-
        A step that may carry a guard and route its outcome.


        Sequence children use all three members. Before and After steps are the
        same

        shape so that a before-call step can route to `#decline`, and the
        publisher

        refuses every other use of them outside a sequence with its own code —
        the

        model is wide enough to state the mistake, not wide enough to run it.
        The

        serializer drops the three members whenever they hold their v1 default,
        so a

        step that declares no branching compiles and hashes to exactly the bytes
        it

        did before they existed.
      properties:
        id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Id
          type: string
        label:
          maxLength: 200
          minLength: 1
          title: Label
          type: string
        binding_id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Binding Id
          type: string
        depends_on:
          items:
            pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
            type: string
          maxItems: 256
          title: Depends On
          type: array
        requires:
          items:
            enum:
              - transcript
              - analysis
              - recording
              - lead
              - billing
            type: string
          title: Requires
          type: array
        on_failure:
          default: stop
          enum:
            - stop
            - continue
          title: On Failure
          type: string
        when:
          anyOf:
            - discriminator:
                mapping:
                  all_of: '#/$defs/AllOf'
                  any_of: '#/$defs/AnyOf'
                  compare: '#/$defs/Comparison'
                  not: '#/$defs/NotCondition'
                propertyName: kind
              oneOf:
                - $ref: '#/components/schemas/WorkflowV1Comparison'
                - $ref: '#/components/schemas/WorkflowV1AllOf'
                - $ref: '#/components/schemas/WorkflowV1AnyOf'
                - $ref: '#/components/schemas/WorkflowV1NotCondition'
            - type: 'null'
          default: null
          title: When
        on_succeeded:
          anyOf:
            - pattern: ^(#end|#decline|[A-Za-z0-9][A-Za-z0-9_-]{0,63})$
              type: string
            - type: 'null'
          default: null
          title: On Succeeded
        on_failed:
          anyOf:
            - pattern: ^(#end|#decline|[A-Za-z0-9][A-Za-z0-9_-]{0,63})$
              type: string
            - type: 'null'
          default: null
          title: On Failed
      required:
        - id
        - label
        - binding_id
      title: SequenceStep
      type: object
    WorkflowV1ConversationNode:
      additionalProperties: false
      properties:
        id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Id
          type: string
        label:
          maxLength: 200
          minLength: 1
          title: Label
          type: string
        type:
          const: conversation
          title: Type
          type: string
        instructions:
          description: >-
            Prose may read a Before-call step's output as
            {{before.<step_id>.<dotted.path>}}, optionally ending with |text
            used when the value is missing. The publisher validates the step and
            the path; the value is substituted once, at session start. {{option
            one|option two}} - two or more plain-text options separated by |,
            the first not starting with before. or call. - is a random
            variation: one option is said, picked once per call.
          maxLength: 100000
          title: Instructions
          type: string
        available_binding_ids:
          items:
            pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
            type: string
          maxItems: 128
          title: Available Binding Ids
          type: array
        binding_overrides:
          anyOf:
            - additionalProperties:
                pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
                type: string
              propertyNames:
                pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
              type: object
            - type: 'null'
          default: null
          description: >-
            Optional. This step's own settings for an action the whole agent
            has: maps the binding id an integration (or a tool for every step)
            owns to a binding of this document that runs the same tool with this
            step's inputs.
          title: Binding Overrides
      required:
        - id
        - label
        - type
        - instructions
      title: ConversationNode
      type: object
    WorkflowV1ActionNode:
      additionalProperties: false
      properties:
        id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Id
          type: string
        label:
          maxLength: 200
          minLength: 1
          title: Label
          type: string
        type:
          const: action
          title: Type
          type: string
        binding_id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Binding Id
          type: string
        hold_line:
          anyOf:
            - maxLength: 28
              minLength: 1
              type: string
            - type: 'null'
          default: null
          description: >-
            A short fixed sentence the caller hears while this step's tool runs,
            such as "One moment please." It starts when the tool starts, in the
            agent's voice, and the agent's next words wait until it has been
            said. At most about 2.5 seconds of speech: up to 28 characters,
            about 25 in Hebrew or Arabic, fewer in Chinese, Japanese or Korean,
            and a digit counts as about three. Fixed text: no {{...}}
            references. Not on a transfer step, which has its own announcement.
          title: Hold Line
      required:
        - id
        - label
        - type
        - binding_id
      title: ActionNode
      type: object
    WorkflowV1SequenceNode:
      additionalProperties: false
      properties:
        id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Id
          type: string
        label:
          maxLength: 200
          minLength: 1
          title: Label
          type: string
        type:
          const: sequence
          title: Type
          type: string
        sequence_id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Sequence Id
          type: string
      required:
        - id
        - label
        - type
        - sequence_id
      title: SequenceNode
      type: object
    WorkflowV1EndNode:
      additionalProperties: false
      properties:
        id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Id
          type: string
        label:
          maxLength: 200
          minLength: 1
          title: Label
          type: string
        type:
          const: end
          title: Type
          type: string
      required:
        - id
        - label
        - type
      title: EndNode
      type: object
    WorkflowV1ConversationEdge:
      additionalProperties: false
      properties:
        id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Id
          type: string
        source:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Source
          type: string
        target:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Target
          type: string
        kind:
          const: conversation
          title: Kind
          type: string
        condition:
          maxLength: 10000
          minLength: 1
          title: Condition
          type: string
      required:
        - id
        - source
        - target
        - kind
        - condition
      title: ConversationEdge
      type: object
    WorkflowV1ResultEdge:
      additionalProperties: false
      properties:
        id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Id
          type: string
        source:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Source
          type: string
        target:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Target
          type: string
        kind:
          const: result
          title: Kind
          type: string
        outcome:
          enum:
            - succeeded
            - failed
          title: Outcome
          type: string
        when:
          anyOf:
            - discriminator:
                mapping:
                  all_of: '#/$defs/AllOf'
                  any_of: '#/$defs/AnyOf'
                  compare: '#/$defs/Comparison'
                  not: '#/$defs/NotCondition'
                propertyName: kind
              oneOf:
                - $ref: '#/components/schemas/WorkflowV1Comparison'
                - $ref: '#/components/schemas/WorkflowV1AllOf'
                - $ref: '#/components/schemas/WorkflowV1AnyOf'
                - $ref: '#/components/schemas/WorkflowV1NotCondition'
            - type: 'null'
          default: null
          description: >-
            Optional, and only on a `succeeded` route in Strict mode. The route
            is taken only when this condition holds for what the step's tool
            answered: it reads fixed values and that step's own answer ({"kind":
            "step", "scope": "during", "step_id": <this edge's source>, "path":
            "/status"}). A step's guarded routes are tried in the order they are
            written; the one `succeeded` route with no condition is taken when
            none of them holds, so a step that has guarded routes must have
            exactly one. A `failed` route never has a condition.
          title: When
      required:
        - id
        - source
        - target
        - kind
        - outcome
      title: ResultEdge
      type: object
    WorkflowV1GlobalEdge:
      additionalProperties: false
      properties:
        id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Id
          type: string
        target:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Target
          type: string
        condition:
          maxLength: 10000
          minLength: 1
          title: Condition
          type: string
      required:
        - id
        - target
        - condition
      title: GlobalEdge
      type: object
    WorkflowV1Comparison:
      additionalProperties: false
      description: |-
        One declarative comparison. `value` is itself a source, so an absent
        right-hand side stays distinguishable from an explicit JSON null.
      properties:
        kind:
          const: compare
          title: Kind
          type: string
        source:
          discriminator:
            mapping:
              call: '#/$defs/CallSource'
              literal: '#/$defs/LiteralSource'
              request: '#/$defs/ContextSource'
              sequence: '#/$defs/ContextSource'
              step: '#/$defs/StepSource'
              stored: '#/$defs/ContextSource'
            propertyName: kind
          oneOf:
            - $ref: '#/components/schemas/WorkflowV1LiteralSource'
            - $ref: '#/components/schemas/WorkflowV1ContextSource'
            - $ref: '#/components/schemas/WorkflowV1StepSource'
            - $ref: '#/components/schemas/WorkflowV1CallSource'
          title: Source
        op:
          enum:
            - exists
            - not_exists
            - eq
            - neq
            - gt
            - gte
            - lt
            - lte
            - contains
            - not_contains
            - in
            - not_in
            - is_true
            - is_false
            - is_empty
            - is_not_empty
          title: Op
          type: string
        value:
          anyOf:
            - discriminator:
                mapping:
                  call: '#/$defs/CallSource'
                  literal: '#/$defs/LiteralSource'
                  request: '#/$defs/ContextSource'
                  sequence: '#/$defs/ContextSource'
                  step: '#/$defs/StepSource'
                  stored: '#/$defs/ContextSource'
                propertyName: kind
              oneOf:
                - $ref: '#/components/schemas/WorkflowV1LiteralSource'
                - $ref: '#/components/schemas/WorkflowV1ContextSource'
                - $ref: '#/components/schemas/WorkflowV1StepSource'
                - $ref: '#/components/schemas/WorkflowV1CallSource'
            - type: 'null'
          default: null
          title: Value
      required:
        - kind
        - source
        - op
      title: Comparison
      type: object
    WorkflowV1AllOf:
      additionalProperties: false
      properties:
        kind:
          const: all_of
          title: Kind
          type: string
        conditions:
          items:
            discriminator:
              mapping:
                all_of: '#/$defs/AllOf'
                any_of: '#/$defs/AnyOf'
                compare: '#/$defs/Comparison'
                not: '#/$defs/NotCondition'
              propertyName: kind
            oneOf:
              - $ref: '#/components/schemas/WorkflowV1Comparison'
              - $ref: '#/components/schemas/WorkflowV1AllOf'
              - $ref: '#/components/schemas/WorkflowV1AnyOf'
              - $ref: '#/components/schemas/WorkflowV1NotCondition'
          maxItems: 16
          minItems: 1
          title: Conditions
          type: array
      required:
        - kind
        - conditions
      title: AllOf
      type: object
    WorkflowV1AnyOf:
      additionalProperties: false
      properties:
        kind:
          const: any_of
          title: Kind
          type: string
        conditions:
          items:
            discriminator:
              mapping:
                all_of: '#/$defs/AllOf'
                any_of: '#/$defs/AnyOf'
                compare: '#/$defs/Comparison'
                not: '#/$defs/NotCondition'
              propertyName: kind
            oneOf:
              - $ref: '#/components/schemas/WorkflowV1Comparison'
              - $ref: '#/components/schemas/WorkflowV1AllOf'
              - $ref: '#/components/schemas/WorkflowV1AnyOf'
              - $ref: '#/components/schemas/WorkflowV1NotCondition'
          maxItems: 16
          minItems: 1
          title: Conditions
          type: array
      required:
        - kind
        - conditions
      title: AnyOf
      type: object
    WorkflowV1NotCondition:
      additionalProperties: false
      properties:
        kind:
          const: not
          title: Kind
          type: string
        condition:
          discriminator:
            mapping:
              all_of: '#/$defs/AllOf'
              any_of: '#/$defs/AnyOf'
              compare: '#/$defs/Comparison'
              not: '#/$defs/NotCondition'
            propertyName: kind
          oneOf:
            - $ref: '#/components/schemas/WorkflowV1Comparison'
            - $ref: '#/components/schemas/WorkflowV1AllOf'
            - $ref: '#/components/schemas/WorkflowV1AnyOf'
            - $ref: '#/components/schemas/WorkflowV1NotCondition'
          title: Condition
      required:
        - kind
        - condition
      title: NotCondition
      type: object
    WorkflowV1Position:
      additionalProperties: false
      properties:
        x:
          title: X
          type: number
        'y':
          title: 'Y'
          type: number
      required:
        - x
        - 'y'
      title: Position
      type: object
    WorkflowV1IntegrationAction:
      additionalProperties: false
      properties:
        action:
          pattern: ^[A-Z0-9_]{1,200}$
          title: Action
          type: string
        binding_id:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
          title: Binding Id
          type: string
      required:
        - action
        - binding_id
      title: IntegrationAction
      type: object
    WorkflowV1ModelOption:
      additionalProperties: false
      properties:
        value:
          maxLength: 500
          minLength: 1
          title: Value
          type: string
        label:
          maxLength: 120
          minLength: 1
          title: Label
          type: string
      required:
        - value
        - label
      title: ModelOption
      type: object
    WorkflowV1Fallback:
      additionalProperties: false
      properties:
        value:
          $ref: '#/components/schemas/WorkflowV1JsonValue'
      required:
        - value
      title: Fallback
      type: object
    WorkflowV1CallSource:
      additionalProperties: false
      description: >-
        A fact the platform recorded about the call itself, in the call
        package's

        own names (`/status`, `/ended_by`, `/disposition/id`, ...).


        Read-only and only for a follow-up's "Only if": a trigger filter may
        read

        the call facts its event guarantees (`trigger_filter.py`), and the

        publisher refuses it anywhere else.
      properties:
        kind:
          const: call
          title: Kind
          type: string
        path:
          maxLength: 300
          pattern: ^/.+$
          title: Path
          type: string
      required:
        - kind
        - path
      title: CallSource
      type: object
  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.