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

# Create a persistent agent

> Project admins only. The agent becomes a member of the project under its own bot user, which authors everything its runs do. A turn is bounded by the permissions of the person chatting, or of the creator when nobody is behind it. An enabled agent opens the creator's main chat with it and speaks first, asking what it is for so it can write its description.



## OpenAPI

````yaml /openapi/customer-api.json post /project/{projectId}/agents
openapi: 3.0.0
info:
  contact: {}
  description: >-
    Flow customer API reference. Start with the [quickstart](/api/quickstart)
    and [authentication guide](/api/authentication).
  title: Customer API
  version: 1.0.0
servers:
  - description: Flow API
    url: '{baseUrl}'
    variables:
      baseUrl:
        default: https://backend.branch.flowengineering.com
security: []
tags:
  - name: Audit
  - name: Automations
  - name: Branches
  - name: Comments
  - name: Convert
  - name: Data Model
  - name: Diagrams
  - name: Entities
  - name: Events
  - name: Files
  - name: Import
  - name: Notifications
  - name: Persistent agents
  - name: Projects
  - name: ReqIF
  - name: ReqIF Import
  - name: Review policy
  - name: Shared Access Grants
  - name: User Groups
  - name: Users
paths:
  /project/{projectId}/agents:
    post:
      tags:
        - Persistent agents
      summary: Create a persistent agent
      description: >-
        Project admins only. The agent becomes a member of the project under its
        own bot user, which authors everything its runs do. A turn is bounded by
        the permissions of the person chatting, or of the creator when nobody is
        behind it. An enabled agent opens the creator's main chat with it and
        speaks first, asking what it is for so it can write its description.
      operationId: AgentDefinitionsController_create
      parameters:
        - in: path
          name: projectId
          required: true
          schema:
            type: string
        - description: Workspace identifier
          in: header
          name: customer
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAgentDefinitionDto'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentDefinitionDto'
          description: ''
      security:
        - api-key: []
        - bearer: []
components:
  schemas:
    CreateAgentDefinitionDto:
      properties:
        avatarColor:
          enum:
            - primary
            - red
            - amber
            - lime
            - emerald
            - sky
            - blue
            - indigo
            - violet
            - fuchsia
            - gray
            - black
          type: string
        avatarRatio:
          enum:
            - '1:1'
            - '1:2'
            - '2:1'
            - '2:3'
            - '1:3'
            - '3:1'
          type: string
        avatarShape:
          enum:
            - square
            - squircle
            - circle
            - pill
            - diamond
            - triangle
            - pentagon
            - hexagon
            - octagon
            - shield
            - scallop
            - blob
            - drop
            - star
          type: string
        description:
          description: >-
            What the agent is for, in markdown, shown to people; the brief the
            agent follows on every turn. Blank clears it.
          nullable: true
          type: string
        enabled:
          type: boolean
        name:
          type: string
        role:
          description: >-
            A one-line role shown under the name, such as "Thermal reviewer".
            Blank clears it.
          nullable: true
          type: string
        suggestOnly:
          type: boolean
        triggers:
          description: >-
            The agent's triggers, written whole: each one an automation
            trigger's settings and the prompt a firing hands the agent. Firing
            one starts a side chat with the agent, as the agent, with that
            prompt.
          items:
            $ref: '#/components/schemas/AgentTriggerInputDto'
          type: array
      required:
        - name
      type: object
    AgentDefinitionDto:
      properties:
        avatarColor:
          enum:
            - primary
            - red
            - amber
            - lime
            - emerald
            - sky
            - blue
            - indigo
            - violet
            - fuchsia
            - gray
            - black
          type: string
        avatarRatio:
          enum:
            - '1:1'
            - '1:2'
            - '2:1'
            - '2:3'
            - '1:3'
            - '3:1'
          type: string
        avatarShape:
          enum:
            - square
            - squircle
            - circle
            - pill
            - diamond
            - triangle
            - pentagon
            - hexagon
            - octagon
            - shield
            - scallop
            - blob
            - drop
            - star
          type: string
        botUserId:
          type: string
        createdAt:
          type: string
        createdBy:
          type: string
        description:
          nullable: true
          type: string
        enabled:
          type: boolean
        id:
          type: string
        name:
          type: string
        projectId:
          type: string
        role:
          nullable: true
          type: string
        suggestOnly:
          type: boolean
        triggers:
          items:
            $ref: '#/components/schemas/AgentTriggerDto'
          type: array
        updatedAt:
          type: string
        updatedBy:
          type: string
      required:
        - id
        - projectId
        - name
        - description
        - role
        - botUserId
        - enabled
        - suggestOnly
        - avatarColor
        - avatarShape
        - avatarRatio
        - createdBy
        - updatedBy
        - createdAt
        - updatedAt
        - triggers
      type: object
    AgentTriggerInputDto:
      properties:
        id:
          description: The id of a stored entry to keep; omitted for a new one.
          type: string
        prompt:
          description: What the agent is told when the trigger fires.
          type: string
        trigger:
          $ref: '#/components/schemas/AgentTriggerSettingsDto'
      required:
        - prompt
        - trigger
      type: object
    AgentTriggerDto:
      properties:
        configuredAt:
          type: string
        configuredBy:
          description: Who last wrote this entry.
          type: string
        id:
          type: string
        prompt:
          type: string
        trigger:
          $ref: '#/components/schemas/AgentTriggerSettingsDto'
      required:
        - id
        - prompt
        - trigger
        - configuredBy
        - configuredAt
      type: object
    AgentTriggerSettingsDto:
      properties:
        authors:
          items:
            type: string
          type: array
        branch:
          description: A manual trigger that the branch menu offers.
          type: boolean
        branchId:
          type: string
        branchIds:
          items:
            type: string
          type: array
        cronExpression:
          type: string
        paths:
          items:
            type: string
          type: array
        source:
          description: >-
            An automation trigger source: manual, schedule, branch, endpoint,
            github, github_merged, gitlab, gitlab_merged, bitbucket, onshape,
            teamcenter, import, slack, project_activity, or a custom webhook
            name.
          type: string
        timeZone:
          type: string
        types:
          description: >-
            A manual trigger that the context menus of these item types
            (category ids) offer.
          items:
            type: string
          type: array
      required:
        - source
      type: object
  securitySchemes:
    api-key:
      in: header
      name: X-API-Key
      type: apiKey
    bearer:
      bearerFormat: JWT
      scheme: bearer
      type: http

````

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