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

# Describe Trigger

> Turn plain words into a trigger

Describe a rule in words and get back a draft to review, or a question when the words leave something open. Pass the current draft to edit it. Nothing is saved; call triggers\_create with the draft.

Requires the `automations:write` scope.


## OpenAPI

````yaml /api-reference/openapi.json post /v1/triggers.describe
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/triggers.describe:
    post:
      tags:
        - triggers
      summary: Turn plain words into a trigger
      description: >-
        Describe a rule in words and get back a draft to review, or a question
        when the words leave something open. Pass the current draft to edit it.
        Nothing is saved; call triggers_create with the draft.


        Requires the `automations:write` scope.
      operationId: triggers.describe
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - text
              properties:
                text:
                  $ref: '#/components/schemas/NonEmptyTrimmedString'
                  description: a string at most 1000 character(s) long
                  title: maxLength(1000)
                  maxLength: 1000
                refs:
                  $ref: '#/components/schemas/PromptRefs'
                scope:
                  type: string
                  enum:
                    - team
                    - personal
                current:
                  $ref: '#/components/schemas/TriggerDraft'
              additionalProperties: false
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - _tag
                      - draft
                      - notes
                    properties:
                      _tag:
                        type: string
                        enum:
                          - Drafted
                      draft:
                        $ref: '#/components/schemas/TriggerDraft'
                      notes:
                        type: array
                        items:
                          type: string
                      unsupported:
                        type: array
                        items:
                          type: string
                    additionalProperties: false
                  - type: object
                    required:
                      - _tag
                      - question
                      - choices
                    properties:
                      _tag:
                        type: string
                        enum:
                          - Clarify
                      question:
                        $ref: '#/components/schemas/NonEmptyTrimmedString'
                      choices:
                        type: array
                        items:
                          $ref: '#/components/schemas/NonEmptyTrimmedString'
                        description: an array of at most 8 item(s)
                        title: maxItems(8)
                        maxItems: 8
                    additionalProperties: false
        '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: FeatureOff
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/FeatureOff'
                  - $ref: '#/components/schemas/AccessPending'
                  - $ref: '#/components/schemas/ScopeRequired'
                  - $ref: '#/components/schemas/OutsideRun'
                  - $ref: '#/components/schemas/ToolNotGranted'
                  - $ref: '#/components/schemas/Forbidden'
        '409':
          description: AskFirst
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AskFirst'
        '422':
          description: Unsupported
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unsupported'
        '429':
          description: RateLimited
          content:
            application/json:
              schema:
                type: object
                required:
                  - retryAfterSeconds
                  - _tag
                properties:
                  message:
                    type: string
                  retryAfterSeconds:
                    type: number
                  _tag:
                    type: string
                    enum:
                      - RateLimited
                  code:
                    type: string
                    enum:
                      - RateLimited
                additionalProperties: false
        '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:
    NonEmptyTrimmedString:
      type: string
      title: nonEmptyString
      pattern: ^\S[\s\S]*\S$|^\S$|^$
      minLength: 1
    PromptRefs:
      type: array
      items:
        type: object
        required:
          - kind
          - id
          - label
          - start
          - end
        properties:
          kind:
            type: string
            enum:
              - channel
              - person
              - agent
              - list
          id:
            $ref: '#/components/schemas/Trimmed'
            description: >-
              A conversation id or `@dms`, a member user id, an agent connection
              id or `avazal`, or a list file id.
            title: nonEmptyString
            minLength: 1
          label:
            $ref: '#/components/schemas/NonEmptyTrimmedString'
          start:
            $ref: '#/components/schemas/NonNegativeInt'
          end:
            $ref: '#/components/schemas/NonNegativeInt'
        additionalProperties: false
      description: What the owner picked in the words, by id and position.
      title: maxItems(24)
      maxItems: 24
    TriggerDraft:
      type: object
      required:
        - name
        - scope
        - when
        - agent
        - prompt
      properties:
        name:
          type: string
        scope:
          type: string
          enum:
            - team
            - personal
        when:
          $ref: '#/components/schemas/TriggerWhen'
        agent:
          anyOf:
            - type: object
              required:
                - _tag
              properties:
                _tag:
                  type: string
                  enum:
                    - Avazal
              additionalProperties: false
            - type: object
              required:
                - _tag
                - connectionId
                - targetId
              properties:
                _tag:
                  type: string
                  enum:
                    - Connected
                connectionId:
                  $ref: '#/components/schemas/AgentConnectionId'
                targetId:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: >-
                    Where the agent runs, such as a device or repository, or
                    null for its default.
                model:
                  type: string
              additionalProperties: false
        prompt:
          type: string
        refs:
          $ref: '#/components/schemas/PromptRefs'
        routes:
          type: array
          items:
            anyOf:
              - type: object
                required:
                  - _tag
                properties:
                  _tag:
                    type: string
                    enum:
                      - Thread
                  mode:
                    type: string
                    enum:
                      - draft
                      - post
                additionalProperties: false
              - type: object
                required:
                  - _tag
                  - conversationId
                properties:
                  _tag:
                    type: string
                    enum:
                      - Channel
                  conversationId:
                    $ref: '#/components/schemas/ConversationId'
                  mode:
                    type: string
                    enum:
                      - draft
                      - post
                additionalProperties: false
              - type: object
                required:
                  - _tag
                  - conversationId
                  - listId
                properties:
                  _tag:
                    type: string
                    enum:
                      - List
                  conversationId:
                    $ref: '#/components/schemas/ConversationId'
                  listId:
                    $ref: '#/components/schemas/SlackFileId'
                  action:
                    type: string
                    enum:
                      - add
                      - update
                  comment:
                    type: boolean
                additionalProperties: false
              - type: object
                required:
                  - _tag
                properties:
                  _tag:
                    type: string
                    enum:
                      - Me
                additionalProperties: false
        sensitivity:
          type: string
          enum:
            - strict
            - standard
            - relaxed
      additionalProperties: false
    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
    FeatureOff:
      type: object
      required:
        - feature
        - _tag
      properties:
        feature:
          type: string
          enum:
            - gmail
            - calendar
            - assistant
            - triggers
        message:
          type: string
        _tag:
          type: string
          enum:
            - FeatureOff
        code:
          type: string
          enum:
            - FeatureOff
      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
    Forbidden:
      $id: /schemas/void
      title: Forbidden
    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
    Trimmed:
      type: string
      title: trimmed
      pattern: ^\S[\s\S]*\S$|^\S$|^$
    NonNegativeInt:
      type: integer
      title: int
      minimum: 0
    TriggerWhen:
      anyOf:
        - type: object
          required:
            - _tag
            - conditions
          properties:
            _tag:
              type: string
              enum:
                - Message
            conditions:
              type: array
              items:
                type: object
                required:
                  - fieldId
                  - op
                properties:
                  fieldId:
                    type: string
                    enum:
                      - type
                      - priority
                      - about
                      - where
                      - from
                      - item
                      - prompt
                    description: What the condition tests about a message.
                  op:
                    anyOf:
                      - type: object
                        required:
                          - _tag
                          - values
                        properties:
                          _tag:
                            type: string
                            enum:
                              - Is
                          values:
                            type: array
                            items:
                              type: string
                        additionalProperties: false
                      - type: object
                        required:
                          - _tag
                          - values
                        properties:
                          _tag:
                            type: string
                            enum:
                              - IsNot
                          values:
                            type: array
                            items:
                              type: string
                        additionalProperties: false
                      - type: object
                        required:
                          - _tag
                          - text
                        properties:
                          _tag:
                            type: string
                            enum:
                              - Contains
                          text:
                            type: string
                        additionalProperties: false
                      - type: object
                        required:
                          - _tag
                        properties:
                          _tag:
                            type: string
                            enum:
                              - Empty
                        additionalProperties: false
                      - type: object
                        required:
                          - _tag
                        properties:
                          _tag:
                            type: string
                            enum:
                              - NotEmpty
                        additionalProperties: false
                      - type: object
                        required:
                          - _tag
                          - date
                        properties:
                          _tag:
                            type: string
                            enum:
                              - Before
                          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
                          - date
                        properties:
                          _tag:
                            type: string
                            enum:
                              - After
                          date:
                            type: string
                            description: a string matching the pattern ^\d{4}-\d{2}-\d{2}$
                            pattern: ^\d{4}-\d{2}-\d{2}$
                        additionalProperties: false
                additionalProperties: false
              description: an array of at most 6 item(s)
              title: maxItems(6)
              maxItems: 6
          additionalProperties: false
        - type: object
          required:
            - _tag
            - days
            - at
          properties:
            _tag:
              type: string
              enum:
                - Schedule
            days:
              type: array
              minItems: 1
              items:
                type: string
                enum:
                  - sunday
                  - monday
                  - tuesday
                  - wednesday
                  - thursday
                  - friday
                  - saturday
              description: an array of at most 7 item(s)
              title: maxItems(7)
              maxItems: 7
            at:
              type: string
              description: a string matching the pattern ^([01]\d|2[0-3]):[0-5]\d$
              pattern: ^([01]\d|2[0-3]):[0-5]\d$
            reads:
              type: array
              items:
                $ref: '#/components/schemas/ConversationId'
          additionalProperties: false
      description: 'When a trigger fires: on matching messages or on a schedule.'
    AgentConnectionId:
      type: string
      title: '`acred_${string}`'
      description: Connected agent account
      pattern: ^acred_[\s\S]*?$
    ConversationId:
      type: string
      title: '`chcv_${string}`'
      description: Slack channel or DM
      pattern: ^chcv_[\s\S]*?$
    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
    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_]+$
    PropertyKey:
      anyOf:
        - type: string
        - type: number
        - type: object
          required:
            - _tag
            - key
          properties:
            _tag:
              type: string
              enum:
                - symbol
            key:
              type: string
          additionalProperties: false
  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.