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

# Configure agent integration

> Change an agent's settings, access and rules for one connected app.



## OpenAPI

````yaml POST /agents/{agentId}/integration
openapi: 3.1.0
info:
  title: Whirl API
  version: 1.0.0
  description: >-
    Read and change Whirl workspaces, tasks, reminders, agents' instructions and
    approvals as the signed-in user. The same operations are available as tools
    on the MCP server at /mcp.
servers:
  - url: https://api.whirl.sh/api/v1
security:
  - oauth2: []
paths:
  /agents/{agentId}/integration:
    post:
      tags:
        - agents
      summary: Configure agent integration
      description: >-
        Change an agent's integration settings, inbound/research access or rules
        using an eligible connectedAccount. Read the configuration first;
        requires permission to configure the agent.
      operationId: configure_agent_integration
      parameters:
        - name: agentId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 64
            description: Agent id from list_agents.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                integrationType:
                  type: string
                  enum:
                    - slack
                    - google_calendar
                    - google_drive
                    - whatsapp
                    - gmail
                    - aircall
                    - smily
                    - granola
                    - breezeway
                    - basecamp
                    - github
                    - notion
                    - optimo_route
                    - onfleet
                    - zendesk
                    - autofleet
                    - hostaway
                    - airtable
                    - ashby
                    - shopify
                    - breww
                    - magento
                    - outlook
                    - outlook_calendar
                    - onedrive
                    - sharepoint
                    - excel
                    - word
                    - teams
                    - gorgias
                    - xero_accounting
                    - pimento
                    - linear
                    - clarus_wms
                    - maxoptra
                    - hubspot_crm
                    - hubspot_conversations
                    - fireflies
                    - resend
                    - guesty
                    - orderspace
                    - hospitable
                    - sparklayer
                    - unleashed
                    - bigblue
                    - otter
                    - skio
                    - trustpilot
                    - webhook
                    - mcp
                    - browser
                  description: Connected integration type string, e.g. "gmail" or "slack".
                connectedAccount:
                  type: string
                  minLength: 1
                  maxLength: 200
                  description: >-
                    Readable connected account selector. Choose an exact value
                    shown in this tool's schema when account selection is
                    required.
                enabledForInbound:
                  description: >-
                    Whether this integration provides inbound triggers that
                    create or update tasks for the agent.
                  type: boolean
                enabledForResearch:
                  description: >-
                    Whether the agent has access to this integration during
                    agent runs. Actions still follow approval rules.
                  type: boolean
                config:
                  description: >-
                    Optional integration config patch. Use only fields shown in
                    the tool schema.
                  type: object
                  propertyNames:
                    type: string
                  additionalProperties:
                    $ref: '#/components/schemas/configure_agent_integration___schema0'
                rules:
                  description: >-
                    Optional inbound trigger, automatic agent run, or
                    auto-approval rules.
                  maxItems: 20
                  type: array
                  items:
                    oneOf:
                      - type: object
                        properties:
                          op:
                            type: string
                            const: create
                            description: Create a new rule.
                          ruleId:
                            description: Ignored for create; the server assigns the new ID.
                            type:
                              - string
                              - 'null'
                          phase:
                            description: Rule phase. Defaults to inbound when omitted.
                            type: string
                            enum:
                              - inbound
                              - auto_research
                              - auto_approve
                          ruleText:
                            type: string
                            minLength: 1
                            maxLength: 4000
                            description: Required natural-language rule text.
                          enabled:
                            description: Whether the rule is enabled.
                            type: boolean
                        required:
                          - op
                          - ruleText
                        additionalProperties: false
                      - type: object
                        properties:
                          op:
                            type: string
                            const: update
                            description: Update an existing rule.
                          ruleId:
                            type: string
                            minLength: 1
                            description: >-
                              Required existing rule id from the integration
                              inventory.
                          phase:
                            type: string
                            enum:
                              - inbound
                              - auto_research
                              - auto_approve
                            description: >-
                              Rule phase: inbound filters incoming triggers;
                              auto_research controls automatic agent runs;
                              auto_approve controls action approval.
                          ruleText:
                            description: Replacement rule text.
                            type: string
                            minLength: 1
                            maxLength: 4000
                          enabled:
                            description: Whether the rule is enabled.
                            type: boolean
                        required:
                          - op
                          - ruleId
                        additionalProperties: false
                      - type: object
                        properties:
                          op:
                            type: string
                            const: delete
                            description: Delete an existing rule.
                          ruleId:
                            type: string
                            minLength: 1
                            description: >-
                              Required existing rule id from the integration
                              inventory.
                        required:
                          - op
                          - ruleId
                        additionalProperties: false
              required:
                - integrationType
              additionalProperties: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  agentId:
                    type: string
                  saved:
                    type: boolean
                required:
                  - agentId
                  - saved
                additionalProperties: false
        '400':
          $ref: '#/components/responses/Problem'
        '401':
          $ref: '#/components/responses/Problem'
        '403':
          $ref: '#/components/responses/Problem'
        '404':
          $ref: '#/components/responses/Problem'
        '409':
          $ref: '#/components/responses/Problem'
        '422':
          $ref: '#/components/responses/Problem'
        '429':
          $ref: '#/components/responses/Problem'
      security:
        - oauth2:
            - agents:write
components:
  schemas:
    configure_agent_integration___schema0:
      anyOf:
        - type: string
        - type: number
        - type: boolean
        - type: 'null'
        - type: array
          items:
            $ref: '#/components/schemas/configure_agent_integration___schema0'
        - type: object
          propertyNames:
            type: string
          additionalProperties:
            $ref: '#/components/schemas/configure_agent_integration___schema0'
    Problem:
      type: object
      properties:
        type:
          type: string
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        code:
          type: string
      required:
        - title
        - status
        - code
  responses:
    Problem:
      description: RFC 9457 problem details
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://api.whirl.sh/oauth/authorize
          tokenUrl: https://api.whirl.sh/oauth/token
          refreshUrl: https://api.whirl.sh/oauth/token
          scopes:
            workspace:read: >-
              Workspaces, tasks, People, task context, notes, messages,
              reminders, and pending approvals.
            workspace:write: >-
              Create and update tasks, People, task context, notes, tags,
              reminders, and workspaces.
            agents:read: >-
              Agents, runs, configuration, handbook, memory, tone examples,
              scheduled tasks, and connected-service research.
            agents:write: >-
              Edit agent configuration, handbook, memory, tone examples, and
              schedules, and give agents tasks.
            approvals:write: Approve, reject, or edit actions agents want to take.
            offline_access: >-
              Keep access without asking you to sign in again, until you
              disconnect it.

````

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