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

# Send Message

> Send a draft or scheduled message now

Sends a draft or a scheduled message immediately, or at sendAt for an email draft. conversation is the thread, required for an email reply draft.

Requires the `messages:send` scope.


## OpenAPI

````yaml /api-reference/openapi.json post /v1/messages.send
openapi: 3.1.0
info:
  title: Avazal API
  version: '1'
  description: >-
    Every operation is `POST /v1/<concept>.<verb>` with a JSON body, so agents
    and scripts call Avazal the same way. Slack, email, Linear, GitHub and
    calendars are sources behind Avazal's concepts: a task is a task whether it
    lives in a Slack List or Linear.


    Authenticate with an API key from Settings → API keys, sent as `x-api-key:
    avz_…` or `Authorization: Bearer avz_…`. A key acts as the member who
    created it, in one organization, and only with the scopes it was given.


    The MCP server at `/mcp` exposes the same operations as tools.


    Tagged JSON errors that include a `message` also include a machine-readable
    `code` matching `_tag`. Branch on `code`, not the human-readable message.


    Guides, scopes and MCP setup are at https://docs.avazal.com.
servers:
  - url: https://api.avazal.com
    description: Avazal
security:
  - apiKey: []
  - bearer: []
tags:
  - name: me
    x-group: Profile
  - name: accounts
    x-group: Accounts
  - name: settings
    x-group: Settings
  - name: search
    x-group: Search
  - name: inbox
    x-group: Inbox
  - name: conversations
    x-group: Conversations
  - name: messages
    x-group: Messages
  - name: reactions
    x-group: Reactions
  - name: emoji
    x-group: Emoji
  - name: files
    x-group: Files
  - name: people
    x-group: People
  - name: lists
    x-group: Lists
  - name: tasks
    x-group: Tasks
  - name: comments
    x-group: Comments
  - name: links
    x-group: Links
  - name: shares
    x-group: Shares
  - name: documents
    x-group: Documents
  - name: events
    x-group: Events
  - name: notifications
    x-group: Notifications
  - name: triggers
    x-group: Triggers
  - name: runs
    x-group: Runs
  - name: asks
    x-group: Asks
paths:
  /v1/messages.send:
    post:
      tags:
        - messages
      summary: Send a draft or scheduled message now
      description: >-
        Sends a draft or a scheduled message immediately, or at sendAt for an
        email draft. conversation is the thread, required for an email reply
        draft.


        Requires the `messages:send` scope.
      operationId: messages.send
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - id
              properties:
                id:
                  type: string
                  description: >-
                    A message id from messages_list, messages_get or
                    conversations_get.
                conversation:
                  type: string
                  description: A conversation id from conversations_list.
                sendAt:
                  $ref: '#/components/schemas/Date'
              additionalProperties: false
        required: true
      responses:
        '200':
          description: >-
            A chat message or an email, sent, drafted or scheduled. Its id is
            the one every messages operation takes.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicMessage'
        '400':
          description: The request did not match the expected schema
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/HttpApiDecodeError'
                  - $ref: '#/components/schemas/InvalidId'
        '401':
          description: KeyRequired
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KeyRequired'
        '403':
          description: AccessPending
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/AccessPending'
                  - $ref: '#/components/schemas/ScopeRequired'
                  - $ref: '#/components/schemas/OutsideRun'
                  - $ref: '#/components/schemas/ToolNotGranted'
        '409':
          description: AskFirst
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AskFirst'
        '422':
          description: Unsupported
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unsupported'
        '500':
          description: Unexpected server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
        '503':
          description: Service unavailable
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ServerError'
                  - type: object
                    required:
                      - error
                    properties:
                      error:
                        type: string
                    additionalProperties: false
      security:
        - apiKey: []
        - bearer: []
components:
  schemas:
    Date:
      type: string
    PublicMessage:
      type: object
      required:
        - id
        - url
        - source
        - conversation
        - thread
        - state
        - from
        - at
        - markdown
      properties:
        id:
          type: string
          description: The object's id. Every operation that takes it accepts it.
        url:
          anyOf:
            - type: string
            - type: 'null'
          description: A link that opens the object where it lives.
        source:
          $ref: '#/components/schemas/Source'
        conversation:
          anyOf:
            - type: string
            - type: 'null'
          description: The conversation it belongs to, null for a new-email draft.
        thread:
          anyOf:
            - type: string
            - type: 'null'
          description: The thread root's message id when it is a thread reply.
        state:
          type: string
          enum:
            - sent
            - draft
            - scheduled
        from:
          anyOf:
            - type: string
            - type: 'null'
        at:
          anyOf:
            - $ref: '#/components/schemas/Date'
            - type: 'null'
          description: >-
            When it was sent, will be sent (scheduled), or was last edited
            (draft).
        markdown:
          type: string
          description: >-
            The content as markdown, with chat mentions as @name. Email text for
            email.
        saved:
          type: object
          required:
            - state
            - remindAt
          properties:
            state:
              type: string
              enum:
                - in_progress
                - archived
                - completed
            remindAt:
              anyOf:
                - $ref: '#/components/schemas/Date'
                - type: 'null'
          additionalProperties: false
        activity:
          type: object
          required:
            - kind
            - at
            - done
          properties:
            kind:
              type: string
              enum:
                - mention
                - reply
                - reaction
                - dm
            at:
              $ref: '#/components/schemas/Date'
            done:
              type: boolean
          additionalProperties: false
        provider:
          anyOf:
            - type: object
              required:
                - source
                - message
              properties:
                source:
                  type: string
                  enum:
                    - slack
                message:
                  $ref: '#/components/schemas/ChatMessage'
              additionalProperties: false
            - type: object
              required:
                - source
                - subject
                - to
                - cc
                - bcc
                - attachments
              properties:
                source:
                  type: string
                  enum:
                    - gmail
                subject:
                  type: string
                to:
                  type: array
                  items:
                    type: string
                cc:
                  type: array
                  items:
                    type: string
                bcc:
                  type: array
                  items:
                    type: string
                attachments:
                  type: array
                  items:
                    anyOf:
                      - $ref: '#/components/schemas/MailAttachment'
                      - type: object
                        required:
                          - filename
                          - contentType
                          - size
                        properties:
                          filename:
                            type: string
                          contentType:
                            type: string
                          size:
                            $ref: '#/components/schemas/Int'
                            description: a non-negative number
                            title: nonNegative
                            minimum: 0
                        additionalProperties: false
                draft:
                  type: object
                  required:
                    - id
                    - status
                    - editedBody
                    - regenerationFailedAt
                    - signature
                    - recipients
                  properties:
                    id:
                      $ref: '#/components/schemas/DraftId'
                    status:
                      anyOf:
                        - type: object
                          required:
                            - _tag
                            - draft
                          properties:
                            _tag:
                              type: string
                              enum:
                                - Ready
                            draft:
                              $ref: '#/components/schemas/Draft'
                          additionalProperties: false
                        - type: object
                          required:
                            - _tag
                            - draft
                            - before
                          properties:
                            _tag:
                              type: string
                              enum:
                                - Stale
                            draft:
                              $ref: '#/components/schemas/Draft'
                            before:
                              type: object
                              required:
                                - messageId
                                - from
                                - at
                              properties:
                                messageId:
                                  type: string
                                  description: >-
                                    The latest email in the thread when the
                                    draft was written.
                                from:
                                  type: string
                                at:
                                  $ref: '#/components/schemas/Date'
                              additionalProperties: false
                          additionalProperties: false
                        - type: object
                          required:
                            - _tag
                            - edited
                          properties:
                            _tag:
                              type: string
                              enum:
                                - Sent
                            edited:
                              type: boolean
                          additionalProperties: false
                        - type: object
                          required:
                            - _tag
                          properties:
                            _tag:
                              type: string
                              enum:
                                - Discarded
                          additionalProperties: false
                        - type: object
                          required:
                            - _tag
                          properties:
                            _tag:
                              type: string
                              enum:
                                - Superseded
                          additionalProperties: false
                        - type: object
                          required:
                            - _tag
                            - reason
                          properties:
                            _tag:
                              type: string
                              enum:
                                - Failed
                            reason:
                              type: string
                          additionalProperties: false
                    sending:
                      type: object
                      required:
                        - outboxId
                        - status
                        - sendAt
                      properties:
                        outboxId:
                          $ref: '#/components/schemas/OutboxId'
                        status:
                          type: string
                          enum:
                            - scheduled
                            - sending
                            - sent
                            - failed
                            - cancelled
                        sendAt:
                          $ref: '#/components/schemas/Date'
                      additionalProperties: false
                    heldSend:
                      anyOf:
                        - type: string
                          enum:
                            - ownerReplied
                            - draftChanged
                        - type: 'null'
                    editedBody:
                      anyOf:
                        - type: string
                        - type: 'null'
                    regenerationFailedAt:
                      anyOf:
                        - $ref: '#/components/schemas/Date'
                        - type: 'null'
                    signature:
                      anyOf:
                        - type: string
                        - type: 'null'
                    recipients:
                      type: object
                      required:
                        - to
                        - cc
                      properties:
                        to:
                          type: array
                          items:
                            type: string
                        cc:
                          type: array
                          items:
                            type: string
                      additionalProperties: false
                    attachments:
                      type: array
                      items:
                        $ref: '#/components/schemas/MailAttachment'
                    times:
                      anyOf:
                        - type: object
                          required:
                            - slots
                            - taken
                          properties:
                            slots:
                              type: array
                              items:
                                type: object
                                required:
                                  - start
                                  - end
                                  - label
                                properties:
                                  start:
                                    $ref: '#/components/schemas/Date'
                                  end:
                                    $ref: '#/components/schemas/Date'
                                  label:
                                    type: string
                                additionalProperties: false
                            taken:
                              type: array
                              items:
                                type: object
                                required:
                                  - start
                                  - end
                                  - label
                                properties:
                                  start:
                                    $ref: '#/components/schemas/Date'
                                  end:
                                    $ref: '#/components/schemas/Date'
                                  label:
                                    type: string
                                additionalProperties: false
                          additionalProperties: false
                        - type: 'null'
                    acceptance:
                      anyOf:
                        - type: object
                          required:
                            - messageId
                            - by
                            - slot
                            - attendees
                            - conflict
                          properties:
                            messageId:
                              type: string
                              description: The email that asked for the meeting.
                            by:
                              type: string
                            slot:
                              type: object
                              required:
                                - start
                                - end
                                - label
                              properties:
                                start:
                                  $ref: '#/components/schemas/Date'
                                end:
                                  $ref: '#/components/schemas/Date'
                                label:
                                  type: string
                              additionalProperties: false
                            attendees:
                              type: array
                              items:
                                type: string
                            conflict:
                              type: boolean
                          additionalProperties: false
                        - type: 'null'
                  additionalProperties: false
              additionalProperties: false
      additionalProperties: false
      description: >-
        A chat message or an email, sent, drafted or scheduled. Its id is the
        one every messages operation takes.
    HttpApiDecodeError:
      type: object
      required:
        - issues
        - message
        - _tag
        - code
      properties:
        issues:
          type: array
          items:
            $ref: '#/components/schemas/Issue'
        message:
          type: string
        _tag:
          type: string
          enum:
            - HttpApiDecodeError
        code:
          type: string
          enum:
            - HttpApiDecodeError
      additionalProperties: false
      description: The request did not match the expected schema
    InvalidId:
      type: object
      required:
        - id
        - message
        - _tag
        - code
      properties:
        id:
          type: string
          description: The id that was passed and could not be read.
        message:
          type: string
        _tag:
          type: string
          enum:
            - InvalidId
        code:
          type: string
          enum:
            - InvalidId
      additionalProperties: false
    KeyRequired:
      type: object
      required:
        - message
        - _tag
        - code
      properties:
        message:
          type: string
        _tag:
          type: string
          enum:
            - KeyRequired
        code:
          type: string
          enum:
            - KeyRequired
      additionalProperties: false
    AccessPending:
      type: object
      required:
        - _tag
      properties:
        message:
          type: string
        _tag:
          type: string
          enum:
            - AccessPending
        code:
          type: string
          enum:
            - AccessPending
      additionalProperties: false
    ScopeRequired:
      type: object
      required:
        - scope
        - message
        - _tag
        - code
      properties:
        scope:
          $ref: '#/components/schemas/AgentScope'
        message:
          type: string
        _tag:
          type: string
          enum:
            - ScopeRequired
        code:
          type: string
          enum:
            - ScopeRequired
      additionalProperties: false
    OutsideRun:
      type: object
      required:
        - message
        - _tag
        - code
      properties:
        message:
          type: string
        _tag:
          type: string
          enum:
            - OutsideRun
        code:
          type: string
          enum:
            - OutsideRun
      additionalProperties: false
    ToolNotGranted:
      type: object
      required:
        - tool
        - message
        - _tag
        - code
      properties:
        tool:
          type: string
        message:
          type: string
        _tag:
          type: string
          enum:
            - ToolNotGranted
        code:
          type: string
          enum:
            - ToolNotGranted
      additionalProperties: false
    AskFirst:
      type: object
      required:
        - action
        - message
        - _tag
        - code
      properties:
        action:
          type: object
          required:
            - tool
            - input
          properties:
            tool:
              $ref: '#/components/schemas/OperationName'
            input:
              type: object
              required: []
              properties: {}
              additionalProperties:
                $id: /schemas/unknown
                title: unknown
          additionalProperties: false
        message:
          type: string
        _tag:
          type: string
          enum:
            - AskFirst
        code:
          type: string
          enum:
            - AskFirst
      additionalProperties: false
    Unsupported:
      type: object
      required:
        - message
        - _tag
        - code
      properties:
        message:
          type: string
        _tag:
          type: string
          enum:
            - Unsupported
        code:
          type: string
          enum:
            - Unsupported
      additionalProperties: false
    ServerError:
      type: object
      required:
        - traceId
        - _tag
      properties:
        message:
          type: string
        traceId:
          type: string
          description: The request trace ID, also sent in the x-trace-id header.
        _tag:
          type: string
          enum:
            - ServerError
        code:
          type: string
          enum:
            - ServerError
      additionalProperties: false
    Source:
      type: string
      enum:
        - avazal
        - slack
        - gmail
        - google-calendar
        - google-drive
        - linear
        - github
        - contacts
      description: Where the object lives. Avazal is the source of its own objects.
    ChatMessage:
      type: object
      required:
        - conversationId
        - id
        - sentAt
        - author
        - kind
        - system
        - content
        - attachments
        - thread
        - editedAt
        - restricted
        - files
        - reactions
        - pinned
        - deletedAt
      properties:
        conversationId:
          $ref: '#/components/schemas/ConversationId'
        id:
          $ref: '#/components/schemas/SlackMessageId'
        sentAt:
          $ref: '#/components/schemas/Date'
        author:
          anyOf:
            - type: object
              required:
                - _tag
                - memberId
              properties:
                _tag:
                  type: string
                  enum:
                    - Member
                memberId:
                  $ref: '#/components/schemas/SlackMemberId'
                identityId:
                  $ref: '#/components/schemas/AgentIdentityId'
              additionalProperties: false
            - type: object
              required:
                - _tag
                - appId
                - name
                - iconUrl
                - iconEmoji
                - memberId
              properties:
                _tag:
                  type: string
                  enum:
                    - App
                appId:
                  $ref: '#/components/schemas/SlackAppId'
                name:
                  type: string
                iconUrl:
                  anyOf:
                    - type: string
                    - type: 'null'
                iconEmoji:
                  anyOf:
                    - type: string
                    - type: 'null'
                memberId:
                  anyOf:
                    - $ref: '#/components/schemas/SlackMemberId'
                    - type: 'null'
                botId:
                  $ref: '#/components/schemas/SlackBotId'
                identityId:
                  $ref: '#/components/schemas/AgentIdentityId'
              additionalProperties: false
            - type: object
              required:
                - _tag
              properties:
                _tag:
                  type: string
                  enum:
                    - Unknown
              additionalProperties: false
        kind:
          type: string
          enum:
            - message
            - me
            - system
            - app
        system:
          anyOf:
            - anyOf:
                - type: object
                  required:
                    - _tag
                    - memberId
                    - inviterId
                  properties:
                    _tag:
                      type: string
                      enum:
                        - joined
                    memberId:
                      $ref: '#/components/schemas/SlackMemberId'
                    inviterId:
                      anyOf:
                        - $ref: '#/components/schemas/SlackMemberId'
                        - type: 'null'
                  additionalProperties: false
                - type: object
                  required:
                    - _tag
                    - memberId
                  properties:
                    _tag:
                      type: string
                      enum:
                        - left
                    memberId:
                      $ref: '#/components/schemas/SlackMemberId'
                  additionalProperties: false
                - type: object
                  required:
                    - _tag
                    - oldName
                    - name
                  properties:
                    _tag:
                      type: string
                      enum:
                        - renamed
                    oldName:
                      type: string
                    name:
                      type: string
                  additionalProperties: false
                - type: object
                  required:
                    - _tag
                    - topic
                  properties:
                    _tag:
                      type: string
                      enum:
                        - topic
                    topic:
                      type: string
                  additionalProperties: false
                - type: object
                  required:
                    - _tag
                    - purpose
                  properties:
                    _tag:
                      type: string
                      enum:
                        - purpose
                    purpose:
                      type: string
                  additionalProperties: false
                - type: object
                  required:
                    - _tag
                    - messageId
                  properties:
                    _tag:
                      type: string
                      enum:
                        - pinned
                    messageId:
                      anyOf:
                        - $ref: '#/components/schemas/SlackMessageId'
                        - type: 'null'
                  additionalProperties: false
                - type: object
                  required:
                    - _tag
                    - startedAt
                    - endedAt
                    - memberIds
                  properties:
                    _tag:
                      type: string
                      enum:
                        - huddle
                    startedAt:
                      $ref: '#/components/schemas/Date'
                    endedAt:
                      anyOf:
                        - $ref: '#/components/schemas/Date'
                        - type: 'null'
                    memberIds:
                      type: array
                      items:
                        $ref: '#/components/schemas/SlackMemberId'
                  additionalProperties: false
                - type: object
                  required:
                    - _tag
                  properties:
                    _tag:
                      type: string
                      enum:
                        - archived
                  additionalProperties: false
                - type: object
                  required:
                    - _tag
                  properties:
                    _tag:
                      type: string
                      enum:
                        - unarchived
                  additionalProperties: false
                - type: object
                  required:
                    - _tag
                  properties:
                    _tag:
                      type: string
                      enum:
                        - unpinned
                  additionalProperties: false
                - type: object
                  required:
                    - _tag
                    - to
                  properties:
                    _tag:
                      type: string
                      enum:
                        - converted
                    to:
                      type: string
                      enum:
                        - private
                        - public
                  additionalProperties: false
                - type: object
                  required:
                    - _tag
                  properties:
                    _tag:
                      type: string
                      enum:
                        - posting
                  additionalProperties: false
                - type: object
                  required:
                    - _tag
                  properties:
                    _tag:
                      type: string
                      enum:
                        - tombstone
                  additionalProperties: false
                - type: object
                  required:
                    - _tag
                    - subtype
                  properties:
                    _tag:
                      type: string
                      enum:
                        - unknown
                    subtype:
                      type: string
                  additionalProperties: false
            - type: 'null'
        content:
          $ref: '#/components/schemas/RichText'
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/MessageAttachment'
        thread:
          anyOf:
            - type: object
              required:
                - rootId
                - replyCount
                - replyMemberIds
                - latestReplyAt
                - broadcast
                - locked
                - following
                - rootPreview
                - replyApps
              properties:
                rootId:
                  $ref: '#/components/schemas/SlackThreadRootId'
                replyCount:
                  $ref: '#/components/schemas/NonNegativeInt'
                replyMemberIds:
                  type: array
                  items:
                    $ref: '#/components/schemas/SlackMemberId'
                latestReplyAt:
                  anyOf:
                    - $ref: '#/components/schemas/Date'
                    - type: 'null'
                broadcast:
                  type: boolean
                locked:
                  type: boolean
                following:
                  type: boolean
                rootPreview:
                  anyOf:
                    - type: string
                    - type: 'null'
                replyApps:
                  type: array
                  items:
                    type: object
                    required:
                      - appId
                      - name
                      - iconUrl
                      - iconEmoji
                      - memberId
                    properties:
                      appId:
                        $ref: '#/components/schemas/SlackAppId'
                      name:
                        type: string
                      iconUrl:
                        anyOf:
                          - type: string
                          - type: 'null'
                      iconEmoji:
                        anyOf:
                          - type: string
                          - type: 'null'
                      memberId:
                        anyOf:
                          - $ref: '#/components/schemas/SlackMemberId'
                          - type: 'null'
                      botId:
                        $ref: '#/components/schemas/SlackBotId'
                      identityId:
                        $ref: '#/components/schemas/AgentIdentityId'
                    additionalProperties: false
              additionalProperties: false
            - type: 'null'
        editedAt:
          anyOf:
            - $ref: '#/components/schemas/Date'
            - type: 'null'
        restricted:
          anyOf:
            - type: string
              enum:
                - plan
                - ekm
            - type: 'null'
        files:
          type: array
          items:
            type: object
            required:
              - id
              - name
              - title
              - mimeType
              - fileType
              - mode
              - size
              - imageSize
              - access
              - deletedAt
            properties:
              id:
                $ref: '#/components/schemas/SlackFileId'
              name:
                type: string
              title:
                anyOf:
                  - type: string
                  - type: 'null'
              mimeType:
                anyOf:
                  - type: string
                  - type: 'null'
              fileType:
                anyOf:
                  - type: string
                  - type: 'null'
              mode:
                type: string
                enum:
                  - hosted
                  - snippet
                  - canvas
                  - list
                  - remote
                  - huddle_notes
              size:
                anyOf:
                  - $ref: '#/components/schemas/NonNegativeInt'
                  - type: 'null'
              imageSize:
                anyOf:
                  - type: object
                    required:
                      - width
                      - height
                    properties:
                      width:
                        $ref: '#/components/schemas/Int'
                      height:
                        $ref: '#/components/schemas/Int'
                    additionalProperties: false
                  - type: 'null'
              preview:
                anyOf:
                  - type: string
                    description: a string at most 8192 character(s) long
                    title: maxLength(8192)
                    pattern: ^data:image/jpeg;base64,
                    maxLength: 8192
                  - type: 'null'
              durationMs:
                anyOf:
                  - $ref: '#/components/schemas/NonNegativeInt'
                  - type: 'null'
              editedAt:
                anyOf:
                  - $ref: '#/components/schemas/Date'
                  - type: 'null'
              access:
                type: string
                enum:
                  - ok
                  - check
              deletedAt:
                anyOf:
                  - $ref: '#/components/schemas/Date'
                  - type: 'null'
            additionalProperties: false
        reactions:
          type: array
          items:
            type: object
            required:
              - emoji
              - count
              - memberIds
            properties:
              emoji:
                type: string
              count:
                $ref: '#/components/schemas/NonNegativeInt'
              memberIds:
                type: array
                items:
                  $ref: '#/components/schemas/SlackMemberId'
              url:
                type: string
            additionalProperties: false
        pinned:
          type: boolean
        deletedAt:
          anyOf:
            - $ref: '#/components/schemas/Date'
            - type: 'null'
      additionalProperties: false
      description: A chat message with its author, content, thread, files and reactions.
    MailAttachment:
      type: object
      required:
        - key
        - filename
        - contentType
        - size
      properties:
        key:
          type: string
          description: a string matching the pattern ^org\/[^/\s]+\/att_[0-9a-z]+$
          pattern: ^org\/[^/\s]+\/att_[0-9a-z]+$
        filename:
          type: string
        contentType:
          type: string
          description: a string matching the pattern ^[\w.+-]+\/[\w.+-]+$
          pattern: ^[\w.+-]+\/[\w.+-]+$
        size:
          $ref: '#/components/schemas/Int'
          description: a non-negative number
          title: nonNegative
          minimum: 0
      additionalProperties: false
      description: An uploaded file to attach to an email, by its storage key.
    Int:
      type: integer
      title: int
    DraftId:
      type: string
      title: '`mdrf_${string}`'
      description: Reply draft on a mail thread
      pattern: ^mdrf_[\s\S]*?$
    Draft:
      type: object
      required:
        - body
        - gaps
      properties:
        body:
          type: string
          description: >-
            The drafted reply, with a {{gap:id}} token wherever it needs
            something only you know.
          title: nonEmptyString
        gaps:
          type: array
          items:
            type: object
            required:
              - id
              - label
              - question
            properties:
              id:
                $ref: '#/components/schemas/Int'
                description: >-
                  Numbers a gap the draft left for you to fill, matching its
                  {{gap:id}} token.
                title: positive
              label:
                type: string
                description: a string at most 60 character(s) long
                title: maxLength(60)
                minLength: 1
                maxLength: 60
              question:
                type: string
                description: What to ask the person to fill the gap.
                title: nonEmptyString
            additionalProperties: false
      additionalProperties: false
    OutboxId:
      type: string
      title: '`mout_${string}`'
      description: Email waiting to send
      pattern: ^mout_[\s\S]*?$
    Issue:
      type: object
      required:
        - _tag
        - path
        - message
      properties:
        _tag:
          type: string
          enum:
            - Pointer
            - Unexpected
            - Missing
            - Composite
            - Refinement
            - Transformation
            - Type
            - Forbidden
          description: The tag identifying the type of parse issue
        path:
          type: array
          items:
            $ref: '#/components/schemas/PropertyKey'
          description: The path to the property where the issue occurred
        message:
          type: string
          description: A descriptive message explaining the issue
      additionalProperties: false
      description: >-
        Represents an error encountered while parsing a value to match the
        schema
    AgentScope:
      type: string
      enum:
        - messages:read
        - messages:write
        - messages:send
        - tasks:read
        - tasks:write
        - documents:read
        - documents:write
        - events:read
        - events:write
        - people:read
        - people:write
        - automations:read
        - automations:write
        - settings:read
        - settings:write
        - search:read
      description: A concept and the action an agent may take on it.
    OperationName:
      type: string
      description: An Avazal tool name, e.g. messages_send.
      pattern: ^[a-z]+_[a-z_]+$
    ConversationId:
      type: string
      title: '`chcv_${string}`'
      description: Slack channel or DM
      pattern: ^chcv_[\s\S]*?$
    SlackMessageId:
      type: string
      description: >-
        A Slack message, named by its timestamp such as 1733050000.123456, the
        ts in its permalink. From messages_list, conversations_get, search_query
        or search_resolve.
      title: minLength(1)
      minLength: 1
    SlackMemberId:
      type: string
      description: A Slack member id, such as U0123ABCD. From people_list.
      title: minLength(1)
      minLength: 1
    AgentIdentityId:
      type: string
      title: '`agid_${string}`'
      description: Agent identity
      pattern: ^agid_[\s\S]*?$
    SlackAppId:
      type: string
      description: A Slack app id, such as A0123ABCD, for an app that posts or unfurls.
      title: minLength(1)
      minLength: 1
    SlackBotId:
      type: string
      description: A Slack bot id, such as B0123ABCD, that an app posts with.
      title: minLength(1)
      minLength: 1
    RichText:
      type: object
      required:
        - blocks
      properties:
        blocks:
          type: array
          items:
            $ref: '#/components/schemas/RichTextBlock'
      additionalProperties: false
      description: Formatted content as a list of blocks.
    MessageAttachment:
      anyOf:
        - type: object
          required:
            - _tag
            - url
            - title
            - text
            - imageUrl
            - imageSize
            - service
            - serviceIconUrl
          properties:
            _tag:
              type: string
              enum:
                - Unfurl
            url:
              type: string
            title:
              anyOf:
                - type: string
                - type: 'null'
            text:
              anyOf:
                - type: string
                - type: 'null'
            imageUrl:
              anyOf:
                - type: string
                - type: 'null'
            imageSize:
              anyOf:
                - type: object
                  required:
                    - width
                    - height
                  properties:
                    width:
                      $ref: '#/components/schemas/Int'
                    height:
                      $ref: '#/components/schemas/Int'
                  additionalProperties: false
                - type: 'null'
            service:
              anyOf:
                - type: string
                - type: 'null'
            serviceIconUrl:
              anyOf:
                - type: string
                - type: 'null'
            thumbUrl:
              anyOf:
                - type: string
                - type: 'null'
            video:
              type: boolean
          additionalProperties: false
        - type: object
          required:
            - _tag
            - conversationExternalId
            - messageId
            - preview
          properties:
            _tag:
              type: string
              enum:
                - MessageShare
            conversationExternalId:
              $ref: '#/components/schemas/SlackChannelId'
            messageId:
              $ref: '#/components/schemas/SlackMessageId'
            fileIds:
              type: array
              items:
                $ref: '#/components/schemas/SlackFileId'
            preview:
              anyOf:
                - type: object
                  required:
                    - authorName
                    - text
                  properties:
                    authorName:
                      anyOf:
                        - type: string
                        - type: 'null'
                    authorIconUrl:
                      anyOf:
                        - type: string
                        - type: 'null'
                    text:
                      type: string
                    blocks:
                      type: array
                      items:
                        $id: /schemas/unknown
                        title: unknown
                    inThread:
                      type: boolean
                    replyCount:
                      anyOf:
                        - $ref: '#/components/schemas/NonNegativeInt'
                        - type: 'null'
                  additionalProperties: false
                - type: 'null'
          additionalProperties: false
        - type: object
          required:
            - _tag
            - title
            - titleUrl
            - pretext
            - text
            - authorName
            - authorIconUrl
            - fields
            - imageUrl
            - footer
            - color
          properties:
            _tag:
              type: string
              enum:
                - Card
            title:
              anyOf:
                - type: string
                - type: 'null'
            titleUrl:
              anyOf:
                - type: string
                - type: 'null'
            pretext:
              anyOf:
                - $ref: '#/components/schemas/RichText'
                - type: 'null'
            text:
              anyOf:
                - $ref: '#/components/schemas/RichText'
                - type: 'null'
            authorName:
              anyOf:
                - type: string
                - type: 'null'
            authorIconUrl:
              anyOf:
                - type: string
                - type: 'null'
            fields:
              type: array
              items:
                type: object
                required:
                  - title
                  - value
                  - short
                properties:
                  title:
                    type: string
                  value:
                    anyOf:
                      - type: string
                      - $ref: '#/components/schemas/RichText'
                  short:
                    type: boolean
                additionalProperties: false
            imageUrl:
              anyOf:
                - type: string
                - type: 'null'
            thumbUrl:
              anyOf:
                - type: string
                - type: 'null'
            footer:
              anyOf:
                - type: string
                - type: 'null'
            footerIconUrl:
              anyOf:
                - type: string
                - type: 'null'
            at:
              anyOf:
                - $ref: '#/components/schemas/Date'
                - type: 'null'
            color:
              anyOf:
                - type: string
                - type: 'null'
          additionalProperties: false
        - type: object
          required:
            - _tag
            - provider
            - payload
          properties:
            _tag:
              type: string
              enum:
                - ProviderBlocks
            provider:
              type: string
              enum:
                - slack
                - teams
                - sandbox
            payload:
              $id: /schemas/unknown
              title: unknown
            frame:
              anyOf:
                - type: object
                  required:
                    - source
                    - iconUrl
                    - color
                  properties:
                    source:
                      anyOf:
                        - type: string
                        - type: 'null'
                    iconUrl:
                      anyOf:
                        - type: string
                        - type: 'null'
                    color:
                      anyOf:
                        - type: string
                        - type: 'null'
                  additionalProperties: false
                - type: 'null'
          additionalProperties: false
        - type: object
          required:
            - _tag
            - url
            - sourceId
            - sourceTitle
            - fields
            - task
          properties:
            _tag:
              type: string
              enum:
                - TaskPreview
            url:
              type: string
            sourceId:
              $ref: '#/components/schemas/SlackFileId'
            sourceTitle:
              anyOf:
                - type: string
                - type: 'null'
            fields:
              type: array
              items:
                $ref: '#/components/schemas/TaskField'
            task:
              $ref: '#/components/schemas/Task'
          additionalProperties: false
        - type: object
          required:
            - _tag
            - appId
            - url
            - source
            - title
            - subtitle
            - fields
            - actions
            - updatedAt
          properties:
            _tag:
              type: string
              enum:
                - WorkObject
            appId:
              anyOf:
                - $ref: '#/components/schemas/SlackAppId'
                - type: 'null'
            url:
              anyOf:
                - type: string
                - type: 'null'
            source:
              anyOf:
                - type: string
                - type: 'null'
            title:
              type: string
            subtitle:
              anyOf:
                - type: string
                - type: 'null'
            fields:
              type: array
              items:
                type: object
                required:
                  - label
                  - value
                properties:
                  label:
                    type: string
                  value:
                    anyOf:
                      - type: object
                        required:
                          - _tag
                          - tags
                        properties:
                          _tag:
                            type: string
                            enum:
                              - Tags
                          tags:
                            type: array
                            items:
                              type: object
                              required:
                                - label
                                - color
                              properties:
                                label:
                                  type: string
                                color:
                                  anyOf:
                                    - type: string
                                    - type: 'null'
                              additionalProperties: false
                        additionalProperties: false
                      - type: object
                        required:
                          - _tag
                          - memberIds
                        properties:
                          _tag:
                            type: string
                            enum:
                              - Members
                          memberIds:
                            type: array
                            items:
                              $ref: '#/components/schemas/SlackMemberId'
                        additionalProperties: false
                      - type: object
                        required:
                          - _tag
                          - at
                        properties:
                          _tag:
                            type: string
                            enum:
                              - Timestamp
                          at:
                            $ref: '#/components/schemas/Date'
                        additionalProperties: false
                      - type: object
                        required:
                          - _tag
                          - text
                        properties:
                          _tag:
                            type: string
                            enum:
                              - Text
                          text:
                            $ref: '#/components/schemas/RichText'
                        additionalProperties: false
                additionalProperties: false
            actions:
              type: array
              items:
                type: object
                required:
                  - label
                  - url
                  - tone
                properties:
                  label:
                    type: string
                  url:
                    anyOf:
                      - type: string
                      - type: 'null'
                  tone:
                    type: string
                    enum:
                      - primary
                      - default
                      - danger
                additionalProperties: false
            updatedAt:
              anyOf:
                - $ref: '#/components/schemas/Date'
                - type: 'null'
          additionalProperties: false
      description: >-
        A link unfurl, shared message, card, app blocks, task preview or work
        object attached to a message.
    SlackThreadRootId:
      type: string
      description: >-
        The messageId of a thread's first message. From messages_list or
        messages_get.
      title: minLength(1)
      minLength: 1
    NonNegativeInt:
      type: integer
      title: int
      minimum: 0
    SlackFileId:
      type: string
      description: >-
        A Slack file id, such as F0123ABCD, for a file, List or canvas. From
        files_list, lists_list or documents_list.
      title: minLength(1)
      minLength: 1
    PropertyKey:
      anyOf:
        - type: string
        - type: number
        - type: object
          required:
            - _tag
            - key
          properties:
            _tag:
              type: string
              enum:
                - symbol
            key:
              type: string
          additionalProperties: false
    RichTextBlock:
      anyOf:
        - type: object
          required:
            - _tag
            - inlines
          properties:
            _tag:
              type: string
              enum:
                - Section
            inlines:
              type: array
              items:
                $ref: '#/components/schemas/RichTextInline'
          additionalProperties: false
        - type: object
          required:
            - _tag
            - style
            - indent
            - items
          properties:
            _tag:
              type: string
              enum:
                - List
            style:
              type: string
              enum:
                - bullet
                - ordered
            indent:
              $ref: '#/components/schemas/NonNegativeInt'
            offset:
              $ref: '#/components/schemas/NonNegativeInt'
            items:
              type: array
              items:
                type: array
                items:
                  $ref: '#/components/schemas/RichTextInline'
          additionalProperties: false
        - type: object
          required:
            - _tag
            - inlines
          properties:
            _tag:
              type: string
              enum:
                - Quote
            inlines:
              type: array
              items:
                $ref: '#/components/schemas/RichTextInline'
          additionalProperties: false
        - type: object
          required:
            - _tag
            - inlines
          properties:
            _tag:
              type: string
              enum:
                - Code
            inlines:
              type: array
              items:
                anyOf:
                  - type: object
                    required:
                      - _tag
                      - text
                    properties:
                      _tag:
                        type: string
                        enum:
                          - Text
                      text:
                        type: string
                      style:
                        type: object
                        required: []
                        properties:
                          bold:
                            type: boolean
                          italic:
                            type: boolean
                          strike:
                            type: boolean
                          underline:
                            type: boolean
                          code:
                            type: boolean
                        additionalProperties: false
                    additionalProperties: false
                  - type: object
                    required:
                      - _tag
                      - url
                    properties:
                      _tag:
                        type: string
                        enum:
                          - Link
                      url:
                        type: string
                      text:
                        type: string
                      style:
                        type: object
                        required: []
                        properties:
                          bold:
                            type: boolean
                          italic:
                            type: boolean
                          strike:
                            type: boolean
                          underline:
                            type: boolean
                          code:
                            type: boolean
                        additionalProperties: false
                    additionalProperties: false
            language:
              type: string
          additionalProperties: false
      description: A section, list, quote or code block.
    SlackChannelId:
      type: string
      description: >-
        Slack's own id for a channel or DM, such as C0123ABCD. Operations take
        the Avazal conversationId from conversations_list instead.
      title: minLength(1)
      minLength: 1
    TaskField:
      type: object
      required:
        - id
        - name
        - type
        - role
        - editable
        - system
      properties:
        id:
          type: string
          description: A column of the list, the fieldId item writes take. From lists_get.
        name:
          type: string
        type:
          anyOf:
            - type: object
              required:
                - _tag
              properties:
                _tag:
                  type: string
                  enum:
                    - Text
              additionalProperties: false
            - type: object
              required:
                - _tag
                - variant
                - multi
                - options
              properties:
                _tag:
                  type: string
                  enum:
                    - Choice
                variant:
                  type: string
                  enum:
                    - select
                    - status
                    - priority
                multi:
                  type: boolean
                options:
                  type: array
                  items:
                    type: object
                    required:
                      - id
                      - label
                      - color
                      - group
                    properties:
                      id:
                        type: string
                        description: >-
                          A choice in a select field. Choices values take these
                          in ids. From lists_get.
                      label:
                        type: string
                      color:
                        anyOf:
                          - type: string
                          - type: 'null'
                      group:
                        anyOf:
                          - type: string
                            enum:
                              - backlog
                              - todo
                              - doing
                              - done
                              - canceled
                          - type: 'null'
                    additionalProperties: false
              additionalProperties: false
            - type: object
              required:
                - _tag
                - multi
              properties:
                _tag:
                  type: string
                  enum:
                    - Person
                multi:
                  type: boolean
              additionalProperties: false
            - type: object
              required:
                - _tag
              properties:
                _tag:
                  type: string
                  enum:
                    - Date
              additionalProperties: false
            - type: object
              required:
                - _tag
              properties:
                _tag:
                  type: string
                  enum:
                    - Number
              additionalProperties: false
            - type: object
              required:
                - _tag
              properties:
                _tag:
                  type: string
                  enum:
                    - Checkbox
              additionalProperties: false
            - type: object
              required:
                - _tag
                - max
              properties:
                _tag:
                  type: string
                  enum:
                    - Rating
                max:
                  $ref: '#/components/schemas/Int'
              additionalProperties: false
            - type: object
              required:
                - _tag
              properties:
                _tag:
                  type: string
                  enum:
                    - Vote
              additionalProperties: false
            - type: object
              required:
                - _tag
              properties:
                _tag:
                  type: string
                  enum:
                    - Link
              additionalProperties: false
            - type: object
              required:
                - _tag
                - kind
              properties:
                _tag:
                  type: string
                  enum:
                    - Contact
                kind:
                  type: string
                  enum:
                    - email
                    - phone
              additionalProperties: false
            - type: object
              required:
                - _tag
              properties:
                _tag:
                  type: string
                  enum:
                    - Ref
                accepts:
                  type: string
                  enum:
                    - message
                    - file
                    - canvas
                    - record
                    - channel
              additionalProperties: false
            - type: object
              required:
                - _tag
              properties:
                _tag:
                  type: string
                  enum:
                    - Agent
              additionalProperties: false
            - type: object
              required:
                - _tag
                - label
              properties:
                _tag:
                  type: string
                  enum:
                    - Unknown
                label:
                  type: string
              additionalProperties: false
        role:
          anyOf:
            - type: string
              enum:
                - title
                - done
                - assignee
                - due
                - priority
                - status
            - type: 'null'
        editable:
          type: boolean
        system:
          type: boolean
        origin:
          type: string
          enum:
            - source
            - avazal
            - derived
        sync:
          anyOf:
            - type: object
              required:
                - state
                - done
                - total
              properties:
                state:
                  type: string
                  enum:
                    - copying
                    - partial
                done:
                  $ref: '#/components/schemas/NonNegativeInt'
                total:
                  $ref: '#/components/schemas/NonNegativeInt'
              additionalProperties: false
            - type: 'null'
        visibility:
          type: object
          required:
            - byDefault
            - views
          properties:
            byDefault:
              type: boolean
            views:
              type: object
              required: []
              properties: {}
              additionalProperties:
                type: boolean
          additionalProperties: false
          description: >-
            Where an Avazal field shows: per view, then byDefault for any other
            view.
        manageable:
          type: boolean
      additionalProperties: false
      description: A field of a list, with its type and role.
    Task:
      type: object
      required:
        - id
        - values
        - createdAt
        - createdBy
        - updatedAt
        - comments
      properties:
        id:
          $ref: '#/components/schemas/SlackListItemId'
        work:
          type: object
          required:
            - id
            - key
            - mergeRule
          properties:
            id:
              type: string
              description: >-
                A Slack List item that Avazal tracks, its work.id. From
                tasks_get.
            key:
              type: string
            mergeRule:
              type: object
              required:
                - enabled
                - revision
              properties:
                enabled:
                  type: boolean
                revision:
                  $ref: '#/components/schemas/NonNegativeInt'
              additionalProperties: false
            development:
              type: object
              required:
                - kind
                - label
                - state
              properties:
                kind:
                  type: string
                  enum:
                    - branch
                    - pull
                label:
                  type: string
                state:
                  type: string
                  enum:
                    - linked
                    - open
                    - closed
                    - merged
                    - paused
              additionalProperties: false
            archived:
              type: boolean
          additionalProperties: false
        archived:
          type: boolean
        values:
          type: object
          required: []
          properties: {}
          additionalProperties:
            anyOf:
              - type: object
                required:
                  - _tag
                  - rich
                properties:
                  _tag:
                    type: string
                    enum:
                      - Text
                  rich:
                    $ref: '#/components/schemas/RichText'
                additionalProperties: false
              - type: object
                required:
                  - _tag
                  - ids
                properties:
                  _tag:
                    type: string
                    enum:
                      - Choices
                  ids:
                    type: array
                    items:
                      type: string
                    description: Choice ids from the field's options in lists_get.
                additionalProperties: false
              - type: object
                required:
                  - _tag
                  - ids
                properties:
                  _tag:
                    type: string
                    enum:
                      - People
                  ids:
                    type: array
                    items:
                      $ref: '#/components/schemas/SlackMemberId'
                additionalProperties: false
              - type: object
                required:
                  - _tag
                  - date
                properties:
                  _tag:
                    type: string
                    enum:
                      - Date
                  date:
                    type: string
                    description: a string matching the pattern ^\d{4}-\d{2}-\d{2}$
                    pattern: ^\d{4}-\d{2}-\d{2}$
                additionalProperties: false
              - type: object
                required:
                  - _tag
                  - value
                properties:
                  _tag:
                    type: string
                    enum:
                      - Number
                  value:
                    type: number
                additionalProperties: false
              - type: object
                required:
                  - _tag
                  - checked
                properties:
                  _tag:
                    type: string
                    enum:
                      - Checkbox
                  checked:
                    type: boolean
                additionalProperties: false
              - type: object
                required:
                  - _tag
                  - url
                properties:
                  _tag:
                    type: string
                    enum:
                      - Link
                  url:
                    type: string
                additionalProperties: false
              - type: object
                required:
                  - _tag
                  - value
                properties:
                  _tag:
                    type: string
                    enum:
                      - Contact
                  value:
                    type: string
                additionalProperties: false
              - type: object
                required:
                  - _tag
                  - refs
                properties:
                  _tag:
                    type: string
                    enum:
                      - Refs
                  refs:
                    type: array
                    items:
                      type: object
                      required:
                        - kind
                        - url
                        - label
                      properties:
                        kind:
                          type: string
                          enum:
                            - message
                            - file
                            - canvas
                            - record
                            - channel
                        url:
                          type: string
                        label:
                          anyOf:
                            - type: string
                            - type: 'null'
                      additionalProperties: false
                additionalProperties: false
              - type: object
                required:
                  - _tag
                properties:
                  _tag:
                    type: string
                    enum:
                      - Empty
                additionalProperties: false
              - type: object
                required:
                  - _tag
                  - claim
                properties:
                  _tag:
                    type: string
                    enum:
                      - Agent
                  claim:
                    $ref: '#/components/schemas/AgentClaim'
                additionalProperties: false
        createdAt:
          anyOf:
            - $ref: '#/components/schemas/Date'
            - type: 'null'
        createdBy:
          anyOf:
            - $ref: '#/components/schemas/SlackMemberId'
            - type: 'null'
        updatedAt:
          anyOf:
            - $ref: '#/components/schemas/Date'
            - type: 'null'
        comments:
          anyOf:
            - $ref: '#/components/schemas/NonNegativeInt'
            - type: 'null'
        position:
          anyOf:
            - type: number
            - type: 'null'
        viewPositions:
          type: object
          required: []
          properties: {}
          additionalProperties:
            type: number
      additionalProperties: false
      description: A list item with its values keyed by field id.
    RichTextInline:
      anyOf:
        - type: object
          required:
            - _tag
            - text
          properties:
            _tag:
              type: string
              enum:
                - Text
            text:
              type: string
            style:
              type: object
              required: []
              properties:
                bold:
                  type: boolean
                italic:
                  type: boolean
                strike:
                  type: boolean
                underline:
                  type: boolean
                code:
                  type: boolean
              additionalProperties: false
          additionalProperties: false
        - type: object
          required:
            - _tag
            - url
          properties:
            _tag:
              type: string
              enum:
                - Link
            url:
              type: string
            text:
              type: string
            style:
              type: object
              required: []
              properties:
                bold:
                  type: boolean
                italic:
                  type: boolean
                strike:
                  type: boolean
                underline:
                  type: boolean
                code:
                  type: boolean
              additionalProperties: false
          additionalProperties: false
        - type: object
          required:
            - _tag
            - fileId
          properties:
            _tag:
              type: string
              enum:
                - Canvas
            fileId:
              $ref: '#/components/schemas/SlackFileId'
          additionalProperties: false
        - type: object
          required:
            - _tag
            - memberId
          properties:
            _tag:
              type: string
              enum:
                - MemberMention
            memberId:
              $ref: '#/components/schemas/SlackMemberId'
          additionalProperties: false
        - type: object
          required:
            - _tag
            - conversationExternalId
          properties:
            _tag:
              type: string
              enum:
                - ConversationMention
            conversationExternalId:
              $ref: '#/components/schemas/SlackChannelId'
          additionalProperties: false
        - type: object
          required:
            - _tag
            - groupId
          properties:
            _tag:
              type: string
              enum:
                - GroupMention
            groupId:
              $ref: '#/components/schemas/SlackUsergroupId'
          additionalProperties: false
        - type: object
          required:
            - _tag
            - range
          properties:
            _tag:
              type: string
              enum:
                - Broadcast
            range:
              type: string
              enum:
                - here
                - channel
                - everyone
          additionalProperties: false
        - type: object
          required:
            - _tag
            - name
          properties:
            _tag:
              type: string
              enum:
                - Emoji
            name:
              type: string
            skinTone:
              $ref: '#/components/schemas/Int'
              description: a number between 2 and 6
              title: between(2, 6)
              minimum: 2
              maximum: 6
            url:
              type: string
          additionalProperties: false
        - type: object
          required:
            - _tag
            - at
            - format
            - fallback
          properties:
            _tag:
              type: string
              enum:
                - Date
            at:
              $ref: '#/components/schemas/Date'
            format:
              type: string
            fallback:
              type: string
          additionalProperties: false
        - type: object
          required:
            - _tag
            - value
          properties:
            _tag:
              type: string
              enum:
                - Color
            value:
              type: string
          additionalProperties: false
      description: A run of text, a link, a mention, an emoji, a date or a color.
    SlackListItemId:
      type: string
      description: A row in a Slack List. From tasks_list.
      title: minLength(1)
      minLength: 1
    AgentClaim:
      type: object
      required:
        - agent
        - profile
        - target
        - runId
        - state
        - via
        - linkedFrom
        - links
        - heartbeatAt
        - since
        - history
      properties:
        informDelivery:
          type: string
          enum:
            - queued
            - unconfirmed
            - delivered
        mode:
          type: string
          enum:
            - assign
            - inform
            - start
        informedAt:
          $ref: '#/components/schemas/DateTimeUtc'
        agent:
          anyOf:
            - type: object
              required:
                - _tag
                - connectionId
                - captainId
              properties:
                _tag:
                  type: string
                  enum:
                    - Captain
                connectionId:
                  $ref: '#/components/schemas/AgentConnectionId'
                captainId:
                  type: string
                  description: A captain of the connection's project, from its captains.
              additionalProperties: false
            - type: object
              required:
                - _tag
                - identityId
              properties:
                _tag:
                  type: string
                  enum:
                    - Identity
                identityId:
                  $ref: '#/components/schemas/AgentIdentityId'
              additionalProperties: false
            - type: object
              required:
                - _tag
                - connectionId
              properties:
                _tag:
                  type: string
                  enum:
                    - Harness
                connectionId:
                  $ref: '#/components/schemas/AgentConnectionId'
              additionalProperties: false
        profile:
          $ref: '#/components/schemas/AgentProfile'
        target:
          anyOf:
            - type: object
              required:
                - id
                - label
              properties:
                id:
                  type: string
                  description: >-
                    The project, repository or environment an agent works in,
                    from its connection's targets.
                label:
                  type: string
              additionalProperties: false
            - type: 'null'
        runId:
          anyOf:
            - $ref: '#/components/schemas/AgentRunId'
            - type: 'null'
        state:
          type: string
          enum:
            - pending
            - working
            - needs_you
            - pr_open
            - merged
            - done
            - failed
            - stale
        via:
          anyOf:
            - type: object
              required:
                - id
                - name
              properties:
                id:
                  $ref: '#/components/schemas/Trimmed'
                  description: The member the agent acts for, from the workspace's members.
                  title: nonEmptyString
                  minLength: 1
                name:
                  type: string
              additionalProperties: false
            - type: 'null'
        linkedFrom:
          type: string
          enum:
            - run
            - mcp
            - api
            - slack_thread
            - slack_cell
            - manual
        links:
          type: array
          items:
            type: object
            required:
              - label
              - url
            properties:
              label:
                type: string
              url:
                type: string
            additionalProperties: false
        heartbeatAt:
          anyOf:
            - $ref: '#/components/schemas/DateTimeUtc'
            - type: 'null'
        since:
          $ref: '#/components/schemas/DateTimeUtc'
        history:
          type: array
          items:
            type: object
            required:
              - agent
              - profile
              - since
              - endedAt
            properties:
              agent:
                anyOf:
                  - type: object
                    required:
                      - _tag
                      - connectionId
                      - captainId
                    properties:
                      _tag:
                        type: string
                        enum:
                          - Captain
                      connectionId:
                        $ref: '#/components/schemas/AgentConnectionId'
                      captainId:
                        type: string
                        description: >-
                          A captain of the connection's project, from its
                          captains.
                    additionalProperties: false
                  - type: object
                    required:
                      - _tag
                      - identityId
                    properties:
                      _tag:
                        type: string
                        enum:
                          - Identity
                      identityId:
                        $ref: '#/components/schemas/AgentIdentityId'
                    additionalProperties: false
                  - type: object
                    required:
                      - _tag
                      - connectionId
                    properties:
                      _tag:
                        type: string
                        enum:
                          - Harness
                      connectionId:
                        $ref: '#/components/schemas/AgentConnectionId'
                    additionalProperties: false
              profile:
                $ref: '#/components/schemas/AgentProfile'
              since:
                $ref: '#/components/schemas/DateTimeUtc'
              endedAt:
                $ref: '#/components/schemas/DateTimeUtc'
            additionalProperties: false
      additionalProperties: false
      description: >-
        Who picked the item up: an agent, the project and run it works in, and
        the person it acts for.
    SlackUsergroupId:
      type: string
      description: >-
        A Slack user group, such as S0123ABCD. From people_list with groups:
        true.
      title: minLength(1)
      minLength: 1
    DateTimeUtc:
      type: string
    AgentConnectionId:
      type: string
      title: '`acred_${string}`'
      description: Connected agent account
      pattern: ^acred_[\s\S]*?$
    AgentProfile:
      type: object
      required:
        - name
        - harness
        - picture
        - captain
      properties:
        name:
          type: string
        harness:
          anyOf:
            - type: string
              enum:
                - capy
                - cursor
                - devin
                - claude
                - codex
                - hoplite
                - fake
            - type: 'null'
        picture:
          anyOf:
            - type: string
            - type: 'null'
        captain:
          anyOf:
            - type: object
              required:
                - id
                - name
                - avatar
                - crew
              properties:
                id:
                  type: string
                  description: The captain's id in its connection's captains.
                name:
                  type: string
                avatar:
                  type: object
                  required:
                    - background
                    - emoji
                    - picture
                  properties:
                    background:
                      anyOf:
                        - type: string
                        - type: 'null'
                    emoji:
                      anyOf:
                        - type: string
                        - type: 'null'
                    picture:
                      anyOf:
                        - type: string
                        - type: 'null'
                  additionalProperties: false
                crew:
                  $ref: '#/components/schemas/Int'
              additionalProperties: false
            - type: 'null'
      additionalProperties: false
      description: >-
        How the agent shows: its name, harness, the identity's or Slack bot's
        picture, and the captain it is when it is one.
    AgentRunId:
      type: string
      title: '`arun_${string}`'
      description: Agent run
      pattern: ^arun_[\s\S]*?$
    Trimmed:
      type: string
      title: trimmed
      pattern: ^\S[\s\S]*\S$|^\S$|^$
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: An Avazal API key (avz_…) created in Settings → API keys.
    bearer:
      type: http
      scheme: bearer
      description: 'The same API key sent as `Authorization: Bearer avz_…`.'

````

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