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

# Call automations.set_audience

> Set who an email and text flow reaches, when it starts and when it stops for a person — 'send this to everyone tagged webinar', 'send it to Jane Doe', 'only people in the Proposal stage of my Sales pipeline', 'use my Hot leads view', 'send it Friday at 10am', 'start it every Monday at 9', 'stop once they book a call', 'stop it when they sign up for the Free Course', 'if they reply, stop and tell me', 'stop it when they register for a demo at our other brand and move their deal to Handed off', 'let people go through it again', 'only once per book title', 'nobody new after December 31', 'save these people as a view called Webinar leads'. The audience is the Sales page's tags, pipelines, stages and saved contact views: anyone in any of the tags, and each group you name narrows the others. It is checked again at every send, so someone who leaves it gets nothing more, and an unsubscribe, a stop rule or the last message ends their way through; each stop shows on the person's timeline. A stop rule may name another brand of the company: the same person filling in a form, booking a call or getting a tag there stops this flow, and can move their open deal in this brand to a stage. Another brand's event only ever stops a flow, never starts one. It writes the flow's draft only, with no card: nothing is sent and the running version is unchanged until `automations.activate` turns it on, which raises the approval card; the answer says how many people match now. Every field you leave out keeps what the flow has.

Every result names the workspace it ran in. Say which workspace the answer is about. When the account has more than one workspace and none is selected, this tool refuses with `workspace_ambiguous` and lists the choices — offer them, never pick one.



## OpenAPI

````yaml /openapi.json post /api/v1/tools/automations.set_audience
openapi: 3.1.0
info:
  title: Goosy Bear API
  version: 1.0.0-beta
  summary: Manage workspace content, projects, Data tables, Pages, library and credits.
  description: >-
    BETA. This API is in beta: paths, request shapes and response envelopes may
    change, and every response carries an `x-goosy-api: beta` header for as long
    as that is true. A change is additive, or it is deprecated first: a response
    to a call that uses a deprecated feature carries `Deprecation` and `Sunset`
    headers, and nothing is removed until at least 90 days after its
    deprecation. Pin the OpenAPI document you generated against and re-generate
    when it changes.
servers:
  - url: https://app.goosybear.ai
    description: Production
security:
  - tenantApiKey: []
paths:
  /api/v1/tools/automations.set_audience:
    post:
      tags:
        - automations
      summary: Call automations.set_audience
      description: >-
        Set who an email and text flow reaches, when it starts and when it stops
        for a person — 'send this to everyone tagged webinar', 'send it to Jane
        Doe', 'only people in the Proposal stage of my Sales pipeline', 'use my
        Hot leads view', 'send it Friday at 10am', 'start it every Monday at 9',
        'stop once they book a call', 'stop it when they sign up for the Free
        Course', 'if they reply, stop and tell me', 'stop it when they register
        for a demo at our other brand and move their deal to Handed off', 'let
        people go through it again', 'only once per book title', 'nobody new
        after December 31', 'save these people as a view called Webinar leads'.
        The audience is the Sales page's tags, pipelines, stages and saved
        contact views: anyone in any of the tags, and each group you name
        narrows the others. It is checked again at every send, so someone who
        leaves it gets nothing more, and an unsubscribe, a stop rule or the last
        message ends their way through; each stop shows on the person's
        timeline. A stop rule may name another brand of the company: the same
        person filling in a form, booking a call or getting a tag there stops
        this flow, and can move their open deal in this brand to a stage.
        Another brand's event only ever stops a flow, never starts one. It
        writes the flow's draft only, with no card: nothing is sent and the
        running version is unchanged until `automations.activate` turns it on,
        which raises the approval card; the answer says how many people match
        now. Every field you leave out keeps what the flow has.


        Every result names the workspace it ran in. Say which workspace the
        answer is about. When the account has more than one workspace and none
        is selected, this tool refuses with `workspace_ambiguous` and lists the
        choices — offer them, never pick one.
      operationId: call_automations_set_audience
      parameters:
        - name: x-request-id
          in: header
          required: false
          description: >-
            Your own id for this request, echoed back and recorded on the audit
            trail. 1–128 characters from `A–Z a–z 0–9 . _ : -`, starting with a
            letter or digit; anything else is replaced by a generated id.
          schema:
            type: string
            maxLength: 128
        - name: Idempotency-Key
          in: header
          required: true
          description: >-
            Your key for this write: send the same key when you retry and the
            first result comes back instead of a second action. Keys are
            honoured for at least 24 hours. 1–200 visible ASCII characters.
            Replaces the `idempotency_key` body field, which still works until
            2026-12-31; this action needs a key on one of the two, and the
            header is the one to send.
          schema:
            type: string
            maxLength: 200
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                board_id:
                  type: string
                  minLength: 1
                  description: >-
                    The automation's board id (automations.list gives each
                    automation's board_id). Needed over the API: a call has no
                    open board to fall back on.
                audience:
                  description: >-
                    Who it reaches: name at least one group. It replaces the
                    whole audience the flow had.
                  type: object
                  properties:
                    tags:
                      description: Tag names; a person with any one of them is in.
                      minItems: 1
                      type: array
                      items:
                        type: string
                        minLength: 1
                    exclude_tags:
                      description: >-
                        Tag names to leave out of a one-off or a sequence's
                        audience: a person with any one of them is not reached,
                        even when another group names them ('everyone tagged
                        Bought the book, except people tagged Downloaded
                        toolkit'). Read at each send. It only narrows: name
                        another group too. Not for a flow that starts when
                        something happens (a tag, a form, a booking), which has
                        no audience: skip people with a tag there with a branch
                        step whose arm tests the tag (`automations.bind_step`).
                      minItems: 1
                      type: array
                      items:
                        type: string
                        minLength: 1
                    pipeline_ids:
                      description: >-
                        Pipelines: a person who already has an open deal in any
                        of them is in.
                      minItems: 1
                      type: array
                      items:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                    stage_ids:
                      description: >-
                        Pipeline stages: a person who already has an open deal
                        in any of them is in.
                      minItems: 1
                      type: array
                      items:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                    view_ids:
                      description: >-
                        Saved contact views from the Sales page, by id: a person
                        in any of them is in.
                      minItems: 1
                      type: array
                      items:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                    contact_ids:
                      description: >-
                        Named contacts, by their contact ids: each one is in.
                        For a send to people the member names.
                      minItems: 1
                      type: array
                      items:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                    people:
                      description: >-
                        Named people, by name or email address as the member
                        says them: each is looked up in the workspace's contacts
                        and is in. Never make a tag or view for them.
                      minItems: 1
                      type: array
                      items:
                        type: string
                        minLength: 1
                        maxLength: 200
                  additionalProperties: false
                start:
                  description: >-
                    When it starts: `now` sends to everyone in the audience when
                    it is turned on; `at` sends once, at that date and time, to
                    whoever matches then; `schedule` sends on each tick to
                    whoever matches then; `event` starts it for each person when
                    the event happens to them in this brand, and turning it on
                    also sends to everyone already in the audience. Another
                    brand's event never starts it: put that brand in `brand` and
                    the start is refused, nothing saved.
                  oneOf:
                    - type: object
                      properties:
                        when:
                          type: string
                          const: now
                      required:
                        - when
                      additionalProperties: false
                    - type: object
                      properties:
                        when:
                          type: string
                          const: at
                        local_date_time:
                          type: string
                          pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$
                          description: >-
                            When it sends, once, as `YYYY-MM-DDTHH:mm` on the
                            workspace's clock, e.g. `2026-11-06T10:00`.
                        timezone:
                          description: >-
                            Only when the workspace has no time zone set: an
                            IANA timezone, e.g. `America/Chicago`. Ask rather
                            than assume one.
                          type: string
                          minLength: 1
                          maxLength: 64
                      required:
                        - when
                        - local_date_time
                      additionalProperties: false
                    - type: object
                      properties:
                        when:
                          type: string
                          const: schedule
                        cron:
                          type: string
                          minLength: 1
                          maxLength: 120
                          description: >-
                            Five cron fields, e.g. `0 9 * * 1` for Mondays at
                            9:00; each send reaches whoever matches then.
                        timezone:
                          type: string
                          minLength: 1
                          maxLength: 64
                          description: >-
                            An IANA timezone, e.g. `America/Chicago`. Ask rather
                            than assume one.
                      required:
                        - when
                        - cron
                        - timezone
                      additionalProperties: false
                    - type: object
                      properties:
                        when:
                          type: string
                          const: event
                        event_key:
                          type: string
                          minLength: 1
                          description: >-
                            What happens to a person that starts the flow for
                            them, as the trigger catalogue names it, e.g.
                            `crm.tag_applied`.
                        tag:
                          description: 'For `crm.tag_applied`: the one tag that starts it.'
                          type: string
                          minLength: 1
                        form:
                          description: >-
                            With `event` on `pages.lead.captured`: the one form
                            that starts it, by the name the member calls it
                            (Contact, Newsletter). It is matched to the
                            workspace's forms, and a name that matches none or
                            several is refused with the forms there are. Leave
                            it out only when the member wants any form.
                          type: string
                          minLength: 1
                          maxLength: 120
                        product:
                          description: >-
                            With `event` on `product.purchased`: the one store
                            product whose purchase starts it, by its title as
                            the member says it (Free Starter Course). It is
                            matched to the store's products, and a title that
                            matches none or several is refused with the products
                            it could be. Leave it out only when the member wants
                            any product.
                          type: string
                          minLength: 1
                          maxLength: 255
                        brand:
                          description: >-
                            With `event`: the brand the event happens in, by the
                            name the member calls it, when they name one. A flow
                            starts only on this brand's events; a start naming
                            another brand is refused and nothing is saved, since
                            brands only stop each other's sequences.
                          type: string
                          minLength: 1
                          maxLength: 120
                      required:
                        - when
                        - event_key
                      additionalProperties: false
                goal:
                  description: >-
                    One stop rule: when it happens to a person, they leave the
                    flow and get nothing more; `null` clears it. For more than
                    one, use `stop_rules` instead.
                  anyOf:
                    - type: object
                      properties:
                        event_key:
                          type: string
                          enum:
                            - crm.tag_applied
                            - crm.stage_changed
                            - crm.opportunity_opened
                            - crm.opportunity_closed
                            - appointment.booked
                            - inbox.reply_received
                            - email.opened
                            - email.clicked
                            - pages.lead.captured
                            - sequence.entered
                            - product.purchased
                          description: The event that means the flow did its job.
                        tag:
                          description: 'For `crm.tag_applied`: the tag.'
                          type: string
                          minLength: 1
                        stage_id:
                          description: 'For `crm.stage_changed`: the stage reached.'
                          type: string
                          format: uuid
                          pattern: >-
                            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                        pipeline_id:
                          description: >-
                            For `crm.opportunity_opened` or
                            `crm.opportunity_closed`: the pipeline.
                          type: string
                          format: uuid
                          pattern: >-
                            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                      required:
                        - event_key
                      additionalProperties: false
                    - type: 'null'
                stop_rules:
                  description: >-
                    Every stop rule, any one of which ends the flow for a
                    person; it replaces the goal and the rules the flow had, and
                    `[]` clears them. A reply always ends the flow; a reply rule
                    adds the owner's alert.
                  maxItems: 20
                  type: array
                  items:
                    type: object
                    properties:
                      event_key:
                        type: string
                        enum:
                          - crm.tag_applied
                          - crm.stage_changed
                          - crm.opportunity_opened
                          - crm.opportunity_closed
                          - appointment.booked
                          - inbox.reply_received
                          - email.opened
                          - email.clicked
                          - pages.lead.captured
                          - sequence.entered
                          - product.purchased
                        description: >-
                          What happens to the person that stops the flow for
                          them; `sequence.entered` is entering another of this
                          workspace's sequences.
                      tag:
                        description: 'For `crm.tag_applied`: the tag, e.g. `Not a fit`.'
                        type: string
                        minLength: 1
                      stage_id:
                        description: 'For `crm.stage_changed`: the stage reached.'
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                      pipeline_id:
                        description: >-
                          For `crm.opportunity_opened` or
                          `crm.opportunity_closed`: the pipeline.
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                      sequence_id:
                        description: >-
                          For `sequence.entered`: the other sequence, by its
                          board id in this workspace.
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                      product:
                        description: >-
                          For `product.purchased`: the one store product whose
                          purchase stops it, by its title as the member says it
                          (Free Starter Course). It is matched to the store's
                          products, and a title that matches none or several is
                          refused with the products it could be. Leave it out
                          only when the member wants any product.
                        type: string
                        minLength: 1
                        maxLength: 255
                      alert_owner:
                        description: >-
                          For `inbox.reply_received`: also send the person who
                          turned the flow on an in-app alert to follow up in
                          person.
                        type: boolean
                      brand:
                        description: >-
                          Another brand of the company whose event stops the
                          flow for the same person, by the name the member calls
                          it, exactly as they said it; leave it out for this
                          brand's own events. It is matched to the brands where
                          the member can set up automations, and a name that
                          matches none or several is refused with the brands
                          there are, so pass the member's own words ("the other
                          one", "the coaching side") rather than picking a brand
                          for them. With it, name the event and, for
                          `crm.tag_applied`, the tag; that brand's stages,
                          pipelines and sequences are picked on the flow's When
                          it stops card.
                        type: string
                        minLength: 1
                        maxLength: 120
                      deal_stage:
                        description: >-
                          With `brand`: the stage of this brand's pipeline, by
                          name (Handed to the other brand), that the person's
                          open deal here moves to when that brand's event stops
                          the flow; a won or lost deal stays where it is. It is
                          matched to this brand's stages, and a name that
                          matches none or several is refused with the stages
                          there are.
                        type: string
                        minLength: 1
                        maxLength: 120
                      form:
                        description: >-
                          For `pages.lead.captured`: the one form that stops it,
                          by the name the member calls it (Demo request,
                          Contact); with `brand`, one of that brand's forms. It
                          is matched to that brand's forms, and a name that
                          matches none or several is refused with the forms
                          there are. Leave it out only when the member means any
                          form.
                        type: string
                        minLength: 1
                        maxLength: 120
                    required:
                      - event_key
                    additionalProperties: false
                entry_key_field:
                  description: >-
                    The form field that, with the person, makes an entry unique,
                    e.g. `book_title`: the same person and value never enters
                    twice, a new value does. `null` returns to one entry per
                    person.
                  anyOf:
                    - type: string
                      minLength: 1
                      maxLength: 100
                    - type: 'null'
                reentry:
                  description: >-
                    Whether someone who finished or left can go through again:
                    `off` (each person once, the default), `always`, or
                    `after_days` with `reentry_after_days`.
                  type: string
                  enum:
                    - 'off'
                    - always
                    - after_days
                reentry_after_days:
                  description: >-
                    With `reentry: after_days`: how many days after they
                    finished.
                  type: integer
                  minimum: 1
                  maximum: 3650
                save_as_view:
                  description: >-
                    Saves this audience as a contact view on the Sales page
                    under this name, and the flow reaches that view. Name tags,
                    pipelines or stages in `audience`, not saved views.
                  type: string
                  minLength: 1
                  maxLength: 80
                ends_at:
                  description: >-
                    After this moment nobody new enters; people already in
                    finish. ISO 8601 with its offset; `null` clears it.
                  anyOf:
                    - type: string
                      format: date-time
                      pattern: >-
                        ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                    - type: 'null'
                tracking:
                  description: >-
                    Whether this flow's emails count opens and clicks — 'don't
                    track opens on this one'. Each switch set here overrides the
                    workspace's default from Compliance › Sending rules; `null`
                    returns it to that default. Off, an email carries no
                    tracking image or no rewritten links.
                  type: object
                  properties:
                    opens:
                      description: >-
                        Track opens: `true`, `false`, or `null` for the
                        workspace's default.
                      type:
                        - boolean
                        - 'null'
                    clicks:
                      description: >-
                        Track clicks: `true`, `false`, or `null` for the
                        workspace's default.
                      type:
                        - boolean
                        - 'null'
                  additionalProperties: false
                topic_id:
                  description: >-
                    The email topic this flow's emails go out under, so a person
                    who left that topic on their email preferences page gets
                    none of them: a topic_id `email_topic.list` returned. `null`
                    returns the flow to the workspace's default topic.
                  anyOf:
                    - type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                    - type: 'null'
                include_unengaged:
                  description: >-
                    Whether this flow's emails also go to contacts who have
                    stopped engaging (no open, click, reply, form, booking or
                    purchase in a long while), whom the workspace's emails skip
                    by default — 'send this one to everyone, even people who
                    haven't opened in ages'. `true` includes them for this flow;
                    `null` skips them again. It changes nobody's record; the
                    skip itself is the workspace's setting.
                  type:
                    - boolean
                    - 'null'
                idempotency_key:
                  type: string
                  minLength: 1
                  maxLength: 200
                  description: >-
                    Deprecated on REST: send the `Idempotency-Key` header
                    instead. Still accepted until 2026-12-31; if both are sent
                    they must match.
                workspace:
                  description: >-
                    Which workspace to run in — its slug. Omit to use your
                    default. With more than one reachable workspace and no
                    default, the call is refused and the choices are listed.
                  type: string
                  minLength: 1
              required:
                - board_id
              additionalProperties: false
      responses:
        '200':
          description: >-
            The call was admitted and dispatched. `ok` says whether the tool
            succeeded — a refusal the tool itself produced is still a 200,
            exactly as it is a successful JSON-RPC result over MCP.
          headers:
            x-goosy-api:
              description: Present while this API is in beta; the value is `beta`.
              schema:
                type: string
                const: beta
            x-request-id:
              description: >-
                This request's id: the `x-request-id` you sent when it was well
                formed, otherwise one generated for you. Quote it to support; it
                is recorded on every audit row the call wrote.
              schema:
                type: string
            RateLimit-Limit:
              description: Requests this key may make in a rolling minute.
              schema:
                type: integer
                minimum: 1
            RateLimit-Remaining:
              description: Requests left in the current rolling minute.
              schema:
                type: integer
                minimum: 0
            RateLimit-Reset:
              description: Whole seconds until the window frees more requests.
              schema:
                type: integer
                minimum: 1
            x-goosy-tool-error:
              description: >-
                `true` when a boundary step refused the call — workspace
                resolution failed or could not be read. A tool that ran and
                returned its own typed `ok: false` reports `false` here.
                **Branch on `ok` in the body for the outcome; this header is the
                transport-level hint.**
              schema:
                type: string
                enum:
                  - 'true'
                  - 'false'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    description: The tool ran and answered.
                    properties:
                      ok:
                        type: boolean
                        const: true
                      board_id:
                        type: string
                      display_name:
                        type: string
                      status:
                        type: string
                        const: draft
                      version:
                        type: integer
                        exclusiveMinimum: 0
                      revision:
                        type: integer
                        minimum: 0
                      audience_count:
                        type: integer
                        minimum: 0
                      start:
                        type: string
                        enum:
                          - now
                          - at
                          - schedule
                          - event
                          - unchanged
                      starts_at:
                        type: string
                      form:
                        type: string
                      product:
                        type: string
                      saved_view_id:
                        type: string
                      people:
                        type: array
                        items:
                          type: object
                          properties:
                            contact_id:
                              type: string
                            name:
                              type: string
                            email:
                              type: string
                          required:
                            - contact_id
                            - name
                          additionalProperties: false
                      changed:
                        type: string
                      stop_rules:
                        type: array
                        items:
                          type: object
                          properties:
                            event_key:
                              type: string
                            tag:
                              type: string
                            stage_id:
                              type: string
                            pipeline_id:
                              type: string
                            sequence_id:
                              type: string
                            product_id:
                              type: string
                            alert_owner:
                              type: boolean
                            brand:
                              type: string
                            deal_stage:
                              type: string
                            form:
                              type: string
                          required:
                            - event_key
                          additionalProperties: false
                      replayed:
                        type: boolean
                        description: >-
                          True when this is the first result of an earlier call
                          with the same idempotency_key, returned without
                          writing anything again.
                      workspace:
                        type: string
                        description: The slug of the workspace this call ran in.
                      working_in:
                        type: object
                        properties:
                          label:
                            type: string
                            description: 'The chip words — e.g. "working in: Acme Main".'
                          note:
                            type: string
                            description: >-
                              Why this workspace — e.g. "your default", "this
                              call only".
                          workspace:
                            type: string
                            description: The resolved workspace's slug.
                          source:
                            type: string
                            enum:
                              - call-override
                              - key-pin
                              - stored-default
                              - sole-reachable
                            description: >-
                              Why this workspace was chosen: the call named it
                              (`call-override`), the key is pinned to it
                              (`key-pin`), it is your default
                              (`stored-default`), or it is the only one the key
                              reaches (`sole-reachable`).
                        required:
                          - label
                          - note
                          - workspace
                          - source
                        description: >-
                          Which workspace this call ran in, and how that was
                          decided. Present on every workspace-scoped result.
                        additionalProperties: false
                    required:
                      - ok
                      - board_id
                      - changed
                      - display_name
                      - replayed
                      - start
                      - status
                      - working_in
                      - workspace
                  - $ref: '#/components/schemas/ToolRefusal'
        '400':
          description: >-
            The request could not be used: the body is present but not a JSON
            object (`tenant_api.malformed_body`); it is a top-level array
            carrying more messages than this endpoint accepts
            (`tenant_mcp.batch_too_large`); or the `Idempotency-Key` header is
            malformed (`tenant_api.idempotency_key_invalid`), disagrees with the
            body's `idempotency_key` (`tenant_api.idempotency_key_conflict`), or
            was sent to an action that cannot replay a retry
            (`tenant_api.idempotency_unsupported`). Nothing ran.
          headers:
            x-goosy-api:
              description: Present while this API is in beta; the value is `beta`.
              schema:
                type: string
                const: beta
            x-request-id:
              description: >-
                This request's id: the `x-request-id` you sent when it was well
                formed, otherwise one generated for you. Quote it to support; it
                is recorded on every audit row the call wrote.
              schema:
                type: string
            Deprecation:
              description: >-
                RFC 9745: this refusal's nested `error` object is deprecated,
                since this instant (`@<unix seconds>`).
              schema:
                type: string
            Sunset:
              description: >-
                RFC 8594: the nested `error` object may be removed after this
                date (2026-12-31).
              schema:
                type: string
            Link:
              description: The page that says what to read instead (`rel="deprecation"`).
              schema:
                type: string
            RateLimit-Limit:
              description: Requests this key may make in a rolling minute.
              schema:
                type: integer
                minimum: 1
            RateLimit-Remaining:
              description: Requests left in the current rolling minute.
              schema:
                type: integer
                minimum: 0
            RateLimit-Reset:
              description: Whole seconds until the window frees more requests.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            No bearer credential, or one that did not resolve. Deliberately ONE
            undifferentiated answer for absent / unknown / revoked / expired, so
            the endpoint is never an oracle over the key space.
          headers:
            x-goosy-api:
              description: Present while this API is in beta; the value is `beta`.
              schema:
                type: string
                const: beta
            x-request-id:
              description: >-
                This request's id: the `x-request-id` you sent when it was well
                formed, otherwise one generated for you. Quote it to support; it
                is recorded on every audit row the call wrote.
              schema:
                type: string
            Deprecation:
              description: >-
                RFC 9745: this refusal's nested `error` object is deprecated,
                since this instant (`@<unix seconds>`).
              schema:
                type: string
            Sunset:
              description: >-
                RFC 8594: the nested `error` object may be removed after this
                date (2026-12-31).
              schema:
                type: string
            Link:
              description: The page that says what to read instead (`rel="deprecation"`).
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            The credential is good but the surface is not open to it — the
            platform or account API switch is off, or the holder lacks the
            `api.access` capability. The `code` says which.
          headers:
            x-goosy-api:
              description: Present while this API is in beta; the value is `beta`.
              schema:
                type: string
                const: beta
            x-request-id:
              description: >-
                This request's id: the `x-request-id` you sent when it was well
                formed, otherwise one generated for you. Quote it to support; it
                is recorded on every audit row the call wrote.
              schema:
                type: string
            Deprecation:
              description: >-
                RFC 9745: this refusal's nested `error` object is deprecated,
                since this instant (`@<unix seconds>`).
              schema:
                type: string
            Sunset:
              description: >-
                RFC 8594: the nested `error` object may be removed after this
                date (2026-12-31).
              schema:
                type: string
            Link:
              description: The page that says what to read instead (`rel="deprecation"`).
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            No such tool. The body names no tool and is identical for every
            unrecognised name.
          headers:
            x-goosy-api:
              description: Present while this API is in beta; the value is `beta`.
              schema:
                type: string
                const: beta
            x-request-id:
              description: >-
                This request's id: the `x-request-id` you sent when it was well
                formed, otherwise one generated for you. Quote it to support; it
                is recorded on every audit row the call wrote.
              schema:
                type: string
            Deprecation:
              description: >-
                RFC 9745: this refusal's nested `error` object is deprecated,
                since this instant (`@<unix seconds>`).
              schema:
                type: string
            Sunset:
              description: >-
                RFC 8594: the nested `error` object may be removed after this
                date (2026-12-31).
              schema:
                type: string
            Link:
              description: The page that says what to read instead (`rel="deprecation"`).
              schema:
                type: string
            RateLimit-Limit:
              description: Requests this key may make in a rolling minute.
              schema:
                type: integer
                minimum: 1
            RateLimit-Remaining:
              description: Requests left in the current rolling minute.
              schema:
                type: integer
                minimum: 0
            RateLimit-Reset:
              description: Whole seconds until the window frees more requests.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Over this key's per-minute cap. Carries `Retry-After` and
            `error.retry_after_seconds`.
          headers:
            x-goosy-api:
              description: Present while this API is in beta; the value is `beta`.
              schema:
                type: string
                const: beta
            x-request-id:
              description: >-
                This request's id: the `x-request-id` you sent when it was well
                formed, otherwise one generated for you. Quote it to support; it
                is recorded on every audit row the call wrote.
              schema:
                type: string
            Deprecation:
              description: >-
                RFC 9745: this refusal's nested `error` object is deprecated,
                since this instant (`@<unix seconds>`).
              schema:
                type: string
            Sunset:
              description: >-
                RFC 8594: the nested `error` object may be removed after this
                date (2026-12-31).
              schema:
                type: string
            Link:
              description: The page that says what to read instead (`rel="deprecation"`).
              schema:
                type: string
            RateLimit-Limit:
              description: Requests this key may make in a rolling minute.
              schema:
                type: integer
                minimum: 1
            RateLimit-Remaining:
              description: Requests left in the current rolling minute.
              schema:
                type: integer
                minimum: 0
            RateLimit-Reset:
              description: Whole seconds until the window frees more requests.
              schema:
                type: integer
                minimum: 1
            Retry-After:
              description: Whole seconds to wait before retrying.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ToolRefusal:
      type: object
      properties:
        ok:
          type: boolean
          const: false
        code:
          type: string
          description: >-
            The typed reason — e.g. `workspace_ambiguous`, `invalid_arguments`,
            or the tool's own failure code.
        message:
          type: string
          description: A sentence a person can act on.
        workspaces:
          description: 'On a workspace refusal: the slugs this key may pass as `workspace`.'
          type: array
          items:
            type: string
        issues:
          description: 'On `invalid_arguments`: which fields failed, and why.'
          type: array
          items:
            type: object
            properties:
              path:
                type: string
              message:
                type: string
            required:
              - path
              - message
            additionalProperties: false
        path:
          description: >-
            On an authoring refusal: where in your call's input it points, e.g.
            `steps.<key>.params.<field>`.
          type: string
        fix:
          description: 'On an authoring refusal: the change to your call that would pass.'
          type: string
        instruction:
          description: 'On an authoring refusal: what to do next with it.'
          type: string
      required:
        - ok
        - code
        - message
      description: A call that was admitted and dispatched, and did not succeed.
      additionalProperties: false
    Error:
      type: object
      properties:
        ok:
          type: boolean
          const: false
        code:
          type: string
          description: >-
            The typed refusal code — e.g. `tenant_mcp.rate_limited`,
            `tenant_api.unknown_tool`.
        message:
          type: string
          description: A sentence a person can act on.
        retry_after_seconds:
          description: 'On a 429: whole seconds to wait. Mirrors `Retry-After`.'
          type: number
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            retry_after_seconds:
              type: number
          required:
            - code
            - message
          description: >-
            Deprecated: the same values as the top-level fields, kept until
            2026-12-31. Read `code` and `message` at the top level.
          additionalProperties: false
      required:
        - ok
        - code
        - message
        - error
      description: >-
        A request the boundary refused before dispatching anything. The same
        shape the MCP endpoint answers its own refusals with, and the same
        top-level fields a dispatched call's refusal carries, so one client
        branch covers both.
      additionalProperties: false
  securitySchemes:
    tenantApiKey:
      type: http
      scheme: bearer
      description: >-
        An API key minted at Settings › API & MCP. Send it as `Authorization:
        Bearer <key>`. A key carries its holder's own permissions, resolved on
        every call — revoking a membership closes the key's reach immediately.
        Keep it in an environment variable (`GOOSY_API_KEY`), never in a
        committed file.

````

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