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

# Convert a disconnected managed agent into a manual agent

> Convert a sync-managed (GitOps) agent whose integration is disconnected into an editable manual agent: copies its config + prompt, transfers its trigger rows (preserving email/webhook/Slack bindings), and parks the managed original as a recoverable soft-delete.



## OpenAPI

````yaml https://app.cotool.ai/api/docs/openapi.json post /api/agents/{agentId}/copy
openapi: 3.1.0
info:
  title: Cotool API
  version: 1.0.0
  description: >-
    The Cotool REST API. Authenticate with an API key from `/settings/api-keys`
    sent as `Authorization: Bearer <key>`.


    Authentication, error formats, pagination, and common integration recipes
    are documented in the [API
    overview](https://docs.cotool.ai/api-reference/introduction). Endpoints
    marked **Deprecated** keep working; each one's description names its
    replacement.
servers:
  - url: https://app.cotool.ai
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Agents
    description: Create, update, run, and version agents.
  - name: Agent Runs
    description: Inspect agent runs, submit feedback, and read evaluation metrics.
  - name: Agent Triggers
    description: Webhook, schedule, and integration triggers that start agent runs.
  - name: Agents as Code
    description: Validate agents and skills defined as YAML in a Git repository.
  - name: Skills
    description: Reusable instructions and tool grants attached to agents.
  - name: Chat
    description: Chat sessions and their transcripts.
  - name: Alerts
    description: Alert triage, routing, and escalation notifications.
  - name: Output Destinations
    description: Webhook, Slack, Jira, and Linear destinations for agent output.
  - name: Detections
    description: Detection agents, detection hits, and the Cotool detection library.
  - name: Hunt
    description: Autonomous hunt threats, gaps, and settings.
  - name: Intel
    description: Threat-intelligence feed items, indicators, and sources.
  - name: Threat Model
    description: The organization threat model and its version history.
  - name: MITRE Coverage
    description: MITRE ATT&CK coverage across detections.
  - name: Tools
    description: Connected tool integrations and captured tool output.
  - name: CLIs
    description: Connected CLI integrations.
  - name: Artifacts
    description: Files and reports produced by agent runs.
  - name: Audit Logs
    description: Organization audit log export and event catalog.
  - name: Users
    description: Users, memberships, and the current session.
  - name: Roles
    description: Role-based permissions.
  - name: Organizations
    description: Organization-level metrics.
paths:
  /api/agents/{agentId}/copy:
    post:
      tags:
        - Agents
      summary: Convert a disconnected managed agent into a manual agent
      description: >-
        Convert a sync-managed (GitOps) agent whose integration is disconnected
        into an editable manual agent: copies its config + prompt, transfers its
        trigger rows (preserving email/webhook/Slack bindings), and parks the
        managed original as a recoverable soft-delete.
      parameters:
        - in: path
          name: agentId
          description: Unique identifier of the sync-managed agent to copy
          schema:
            type: string
            format: uuid
            description: Unique identifier of the sync-managed agent to copy
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  agent:
                    oneOf:
                      - type: object
                        properties:
                          id:
                            type: string
                            description: Unique identifier for the agent
                          organizationId:
                            type: string
                            description: >-
                              Unique identifier of the organization that owns
                              this agent
                          name:
                            type: string
                            description: Human-readable name of the agent
                          description:
                            type: string
                            description: Description of what the agent does and its purpose
                          systemPrompt:
                            type: string
                            description: >-
                              The agent's live system prompt (version history
                              lives in agent_versions)
                          createdAt:
                            type: string
                            description: Timestamp when the agent was created
                          updatedAt:
                            type: string
                            description: Timestamp when the agent was last updated
                          createdByUserId:
                            type:
                              - string
                              - 'null'
                            description: >-
                              User ID that created this agent, or null for
                              system-created or unknown authorship
                          updatedByUserId:
                            type:
                              - string
                              - 'null'
                            description: >-
                              User ID that last edited this agent, or null for
                              system edits or unknown authorship
                          createdBy:
                            type:
                              - object
                              - 'null'
                            properties:
                              name:
                                type:
                                  - string
                                  - 'null'
                                description: >-
                                  The user's profile display name, falling back
                                  to their email
                              imageUrl:
                                type:
                                  - string
                                  - 'null'
                                description: >-
                                  The user's profile image URL, if one is
                                  available
                            required:
                              - name
                              - imageUrl
                            description: >-
                              Display identity of the user that created this
                              agent
                          updatedBy:
                            type:
                              - object
                              - 'null'
                            properties:
                              name:
                                type:
                                  - string
                                  - 'null'
                                description: >-
                                  The user's profile display name, falling back
                                  to their email
                              imageUrl:
                                type:
                                  - string
                                  - 'null'
                                description: >-
                                  The user's profile image URL, if one is
                                  available
                            required:
                              - name
                              - imageUrl
                            description: >-
                              Display identity of the user that last edited this
                              agent
                          deletedAt:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Timestamp when the agent was soft-deleted, or null
                              if not deleted
                          invocationCount:
                            type: integer
                            minimum: 0
                            description: >-
                              All-time number of top-level invocations of this
                              agent
                          invocationCount30d:
                            type: integer
                            minimum: 0
                            description: >-
                              Number of top-level invocations of this agent in
                              the last 30 days
                          lastInvokedAt:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Timestamp of the most recent top-level invocation,
                              or null if the agent has never been invoked
                          toolNames:
                            type: array
                            items:
                              type: string
                            description: >-
                              Array of tool names that this agent can use during
                              execution
                          toolSelectionMode:
                            type: string
                            enum:
                              - manual
                              - all_read_only
                              - all_read_only_plus_selected
                            description: How this agent resolves tools at runtime
                          cliNames:
                            type: array
                            items:
                              type: string
                            description: >-
                              Optional array of CLI integration ids that this
                              agent can use during execution
                          toolActionConfigs:
                            type: array
                            items:
                              oneOf:
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: cotool-email_sendEmail
                                    allowedRecipients:
                                      type: array
                                      items:
                                        type: string
                                      minItems: 1
                                      maxItems: 500
                                      description: >-
                                        Email addresses and domains this agent
                                        may send email to. A domain allows every
                                        address at that domain, not its
                                        subdomains. With no entries the agent
                                        cannot send email.
                                  required:
                                    - type
                                    - allowedRecipients
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: slack_sendMessage
                                    allowedChannels:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                            minLength: 1
                                            description: >-
                                              Slack channel ID (for example
                                              C123ABC456)
                                          name:
                                            type: string
                                            minLength: 1
                                            description: 'Slack channel name without the leading #'
                                        required:
                                          - id
                                          - name
                                        additionalProperties: false
                                      minItems: 1
                                      description: >-
                                        Allowlist of Slack channels this agent
                                        may access when using this tool action
                                    hideAgentButton:
                                      type: boolean
                                      description: >-
                                        When true, omits the "Open in Cotool"
                                        run link and the agent name from the
                                        footer of Slack messages produced by
                                        this tool action. Defaults to false
                                        (link is shown).
                                  required:
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: slack_replyToThread
                                    allowedChannels:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                            minLength: 1
                                            description: >-
                                              Slack channel ID (for example
                                              C123ABC456)
                                          name:
                                            type: string
                                            minLength: 1
                                            description: 'Slack channel name without the leading #'
                                        required:
                                          - id
                                          - name
                                        additionalProperties: false
                                      minItems: 1
                                      description: >-
                                        Allowlist of Slack channels this agent
                                        may access when using this tool action
                                    hideAgentButton:
                                      type: boolean
                                      description: >-
                                        When true, omits the "Open in Cotool"
                                        run link and the agent name from the
                                        footer of Slack messages produced by
                                        this tool action. Defaults to false
                                        (link is shown).
                                  required:
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: slack_readChannelMessages
                                    allowedChannels:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                            minLength: 1
                                            description: >-
                                              Slack channel ID (for example
                                              C123ABC456)
                                          name:
                                            type: string
                                            minLength: 1
                                            description: 'Slack channel name without the leading #'
                                        required:
                                          - id
                                          - name
                                        additionalProperties: false
                                      minItems: 1
                                      description: >-
                                        Allowlist of Slack channels this agent
                                        may access when using this tool action
                                  required:
                                    - type
                                    - allowedChannels
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: slack_readThreadMessages
                                    allowedChannels:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                            minLength: 1
                                            description: >-
                                              Slack channel ID (for example
                                              C123ABC456)
                                          name:
                                            type: string
                                            minLength: 1
                                            description: 'Slack channel name without the leading #'
                                        required:
                                          - id
                                          - name
                                        additionalProperties: false
                                      minItems: 1
                                      description: >-
                                        Allowlist of Slack channels this agent
                                        may access when using this tool action
                                  required:
                                    - type
                                    - allowedChannels
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: slack_downloadMessageFiles
                                    allowedChannels:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                            minLength: 1
                                            description: >-
                                              Slack channel ID (for example
                                              C123ABC456)
                                          name:
                                            type: string
                                            minLength: 1
                                            description: 'Slack channel name without the leading #'
                                        required:
                                          - id
                                          - name
                                        additionalProperties: false
                                      minItems: 1
                                      description: >-
                                        Allowlist of Slack channels this agent
                                        may access when using this tool action
                                  required:
                                    - type
                                    - allowedChannels
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: slack_waitForUserResponse
                                    allowedChannels:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                            minLength: 1
                                            description: >-
                                              Slack channel ID (for example
                                              C123ABC456)
                                          name:
                                            type: string
                                            minLength: 1
                                            description: 'Slack channel name without the leading #'
                                        required:
                                          - id
                                          - name
                                        additionalProperties: false
                                      minItems: 1
                                      description: >-
                                        Allowlist of Slack channels this agent
                                        may access when using this tool action
                                    hideAgentButton:
                                      type: boolean
                                      description: >-
                                        When true, omits the "Open in Cotool"
                                        run link and the agent name from the
                                        footer of Slack messages produced by
                                        this tool action. Defaults to false
                                        (link is shown).
                                    timeout:
                                      type: object
                                      properties:
                                        amount:
                                          type: integer
                                          exclusiveMinimum: 0
                                          description: >-
                                            Number of units to wait before an
                                            unanswered prompt times out.
                                        unit:
                                          type: string
                                          enum:
                                            - minutes
                                            - hours
                                            - days
                                          description: Unit for the timeout amount.
                                      required:
                                        - amount
                                        - unit
                                      additionalProperties: false
                                      description: >-
                                        Optional fixed timeout for unanswered
                                        prompts. When omitted, the wait follows
                                        the severity of the run's alert: 15
                                        minutes for critical, 1 hour for high, 4
                                        hours for medium, 24 hours for low, and
                                        24 hours when the run has no alert.
                                  required:
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: tool_approvals
                                    rules:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          toolName:
                                            type: string
                                            minLength: 1
                                            description: >-
                                              Tool action (for example
                                              jira_createIssue) that must be approved
                                              before it runs
                                          slack:
                                            type: object
                                            properties:
                                              channel:
                                                type: object
                                                properties:
                                                  id:
                                                    type: string
                                                    minLength: 1
                                                    description: >-
                                                      Slack channel ID (for example
                                                      C123ABC456)
                                                  name:
                                                    type: string
                                                    minLength: 1
                                                    description: 'Slack channel name without the leading #'
                                                required:
                                                  - id
                                                  - name
                                                additionalProperties: false
                                            required:
                                              - channel
                                            additionalProperties: false
                                            description: >-
                                              Also post the approval request to this
                                              Slack channel with Approve / Reject
                                              buttons
                                          teams:
                                            type: object
                                            properties:
                                              destinationId:
                                                type: string
                                                format: uuid
                                                description: >-
                                                  ID of the Microsoft Teams output
                                                  destination
                                              name:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Display name of the Microsoft Teams
                                                  output destination
                                            required:
                                              - destinationId
                                              - name
                                            additionalProperties: false
                                            description: >-
                                              Also notify this Microsoft Teams
                                              destination with a link to review the
                                              request in Cotool
                                        required:
                                          - toolName
                                        additionalProperties: false
                                      minItems: 1
                                      description: >-
                                        Tool actions that pause the agent until
                                        a person approves the call
                                  required:
                                    - type
                                    - rules
                                  additionalProperties: false
                              description: Configuration for a specific tool action
                            description: Per-tool-action configuration for this agent
                          modelAlias:
                            description: >-
                              Model alias specifying which LLM model to use for
                              this agent
                          reasoningEffort:
                            type:
                              - string
                              - 'null'
                            enum:
                              - none
                              - minimal
                              - low
                              - medium
                              - high
                              - xhigh
                              - max
                              - null
                            description: >-
                              Reasoning level the agent runs its model with,
                              from the levels the model offers. Null keeps the
                              model default. Applies with token-based pricing.
                          fastMode:
                            type: boolean
                            description: >-
                              Whether the agent runs its model in fast mode, at
                              the fast-mode price. Only models with a fast mode
                              use it. Applies with token-based pricing.
                          contextDocs:
                            type: array
                            items:
                              type: object
                              properties:
                                provider:
                                  type: string
                                  enum:
                                    - googleDocs
                                    - notion
                                    - confluence
                                    - mcp
                                id:
                                  type: string
                                name:
                                  type: string
                                mimeType:
                                  type: string
                              required:
                                - provider
                                - id
                                - name
                            description: >-
                              Optional array of context documents (e.g., Google
                              Docs, Notion pages) to provide to the agent
                          tinesStoryImportId:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Optional reference to the Tines story import
                              template used to create this agent
                          triggerSummary:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                  description: Unique identifier for the trigger
                                source:
                                  type: string
                                  enum:
                                    - jira
                                    - jira-automation
                                    - slack
                                    - linear
                                    - cron
                                    - webhook
                                    - email
                                    - bugcrowd
                                    - hackerone
                                    - zscaler
                                    - darktrace
                                    - seon
                                  description: >-
                                    The source platform or system that triggers
                                    the agent
                                name:
                                  type: string
                                  description: Human-readable name for the trigger
                                enabled:
                                  type: boolean
                                  description: Whether the trigger is currently enabled
                                eventMode:
                                  type: string
                                  enum:
                                    - direct
                                    - alert_source
                                  description: >-
                                    Whether this event runs the agent directly
                                    or creates an alert first
                                createsAlert:
                                  type: boolean
                                  description: Legacy compatibility projection of eventMode
                              required:
                                - id
                                - source
                                - name
                                - enabled
                            description: >-
                              Optional array of triggers configured for this
                              agent
                          planningMode:
                            type: string
                            enum:
                              - auto
                              - never
                              - always
                            description: Planning behavior mode for the agent
                          structuredOutputSchema:
                            oneOf:
                              - $ref: '#/components/schemas/CotoolJsonSchema'
                              - type: 'null'
                            description: >-
                              Optional JSON schema describing the structured
                              output the agent should emit (may include x-cotool
                              metadata for preset UX; metadata is stripped
                              before sending to the LLM)
                          persistentWorkspaceEnabled:
                            type: boolean
                            description: Whether this agent may use persistent workspace
                          tags:
                            type: array
                            items:
                              type: string
                              minLength: 1
                              maxLength: 100
                              description: >-
                                A tag label for categorizing agents (normalized
                                to lowercase)
                            description: Array of tags for categorizing the agent
                          skills:
                            type: array
                            items:
                              type: object
                              properties:
                                skillId:
                                  type: string
                                  format: uuid
                                  description: Unique identifier of an attached skill
                                skillVersionId:
                                  type:
                                    - string
                                    - 'null'
                                  format: uuid
                                  description: >-
                                    Pinned version ID, or null/undefined to
                                    track latest
                                invocationCount30d:
                                  type: number
                                  description: >-
                                    Distinct chats for this agent in the last 30
                                    days where the skill was read from the
                                    sandbox
                                skill:
                                  type: object
                                  properties:
                                    name:
                                      type: string
                                      pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
                                      minLength: 1
                                      maxLength: 64
                                      description: >-
                                        Machine-safe skill name used in sandbox
                                        paths and imports
                                    description:
                                      type: string
                                      description: Skill description
                                    requiredTools:
                                      type: array
                                      items:
                                        type: string
                                      description: Required tool types for this skill
                                  required:
                                    - name
                                    - description
                                    - requiredTools
                                  description: Skill metadata snapshot
                              required:
                                - skillId
                                - skill
                            description: Array of reusable skills attached to this agent
                          acceptanceCriteria:
                            type: array
                            items:
                              type: string
                              minLength: 1
                              maxLength: 500
                              description: >-
                                A user-configured acceptance criterion that must
                                be satisfied for an agent run
                            maxItems: 20
                            description: >-
                              Optional list of acceptance criteria evaluated for
                              every run
                          agentType:
                            type: string
                            enum:
                              - response
                              - detection
                            description: >-
                              Type of agent: response (standard) or detection
                              (security detection)
                          slackReplyScope:
                            type:
                              - string
                              - 'null'
                            enum:
                              - anyone
                              - cotool_users
                              - null
                            description: >-
                              Default Slack reply scope for chats not started by
                              a Slack trigger (null/absent → cotool_users)
                          origin:
                            type: string
                            enum:
                              - user
                              - orchestrator
                            description: 'Who created this agent: user or orchestrator'
                          syncKey:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Stable logical key for the agent (slug, immutable,
                              unique per org)
                          syncSource:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Sync backend managing this agent (e.g. "github");
                              null/absent when UI-managed
                          syncFilePath:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Path of the source YAML file for a GitOps-managed
                              agent
                          syncConfigId:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Which agent_sync_config (repo source) materialized
                              this managed agent; null when UI-managed
                          syncSourceUrl:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Link to the source YAML file on GitHub for a
                              GitOps-managed agent. Only returned when
                              retrieving a single agent; null when the agent is
                              UI-managed or its repository is not configured
                          detectionCategory:
                            type:
                              - string
                              - 'null'
                            enum:
                              - baseline_anomaly
                              - first_occurrence
                              - sequence_pattern
                              - privilege_escalation
                              - custom
                              - null
                            description: Category of detection (only for detection agents)
                          detectionQuery:
                            type:
                              - string
                              - 'null'
                            description: >-
                              The SIEM query for the detection (only for
                              detection agents)
                          siemType:
                            type:
                              - string
                              - 'null'
                            description: >-
                              The SIEM platform type (e.g., splunk, elastic) for
                              the detection (only for detection agents)
                          isSuggestion:
                            type: boolean
                            description: >-
                              Whether this detection is a suggestion (only for
                              detection agents)
                          lastDetectionRunAt:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Timestamp of when this detection was last run
                              (only for detection agents)
                          legacyDetection:
                            type: boolean
                            description: >-
                              Client-side marker for a migrated legacy customer
                              detection remapped to a unified agent
                          isBuiltIn:
                            type: boolean
                            const: true
                            description: >-
                              Whether this agent is built in to the system (true
                              for built-in (system-managed) agents)
                          builtInAgentType:
                            type: string
                            enum:
                              - threat-relevancy
                              - threat-research
                              - autonomous-hunt
                              - detection-engineer
                              - code-detection-tuner
                              - detection-calibrator
                              - test-agent
                            description: >-
                              Type of built-in agent (e.g., threat-validation,
                              threat-hunt)
                        required:
                          - id
                          - organizationId
                          - name
                          - description
                          - systemPrompt
                          - createdAt
                          - updatedAt
                          - deletedAt
                          - toolNames
                          - toolSelectionMode
                          - toolActionConfigs
                          - modelAlias
                          - planningMode
                          - agentType
                          - origin
                          - isBuiltIn
                          - builtInAgentType
                      - type: object
                        properties:
                          id:
                            type: string
                            description: Unique identifier for the agent
                          organizationId:
                            type: string
                            description: >-
                              Unique identifier of the organization that owns
                              this agent
                          name:
                            type: string
                            description: Human-readable name of the agent
                          description:
                            type: string
                            description: Description of what the agent does and its purpose
                          systemPrompt:
                            type: string
                            description: >-
                              The agent's live system prompt (version history
                              lives in agent_versions)
                          createdAt:
                            type: string
                            description: Timestamp when the agent was created
                          updatedAt:
                            type: string
                            description: Timestamp when the agent was last updated
                          createdByUserId:
                            type:
                              - string
                              - 'null'
                            description: >-
                              User ID that created this agent, or null for
                              system-created or unknown authorship
                          updatedByUserId:
                            type:
                              - string
                              - 'null'
                            description: >-
                              User ID that last edited this agent, or null for
                              system edits or unknown authorship
                          createdBy:
                            type:
                              - object
                              - 'null'
                            properties:
                              name:
                                type:
                                  - string
                                  - 'null'
                                description: >-
                                  The user's profile display name, falling back
                                  to their email
                              imageUrl:
                                type:
                                  - string
                                  - 'null'
                                description: >-
                                  The user's profile image URL, if one is
                                  available
                            required:
                              - name
                              - imageUrl
                            description: >-
                              Display identity of the user that created this
                              agent
                          updatedBy:
                            type:
                              - object
                              - 'null'
                            properties:
                              name:
                                type:
                                  - string
                                  - 'null'
                                description: >-
                                  The user's profile display name, falling back
                                  to their email
                              imageUrl:
                                type:
                                  - string
                                  - 'null'
                                description: >-
                                  The user's profile image URL, if one is
                                  available
                            required:
                              - name
                              - imageUrl
                            description: >-
                              Display identity of the user that last edited this
                              agent
                          deletedAt:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Timestamp when the agent was soft-deleted, or null
                              if not deleted
                          invocationCount:
                            type: integer
                            minimum: 0
                            description: >-
                              All-time number of top-level invocations of this
                              agent
                          invocationCount30d:
                            type: integer
                            minimum: 0
                            description: >-
                              Number of top-level invocations of this agent in
                              the last 30 days
                          lastInvokedAt:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Timestamp of the most recent top-level invocation,
                              or null if the agent has never been invoked
                          toolNames:
                            type: array
                            items:
                              type: string
                            description: >-
                              Array of tool names that this agent can use during
                              execution
                          toolSelectionMode:
                            type: string
                            enum:
                              - manual
                              - all_read_only
                              - all_read_only_plus_selected
                            description: How this agent resolves tools at runtime
                          cliNames:
                            type: array
                            items:
                              type: string
                            description: >-
                              Optional array of CLI integration ids that this
                              agent can use during execution
                          toolActionConfigs:
                            type: array
                            items:
                              oneOf:
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: cotool-email_sendEmail
                                    allowedRecipients:
                                      type: array
                                      items:
                                        type: string
                                      minItems: 1
                                      maxItems: 500
                                      description: >-
                                        Email addresses and domains this agent
                                        may send email to. A domain allows every
                                        address at that domain, not its
                                        subdomains. With no entries the agent
                                        cannot send email.
                                  required:
                                    - type
                                    - allowedRecipients
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: slack_sendMessage
                                    allowedChannels:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                            minLength: 1
                                            description: >-
                                              Slack channel ID (for example
                                              C123ABC456)
                                          name:
                                            type: string
                                            minLength: 1
                                            description: 'Slack channel name without the leading #'
                                        required:
                                          - id
                                          - name
                                        additionalProperties: false
                                      minItems: 1
                                      description: >-
                                        Allowlist of Slack channels this agent
                                        may access when using this tool action
                                    hideAgentButton:
                                      type: boolean
                                      description: >-
                                        When true, omits the "Open in Cotool"
                                        run link and the agent name from the
                                        footer of Slack messages produced by
                                        this tool action. Defaults to false
                                        (link is shown).
                                  required:
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: slack_replyToThread
                                    allowedChannels:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                            minLength: 1
                                            description: >-
                                              Slack channel ID (for example
                                              C123ABC456)
                                          name:
                                            type: string
                                            minLength: 1
                                            description: 'Slack channel name without the leading #'
                                        required:
                                          - id
                                          - name
                                        additionalProperties: false
                                      minItems: 1
                                      description: >-
                                        Allowlist of Slack channels this agent
                                        may access when using this tool action
                                    hideAgentButton:
                                      type: boolean
                                      description: >-
                                        When true, omits the "Open in Cotool"
                                        run link and the agent name from the
                                        footer of Slack messages produced by
                                        this tool action. Defaults to false
                                        (link is shown).
                                  required:
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: slack_readChannelMessages
                                    allowedChannels:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                            minLength: 1
                                            description: >-
                                              Slack channel ID (for example
                                              C123ABC456)
                                          name:
                                            type: string
                                            minLength: 1
                                            description: 'Slack channel name without the leading #'
                                        required:
                                          - id
                                          - name
                                        additionalProperties: false
                                      minItems: 1
                                      description: >-
                                        Allowlist of Slack channels this agent
                                        may access when using this tool action
                                  required:
                                    - type
                                    - allowedChannels
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: slack_readThreadMessages
                                    allowedChannels:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                            minLength: 1
                                            description: >-
                                              Slack channel ID (for example
                                              C123ABC456)
                                          name:
                                            type: string
                                            minLength: 1
                                            description: 'Slack channel name without the leading #'
                                        required:
                                          - id
                                          - name
                                        additionalProperties: false
                                      minItems: 1
                                      description: >-
                                        Allowlist of Slack channels this agent
                                        may access when using this tool action
                                  required:
                                    - type
                                    - allowedChannels
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: slack_downloadMessageFiles
                                    allowedChannels:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                            minLength: 1
                                            description: >-
                                              Slack channel ID (for example
                                              C123ABC456)
                                          name:
                                            type: string
                                            minLength: 1
                                            description: 'Slack channel name without the leading #'
                                        required:
                                          - id
                                          - name
                                        additionalProperties: false
                                      minItems: 1
                                      description: >-
                                        Allowlist of Slack channels this agent
                                        may access when using this tool action
                                  required:
                                    - type
                                    - allowedChannels
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: slack_waitForUserResponse
                                    allowedChannels:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                            minLength: 1
                                            description: >-
                                              Slack channel ID (for example
                                              C123ABC456)
                                          name:
                                            type: string
                                            minLength: 1
                                            description: 'Slack channel name without the leading #'
                                        required:
                                          - id
                                          - name
                                        additionalProperties: false
                                      minItems: 1
                                      description: >-
                                        Allowlist of Slack channels this agent
                                        may access when using this tool action
                                    hideAgentButton:
                                      type: boolean
                                      description: >-
                                        When true, omits the "Open in Cotool"
                                        run link and the agent name from the
                                        footer of Slack messages produced by
                                        this tool action. Defaults to false
                                        (link is shown).
                                    timeout:
                                      type: object
                                      properties:
                                        amount:
                                          type: integer
                                          exclusiveMinimum: 0
                                          description: >-
                                            Number of units to wait before an
                                            unanswered prompt times out.
                                        unit:
                                          type: string
                                          enum:
                                            - minutes
                                            - hours
                                            - days
                                          description: Unit for the timeout amount.
                                      required:
                                        - amount
                                        - unit
                                      additionalProperties: false
                                      description: >-
                                        Optional fixed timeout for unanswered
                                        prompts. When omitted, the wait follows
                                        the severity of the run's alert: 15
                                        minutes for critical, 1 hour for high, 4
                                        hours for medium, 24 hours for low, and
                                        24 hours when the run has no alert.
                                  required:
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: tool_approvals
                                    rules:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          toolName:
                                            type: string
                                            minLength: 1
                                            description: >-
                                              Tool action (for example
                                              jira_createIssue) that must be approved
                                              before it runs
                                          slack:
                                            type: object
                                            properties:
                                              channel:
                                                type: object
                                                properties:
                                                  id:
                                                    type: string
                                                    minLength: 1
                                                    description: >-
                                                      Slack channel ID (for example
                                                      C123ABC456)
                                                  name:
                                                    type: string
                                                    minLength: 1
                                                    description: 'Slack channel name without the leading #'
                                                required:
                                                  - id
                                                  - name
                                                additionalProperties: false
                                            required:
                                              - channel
                                            additionalProperties: false
                                            description: >-
                                              Also post the approval request to this
                                              Slack channel with Approve / Reject
                                              buttons
                                          teams:
                                            type: object
                                            properties:
                                              destinationId:
                                                type: string
                                                format: uuid
                                                description: >-
                                                  ID of the Microsoft Teams output
                                                  destination
                                              name:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Display name of the Microsoft Teams
                                                  output destination
                                            required:
                                              - destinationId
                                              - name
                                            additionalProperties: false
                                            description: >-
                                              Also notify this Microsoft Teams
                                              destination with a link to review the
                                              request in Cotool
                                        required:
                                          - toolName
                                        additionalProperties: false
                                      minItems: 1
                                      description: >-
                                        Tool actions that pause the agent until
                                        a person approves the call
                                  required:
                                    - type
                                    - rules
                                  additionalProperties: false
                              description: Configuration for a specific tool action
                            description: Per-tool-action configuration for this agent
                          modelAlias:
                            description: >-
                              Model alias specifying which LLM model to use for
                              this agent
                          reasoningEffort:
                            type:
                              - string
                              - 'null'
                            enum:
                              - none
                              - minimal
                              - low
                              - medium
                              - high
                              - xhigh
                              - max
                              - null
                            description: >-
                              Reasoning level the agent runs its model with,
                              from the levels the model offers. Null keeps the
                              model default. Applies with token-based pricing.
                          fastMode:
                            type: boolean
                            description: >-
                              Whether the agent runs its model in fast mode, at
                              the fast-mode price. Only models with a fast mode
                              use it. Applies with token-based pricing.
                          contextDocs:
                            type: array
                            items:
                              type: object
                              properties:
                                provider:
                                  type: string
                                  enum:
                                    - googleDocs
                                    - notion
                                    - confluence
                                    - mcp
                                id:
                                  type: string
                                name:
                                  type: string
                                mimeType:
                                  type: string
                              required:
                                - provider
                                - id
                                - name
                            description: >-
                              Optional array of context documents (e.g., Google
                              Docs, Notion pages) to provide to the agent
                          tinesStoryImportId:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Optional reference to the Tines story import
                              template used to create this agent
                          triggerSummary:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                  description: Unique identifier for the trigger
                                source:
                                  type: string
                                  enum:
                                    - jira
                                    - jira-automation
                                    - slack
                                    - linear
                                    - cron
                                    - webhook
                                    - email
                                    - bugcrowd
                                    - hackerone
                                    - zscaler
                                    - darktrace
                                    - seon
                                  description: >-
                                    The source platform or system that triggers
                                    the agent
                                name:
                                  type: string
                                  description: Human-readable name for the trigger
                                enabled:
                                  type: boolean
                                  description: Whether the trigger is currently enabled
                                eventMode:
                                  type: string
                                  enum:
                                    - direct
                                    - alert_source
                                  description: >-
                                    Whether this event runs the agent directly
                                    or creates an alert first
                                createsAlert:
                                  type: boolean
                                  description: Legacy compatibility projection of eventMode
                              required:
                                - id
                                - source
                                - name
                                - enabled
                            description: >-
                              Optional array of triggers configured for this
                              agent
                          planningMode:
                            type: string
                            enum:
                              - auto
                              - never
                              - always
                            description: Planning behavior mode for the agent
                          structuredOutputSchema:
                            oneOf:
                              - $ref: '#/components/schemas/CotoolJsonSchema'
                              - type: 'null'
                            description: >-
                              Optional JSON schema describing the structured
                              output the agent should emit (may include x-cotool
                              metadata for preset UX; metadata is stripped
                              before sending to the LLM)
                          persistentWorkspaceEnabled:
                            type: boolean
                            description: Whether this agent may use persistent workspace
                          tags:
                            type: array
                            items:
                              type: string
                              minLength: 1
                              maxLength: 100
                              description: >-
                                A tag label for categorizing agents (normalized
                                to lowercase)
                            description: Array of tags for categorizing the agent
                          skills:
                            type: array
                            items:
                              type: object
                              properties:
                                skillId:
                                  type: string
                                  format: uuid
                                  description: Unique identifier of an attached skill
                                skillVersionId:
                                  type:
                                    - string
                                    - 'null'
                                  format: uuid
                                  description: >-
                                    Pinned version ID, or null/undefined to
                                    track latest
                                invocationCount30d:
                                  type: number
                                  description: >-
                                    Distinct chats for this agent in the last 30
                                    days where the skill was read from the
                                    sandbox
                                skill:
                                  type: object
                                  properties:
                                    name:
                                      type: string
                                      pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
                                      minLength: 1
                                      maxLength: 64
                                      description: >-
                                        Machine-safe skill name used in sandbox
                                        paths and imports
                                    description:
                                      type: string
                                      description: Skill description
                                    requiredTools:
                                      type: array
                                      items:
                                        type: string
                                      description: Required tool types for this skill
                                  required:
                                    - name
                                    - description
                                    - requiredTools
                                  description: Skill metadata snapshot
                              required:
                                - skillId
                                - skill
                            description: Array of reusable skills attached to this agent
                          acceptanceCriteria:
                            type: array
                            items:
                              type: string
                              minLength: 1
                              maxLength: 500
                              description: >-
                                A user-configured acceptance criterion that must
                                be satisfied for an agent run
                            maxItems: 20
                            description: >-
                              Optional list of acceptance criteria evaluated for
                              every run
                          agentType:
                            type: string
                            enum:
                              - response
                              - detection
                            description: >-
                              Type of agent: response (standard) or detection
                              (security detection)
                          slackReplyScope:
                            type:
                              - string
                              - 'null'
                            enum:
                              - anyone
                              - cotool_users
                              - null
                            description: >-
                              Default Slack reply scope for chats not started by
                              a Slack trigger (null/absent → cotool_users)
                          origin:
                            type: string
                            enum:
                              - user
                              - orchestrator
                            description: 'Who created this agent: user or orchestrator'
                          syncKey:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Stable logical key for the agent (slug, immutable,
                              unique per org)
                          syncSource:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Sync backend managing this agent (e.g. "github");
                              null/absent when UI-managed
                          syncFilePath:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Path of the source YAML file for a GitOps-managed
                              agent
                          syncConfigId:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Which agent_sync_config (repo source) materialized
                              this managed agent; null when UI-managed
                          syncSourceUrl:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Link to the source YAML file on GitHub for a
                              GitOps-managed agent. Only returned when
                              retrieving a single agent; null when the agent is
                              UI-managed or its repository is not configured
                          detectionCategory:
                            type:
                              - string
                              - 'null'
                            enum:
                              - baseline_anomaly
                              - first_occurrence
                              - sequence_pattern
                              - privilege_escalation
                              - custom
                              - null
                            description: Category of detection (only for detection agents)
                          detectionQuery:
                            type:
                              - string
                              - 'null'
                            description: >-
                              The SIEM query for the detection (only for
                              detection agents)
                          siemType:
                            type:
                              - string
                              - 'null'
                            description: >-
                              The SIEM platform type (e.g., splunk, elastic) for
                              the detection (only for detection agents)
                          isSuggestion:
                            type: boolean
                            description: >-
                              Whether this detection is a suggestion (only for
                              detection agents)
                          lastDetectionRunAt:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Timestamp of when this detection was last run
                              (only for detection agents)
                          legacyDetection:
                            type: boolean
                            description: >-
                              Client-side marker for a migrated legacy customer
                              detection remapped to a unified agent
                          isBuiltIn:
                            type: boolean
                            const: false
                            description: >-
                              Whether this agent is built in to the system
                              (false for custom (user-created) agents)
                        required:
                          - id
                          - organizationId
                          - name
                          - description
                          - systemPrompt
                          - createdAt
                          - updatedAt
                          - deletedAt
                          - toolNames
                          - toolSelectionMode
                          - toolActionConfigs
                          - modelAlias
                          - planningMode
                          - agentType
                          - origin
                          - isBuiltIn
                    description: The newly created, non-managed copy
                  parkedAgentId:
                    type: string
                    format: uuid
                    description: >-
                      The now-parked (soft-deleted, recoverable) managed agent
                      that was converted
                  parkedAgentName:
                    type: string
                    description: Name of the parked managed agent
                  transferredTriggerNames:
                    type: array
                    items:
                      type: string
                    description: >-
                      Names of the triggers transferred from the parked agent to
                      the copy (rows re-pointed, bindings preserved)
                required:
                  - agent
                  - parkedAgentId
                  - parkedAgentName
                  - transferredTriggerNames
                description: >-
                  The manual copy, the parked original, and which triggers were
                  transferred
        '400':
          description: Bad request — input validation failed or the request was malformed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '401':
          description: Unauthorized — missing or invalid API key / session
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden — the authenticated user lacks the required permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PermissionError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -X POST "https://app.cotool.ai/api/agents/:agentId/copy" \
              -H "Authorization: Bearer YOUR_API_KEY" \
              -H "Content-Type: application/json"
components:
  schemas:
    CotoolJsonSchema:
      type: object
      properties:
        type:
          type: string
          enum:
            - string
            - number
            - boolean
            - 'null'
            - object
            - array
        title:
          type: string
        description:
          type: string
        properties:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/CotoolJsonSchema'
        items:
          $ref: '#/components/schemas/CotoolJsonSchema'
        minItems:
          type: integer
          minimum: 0
        maxItems:
          type: integer
          minimum: 0
        required:
          type: array
          items:
            type: string
        enum:
          type: array
          items:
            type: string
        additionalProperties:
          type: boolean
        x-cotool:
          type: object
          properties:
            presetId:
              type: string
              enum:
                - classification
                - markdown
                - templatedReport
                - toolCallEvidence
            viewerId:
              type: string
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
      required:
        - type
      description: >-
        A JSON Schema definition with Cotool-specific extensions for structured
        output presets
    ValidationError:
      type: object
      properties:
        error:
          type: string
          description: Error message describing what went wrong
        issues:
          type: array
          description: >-
            Detailed validation issues, present when request or response schema
            validation fails
          items:
            type: object
            additionalProperties: true
      required:
        - error
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message describing what went wrong
      required:
        - error
    PermissionError:
      type: object
      properties:
        error:
          type: string
          description: Error message describing what went wrong
        missingPerms:
          type: array
          description: Permissions the authenticated user is missing for this operation
          items:
            type: string
      required:
        - error
    JsonValue:
      anyOf:
        - type: string
        - type: number
        - type: boolean
        - type: 'null'
        - type: array
          items:
            $ref: '#/components/schemas/JsonValue'
        - type: object
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
      description: A JSON value (string, number, boolean, null, array, or object)
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        API Key authentication for programmatic access. Include your API key in
        the Authorization header as: `Bearer your_api_key_here`

````

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