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

> Write or rewrite the words of one message in an Email & text flow or an automation's email or text step — an email's subject, preview text and body, or a text's body — in the workspace's brand voice, or restyle an email's buttons: 'write the welcome email, we groom dogs and open Saturdays', 'make the follow-up shorter and friendlier', 'write the reminder text', 'redo the subject line on email 2', 'polish what I wrote for the welcome', 'make the buttons white text, bigger and rounded', 'turn the buttons into plain text links'. The words are saved as the message's next revision; a step with no message yet gets its first one, and the step is set up to send it. On a flow with no steps yet (one just started), the first write makes its Email 1, or Text 1 for a text. Call it first, on the ask: it reads the message, the brand voice and the content filters itself, so nothing is searched or read before the call, except for a picture in the words (below). Call it once per message with the member's ask as the brief; for every message of the flow, call it for each step. Take flow_id and step_key from the flow on screen or from `email_flow.read_messages`; off the flow's page, put the flow's name as the member said it in flow_name ('change the subject of the Quick question email to Got a minute?'), since every email or text on the Email & text page is a flow, and the member is taken to that flow. When the member asks to change only some of an email's words ('change the subject to Got a minute?', 'just make the body shorter'), name those in fields: every other field is kept exactly as it is. When the member spells out the exact words to change and what they become ('change open Saturdays to open Sundays in every email', 'replace example.com/shop with example.com/store'), pass each pair in replace, once per message; when they do not spell out the words to find ('swap in my new link'), write each message from a brief instead: only the matched text changes, no writing turn is spent, and each answer says how many places changed in that message, so tell the member which messages changed and which held no match. When the member pastes or dictates copy of their own, pass it word for word in member_subject, member_preview_text or member_body: it is kept exactly as given; when they say it may be cleaned up or polished, set polish_member_copy. When they say to leave the preview text empty, pass member_preview_text as an empty string, on the first write as on any later one. An email's body can carry a brand kit picture on a line of its own, such as the sender's headshot under the sign-off ('add Scott's headshot under the sign-off', 'put my photo under my name'): read the picture's asset_id with `brand_kit.read` (library_query naming the picture) and the email's words now with `email_flow.read_messages`, then pass in member_body every line of those words as it is, with {{image.<asset_id>}} alone on the line directly under the sign-off name, and set fields to body; the picture is published when the words are saved, and a body that changes any other word is refused. When the member asks to change how the email's buttons look (colour, text colour, size, weight, corners, width, alignment, a border, or plain text links instead of buttons), put only what they named in button_style, and button when they named one of them: the words are kept unless fields names some, no writing turn is spent, and a colour that is not a hex or a brand colour is refused. It keeps the email's look, spends one writing turn of the workspace's metered credits when it writes, and sends nothing. An email's look or design, or a picture asked for in its design, which is `email_message.set_look` or `email_message.design`, never a change to the words; putting a message back as it was before a change, which is `automations.undo_draft`; or turning the flow on, which is `automations.activate`. Over the API it answers in two calls: without confirmation_id it proposes — says what would happen, returns a confirmation_id and changes, spends and sends nothing; the same arguments again with that confirmation_id, on a member's own API key, do it.

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/email_message.write
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/email_message.write:
    post:
      tags:
        - email_message
      summary: Call email_message.write
      description: >-
        Write or rewrite the words of one message in an Email & text flow or an
        automation's email or text step — an email's subject, preview text and
        body, or a text's body — in the workspace's brand voice, or restyle an
        email's buttons: 'write the welcome email, we groom dogs and open
        Saturdays', 'make the follow-up shorter and friendlier', 'write the
        reminder text', 'redo the subject line on email 2', 'polish what I wrote
        for the welcome', 'make the buttons white text, bigger and rounded',
        'turn the buttons into plain text links'. The words are saved as the
        message's next revision; a step with no message yet gets its first one,
        and the step is set up to send it. On a flow with no steps yet (one just
        started), the first write makes its Email 1, or Text 1 for a text. Call
        it first, on the ask: it reads the message, the brand voice and the
        content filters itself, so nothing is searched or read before the call,
        except for a picture in the words (below). Call it once per message with
        the member's ask as the brief; for every message of the flow, call it
        for each step. Take flow_id and step_key from the flow on screen or from
        `email_flow.read_messages`; off the flow's page, put the flow's name as
        the member said it in flow_name ('change the subject of the Quick
        question email to Got a minute?'), since every email or text on the
        Email & text page is a flow, and the member is taken to that flow. When
        the member asks to change only some of an email's words ('change the
        subject to Got a minute?', 'just make the body shorter'), name those in
        fields: every other field is kept exactly as it is. When the member
        spells out the exact words to change and what they become ('change open
        Saturdays to open Sundays in every email', 'replace example.com/shop
        with example.com/store'), pass each pair in replace, once per message;
        when they do not spell out the words to find ('swap in my new link'),
        write each message from a brief instead: only the matched text changes,
        no writing turn is spent, and each answer says how many places changed
        in that message, so tell the member which messages changed and which
        held no match. When the member pastes or dictates copy of their own,
        pass it word for word in member_subject, member_preview_text or
        member_body: it is kept exactly as given; when they say it may be
        cleaned up or polished, set polish_member_copy. When they say to leave
        the preview text empty, pass member_preview_text as an empty string, on
        the first write as on any later one. An email's body can carry a brand
        kit picture on a line of its own, such as the sender's headshot under
        the sign-off ('add Scott's headshot under the sign-off', 'put my photo
        under my name'): read the picture's asset_id with `brand_kit.read`
        (library_query naming the picture) and the email's words now with
        `email_flow.read_messages`, then pass in member_body every line of those
        words as it is, with {{image.<asset_id>}} alone on the line directly
        under the sign-off name, and set fields to body; the picture is
        published when the words are saved, and a body that changes any other
        word is refused. When the member asks to change how the email's buttons
        look (colour, text colour, size, weight, corners, width, alignment, a
        border, or plain text links instead of buttons), put only what they
        named in button_style, and button when they named one of them: the words
        are kept unless fields names some, no writing turn is spent, and a
        colour that is not a hex or a brand colour is refused. It keeps the
        email's look, spends one writing turn of the workspace's metered credits
        when it writes, and sends nothing. An email's look or design, or a
        picture asked for in its design, which is `email_message.set_look` or
        `email_message.design`, never a change to the words; putting a message
        back as it was before a change, which is `automations.undo_draft`; or
        turning the flow on, which is `automations.activate`. Over the API it
        answers in two calls: without confirmation_id it proposes — says what
        would happen, returns a confirmation_id and changes, spends and sends
        nothing; the same arguments again with that confirmation_id, on a
        member's own API key, do it.


        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_email_message_write
      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
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                flow_id:
                  description: >-
                    The flow's id: the Email & text flow or automation on
                    screen, or one `email_flow.read_messages` named. Omit it on
                    that flow's or automation's own page.
                  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})$
                flow_name:
                  description: >-
                    The flow's or automation's name as the member said it
                    ('Quick question', 'Last chance offer'), when no flow is on
                    screen and no result gave its id; every email or text on the
                    Email & text page is a flow.
                  type: string
                  minLength: 1
                  maxLength: 200
                step_key:
                  type: string
                  minLength: 1
                  maxLength: 200
                  description: >-
                    The message step's key in the flow, as the flow on screen or
                    `email_flow.read_messages` names it (e.g. message_1); its
                    place in the flow ('2' for the second message) is read too.
                channel:
                  description: >-
                    email or sms, only for a step that does not already say
                    which; a step keeps its channel.
                  type: string
                  enum:
                    - email
                    - sms
                brief:
                  type: string
                  maxLength: 4000
                  description: >-
                    What the message should say, in the member's own words (the
                    offer, the news, the tone they asked for). Add nothing they
                    did not say.
                member_subject:
                  description: >-
                    The member's own subject line, word for word, when they gave
                    one.
                  type: string
                  maxLength: 20000
                member_preview_text:
                  description: >-
                    The member's own preview text (the line an inbox shows after
                    the subject), word for word, when they gave one; "" when
                    they asked for none ('leave the preview text empty', 'no
                    preview text'): it is saved empty and stays empty through
                    later rewrites. Leave it out otherwise: an email the member
                    pasted without one keeps none, and an email Goosy writes
                    gets one.
                  type: string
                  maxLength: 20000
                member_body:
                  description: >-
                    The member's own email body or text, word for word, when
                    they pasted or dictated one; or, to add a brand kit picture
                    to an email, the body's words now, every line as it is, with
                    {{image.<asset_id>}} (the picture's asset_id from
                    `brand_kit.read`) alone on its own line where the member
                    asked: directly under the sign-off name for a signature
                    headshot.
                  type: string
                  maxLength: 20000
                polish_member_copy:
                  description: >-
                    true only when the member said their copy may be edited or
                    polished; otherwise their copy is kept exactly as given.
                  type: boolean
                fields:
                  description: >-
                    The fields the member asked to change, when they named only
                    some ('change the subject', 'make the body shorter'); every
                    other field stays exactly as it is. Leave it out to write
                    the whole message.
                  minItems: 1
                  type: array
                  items:
                    type: string
                    enum:
                      - subject
                      - preview_text
                      - body
                button_style:
                  description: >-
                    How the email's buttons look, only when the member asked to
                    change them ('white text, bigger, rounded', 'make them plain
                    text links'): set just the parts they named. A button is a
                    line holding only a link.
                  type: object
                  properties:
                    kind:
                      description: >-
                        button for a filled button; link for an underlined text
                        link.
                      type: string
                      enum:
                        - button
                        - link
                    background:
                      description: >-
                        A colour as a # hex code of six digits, or a brand
                        colour by name: primary, ink, canvas, surface or muted.
                      type: string
                      minLength: 1
                      maxLength: 20
                    text_colour:
                      description: >-
                        A colour as a # hex code of six digits, or a brand
                        colour by name: primary, ink, canvas, surface or muted.
                      type: string
                      minLength: 1
                      maxLength: 20
                    size:
                      description: The label's size; size_px for an exact size instead.
                      type: string
                      enum:
                        - small
                        - medium
                        - large
                    size_px:
                      description: >-
                        The label's size in pixels, 12 to 28, when the member
                        gave a number.
                      type: integer
                      minimum: 12
                      maximum: 28
                    weight:
                      description: How heavy the label is.
                      type: string
                      enum:
                        - regular
                        - semibold
                        - bold
                    corners:
                      description: The corner shape; corner_px for an exact radius instead.
                      type: string
                      enum:
                        - square
                        - rounded
                        - pill
                    corner_px:
                      description: The corner radius in pixels, 0 to 40.
                      type: integer
                      minimum: 0
                      maximum: 40
                    width:
                      description: fit hugs the label; full spans the email.
                      type: string
                      enum:
                        - fit
                        - full
                    align:
                      description: Where the button sits on its line.
                      type: string
                      enum:
                        - left
                        - centre
                    border_px:
                      description: A border's width in pixels, 0 to 4; 0 takes it off.
                      type: integer
                      minimum: 0
                      maximum: 4
                    border_colour:
                      description: >-
                        A colour as a # hex code of six digits, or a brand
                        colour by name: primary, ink, canvas, surface or muted.
                      type: string
                      minLength: 1
                      maxLength: 20
                    arrow:
                      description: A text link's trailing arrow, on or off.
                      type: boolean
                    reset:
                      description: >-
                        true to put the button, or every button, back to the
                        email's own look.
                      type: boolean
                  additionalProperties: false
                button:
                  description: >-
                    Which button, counting from 1 in reading order, when the
                    member named one ('the second button', 'the Book a call
                    button'); leave it out to style every button in the email.
                  type: integer
                  minimum: 1
                  maximum: 20
                replace:
                  description: >-
                    The member's exact text to change and what it becomes, for a
                    find-and-replace the member spells out ('change open
                    Saturdays to open Sundays in every email', 'replace
                    example.com/shop with example.com/store'): each find, case
                    and spacing exactly as the email has it, is replaced
                    everywhere it appears in this message, in order; fields
                    narrows where. Only the matched text changes and no writing
                    turn is spent.
                  minItems: 1
                  maxItems: 20
                  type: array
                  items:
                    type: object
                    properties:
                      find:
                        type: string
                        minLength: 1
                        maxLength: 20000
                        description: The exact text to find, as the member gave it.
                      with:
                        type: string
                        maxLength: 20000
                        description: What it becomes, word for word; "" removes it.
                    required:
                      - find
                      - with
                    additionalProperties: false
                confirmation_id:
                  description: >-
                    Omit to propose: the first call says what would happen,
                    returns a confirmation_id and changes nothing. To go ahead,
                    send the same arguments again with that confirmation_id, on
                    a member's own API key; a service account's key can propose
                    but never confirm.
                  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})$
                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:
                - step_key
                - brief
              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
                      state:
                        type: string
                        const: confirmation_required
                      confirmation_id:
                        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})$
                      expires_in_seconds:
                        type: integer
                        exclusiveMinimum: 0
                      request_summary:
                        type: string
                        description: >-
                          What will happen, in one sentence, for a person to
                          approve before confirming.
                      message_id:
                        type: string
                      step_key:
                        type: string
                      revision:
                        type: integer
                      channel:
                        type: string
                        enum:
                          - email
                          - sms
                          - whatsapp
                      subject:
                        type:
                          - string
                          - 'null'
                      preview_text:
                        type:
                          - string
                          - 'null'
                      words:
                        type: string
                      look:
                        anyOf:
                          - type: string
                            enum:
                              - plain
                              - template
                              - designed
                              - html
                          - type: 'null'
                      reply_to:
                        type:
                          - string
                          - 'null'
                      cc:
                        type: array
                        items:
                          type: string
                      bcc:
                        type: array
                        items:
                          type: string
                      button_styles: {}
                      wrote_by:
                        type: string
                        enum:
                          - writer
                          - member
                          - none
                      replaced:
                        type: object
                        properties:
                          subject:
                            type: integer
                          preview_text:
                            type: integer
                          body:
                            type: integer
                        required:
                          - subject
                          - preview_text
                          - body
                        additionalProperties: false
                      stop_rules:
                        anyOf:
                          - type: array
                            items:
                              type: object
                              properties:
                                event_key:
                                  type: string
                                tag:
                                  type: string
                                stage_id:
                                  type: string
                                pipeline_id:
                                  type: string
                                sequence:
                                  anyOf:
                                    - type: object
                                      properties:
                                        id:
                                          type: string
                                        name:
                                          type: string
                                      required:
                                        - id
                                        - name
                                      additionalProperties: false
                                    - type: 'null'
                                alert_owner:
                                  type: boolean
                              required:
                                - event_key
                              additionalProperties: false
                          - type: 'null'
                      still_unwritten:
                        type: string
                      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
                      - 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.