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

# Start a fleet with its first message

> Creates an active fleet, its thread and its first turn in one transaction. The fleet runs on `model_ref`, or on the workspace's selected model when it is omitted. It is named `name`, or `fleet-` and the last 12 hex digits of its id. Its answer arrives on `GET /v1/workspaces/{workspace_id}/fleets/{fleet_id}/turns/stream`. Retry with the same `operation_id` and body to receive the same fleet with `replayed: true`. The same key with another body answers 409 `UZ-FLEET-004`. A key whose fleet was deleted answers 410 `UZ-FLEET-006`. Invalid images return 400 `UZ-AGT-026`. A text-only model returns 409 `UZ-AGT-027`.



## OpenAPI

````yaml https://raw.githubusercontent.com/agentsfleet/agentsfleet/main/public/openapi.json post /v1/workspaces/{workspace_id}/fleets
openapi: 3.1.0
info:
  title: agentsfleet API
  description: API for managing workspaces, fleets, triggers, and runs.
  contact:
    name: agentsfleet
    url: https://agentsfleet.net
  license:
    name: MIT
    identifier: MIT
  version: 1.0.0
servers:
  - url: https://api.agentsfleet.net
    description: Production
security: []
paths:
  /v1/workspaces/{workspace_id}/fleets:
    post:
      tags:
        - Fleets
      summary: Start a fleet with its first message
      description: >-
        Creates an active fleet, its thread and its first turn in one
        transaction. The fleet runs on `model_ref`, or on the workspace's
        selected model when it is omitted. It is named `name`, or `fleet-` and
        the last 12 hex digits of its id. Its answer arrives on `GET
        /v1/workspaces/{workspace_id}/fleets/{fleet_id}/turns/stream`. Retry
        with the same `operation_id` and body to receive the same fleet with
        `replayed: true`. The same key with another body answers 409
        `UZ-FLEET-004`. A key whose fleet was deleted answers 410
        `UZ-FLEET-006`. Invalid images return 400 `UZ-AGT-026`. A text-only
        model returns 409 `UZ-AGT-027`.
      operationId: create_fleet
      parameters:
        - name: workspace_id
          in: path
          description: >-
            Workspace identifier (version 7 universally unique identifier, or
            UUID).
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFleetRequest'
        required: true
      responses:
        '200':
          description: 'A repeat of an earlier create: the same fleet and turn'
          headers:
            ETag:
              schema:
                type: string
            Location:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatedFleet'
        '201':
          description: The new fleet and its first turn
          headers:
            ETag:
              schema:
                type: string
            Location:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatedFleet'
        '400':
          description: Invalid message, key, model or name
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '401':
          description: Authentication is missing, invalid, or not accepted by this endpoint
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '403':
          description: You do not have permission for this action
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '409':
          description: >-
            No usable model (`UZ-FLEET-005`), a taken name (`UZ-AGT-006`), or a
            key used with another body (`UZ-FLEET-004`)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '410':
          description: The key's fleet was deleted (`UZ-FLEET-006`)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '413':
          description: Body too large
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '429':
          description: A request or capacity limit has been reached
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '500':
          description: An internal server error occurred
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '503':
          description: A required service is unavailable
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
      security:
        - BearerAuth: []
components:
  schemas:
    CreateFleetRequest:
      type: object
      description: >-
        `POST /v1/workspaces/{workspace_id}/fleets`: a person's first message
        makes

        an active fleet and its first turn in one transaction.
      required:
        - message
        - operation_id
      properties:
        images:
          type: array
          items:
            $ref: '#/components/schemas/MessageImage'
          description: Images accompanying the first message.
        message:
          type: string
          description: |-
            What to say to the new fleet: 1 to 1,048,576 characters, with no NUL
            character, counted on the decoded text.
        model_ref:
          type: string
          description: >-
            The workspace model to use; the workspace's selected model when
            omitted.
          minLength: 1
        name:
          type: string
          description: >-
            Validated instance slug; `fleet-` and the last 12 hex digits of the
            new

            fleet's id when omitted.
          maxLength: 64
          minLength: 1
        operation_id:
          type: string
          description: >-
            Required retry identifier: a version 7 universally unique identifier

            (UUID). A retry with the same `operation_id` and request answers the

            first fleet; the same key with other text answers 409
            `UZ-FLEET-004`.
          maxLength: 36
          minLength: 36
      additionalProperties: false
    CreatedFleet:
      type: object
      description: >-
        `POST /v1/workspaces/{workspace_id}/fleets`: the fleet and its first
        turn.
      required:
        - fleet
        - accepted
        - replayed
      properties:
        accepted:
          $ref: '#/components/schemas/FirstTurn'
          description: The first message, as the fleet's first turn.
        fleet:
          $ref: '#/components/schemas/FleetResponse_Value'
          description: The created fleet.
        replayed:
          type: boolean
          description: |-
            Whether an earlier create with the same `operation_id` already made
            this fleet: `true` on a repeat, which answers 200.
    ProblemBody:
      type: object
      description: The body every refusal carries, under `application/problem+json`.
      required:
        - docs_uri
        - title
        - detail
        - error_code
        - request_id
      properties:
        action_id:
          type:
            - string
            - 'null'
          description: 'On that 409 only: the action the gate held.'
        current_state:
          type:
            - string
            - 'null'
          description: 'On a 409 only: the state that forbade the transition.'
        detail:
          type: string
          description: One sentence on what was refused and why.
        docs_uri:
          type: string
          description: Where the error code is documented.
        error_code:
          type: string
          description: The registry code, stable across releases.
        etag:
          type:
            - string
            - 'null'
          description: >-
            On a 412 only: the resource's current entity tag, to refetch and
            retry.
        gate_id:
          type:
            - string
            - 'null'
          description: 'On an answered approval gate''s 409 only: the gate that was answered.'
        local_read_permitted:
          type:
            - boolean
            - 'null'
          description: >-
            On a temporary extract outage, true authorizes one local read under
            the fleet's network policy.
        outcome:
          type:
            - string
            - 'null'
          description: 'On that 409 only: the answer that stands.'
        request_id:
          type: string
          description: The request this refusal answers, for support.
        resolved_at:
          type:
            - string
            - 'null'
          format: date-time
          description: 'On that 409 only: when the standing answer was given.'
        resolved_by:
          type:
            - string
            - 'null'
          description: 'On that 409 only: who gave it.'
        title:
          type: string
          description: A short name for the refusal, safe to show a person.
        user_message:
          type:
            - string
            - 'null'
          description: A curated sentence for end users, where the code has one.
    MessageImage:
      type: object
      description: An image attached to a person or API client's message.
      required:
        - media_type
        - data
      properties:
        data:
          type: string
          description: Standard base64; at most 5 MiB when decoded.
        media_type:
          type: string
          description: One of `image/png`, `image/jpeg`, `image/gif` and `image/webp`.
      additionalProperties: false
    FirstTurn:
      type: object
      description: The first message a create accepted, as the fleet's first turn.
      required:
        - turn_id
        - disposition
      properties:
        disposition:
          $ref: '#/components/schemas/FirstTurnDisposition'
          description: Where it went.
        turn_id:
          type: string
          description: The turn the message became; filter the fleet's turn stream on it.
    FleetResponse_Value:
      type: object
      description: Shared fleet resource, returned by create, read and every change.
      required:
        - id
        - name
        - status
        - etag
        - model_ref
        - http_egress
        - package_domains
        - schedules
        - triggers
        - grants
        - memory_access
        - created_at
        - updated_at
        - events_processed
        - budget_used_nanos
        - pending_approvals
      properties:
        budget_used_nanos:
          $ref: '#/components/schemas/Nanos'
          description: Exact lifetime spend in nanos.
        created_at:
          type: string
          format: date-time
          description: Creation timestamp, such as `2026-10-24T05:00:00.000Z`.
        etag:
          type: string
          description: Strong resource tag for every change.
        events_processed:
          type: string
          description: Exact lifetime event count.
        grants:
          type: array
          items:
            $ref: '#/components/schemas/Grant'
          description: The secrets and integrations it asked for, and where each stands.
        http_egress:
          $ref: '#/components/schemas/HttpEgress'
          description: >-
            Where the fleet's HTTP tools may reach: `restricted` to the hosts of
            its

            approved access, or `public`. A new fleet is `restricted`.
        id:
          type: string
          description: Fleet identity.
        memory_access:
          $ref: '#/components/schemas/MemoryAccess'
          description: Current independent shared-memory permissions.
        model_ref:
          type: string
          description: |-
            The workspace model the fleet's runs use; copy one from
            `GET /v1/workspaces/{workspace_id}/models`.
        name:
          type: string
          description: Validated instance slug.
        package_domains:
          type: boolean
          description: |-
            Whether its HTTP tools may also reach the package registries. A new
            fleet may not.
        pending_approvals:
          type: integer
          format: int64
          description: Current unanswered approval gates.
        schedules:
          type: array
          items:
            type: object
          description: Stored schedule observations.
        status:
          type: string
          description: '`active` or `archived`.'
        triggers:
          type: array
          items:
            $ref: '#/components/schemas/Trigger'
          description: What else may wake it, as its rows hold them.
        updated_at:
          type: string
          format: date-time
          description: Last update timestamp, such as `2026-10-24T05:00:00.000Z`.
    FirstTurnDisposition:
      type: string
      description: |-
        Where a new fleet's first message went. Nothing runs ahead of it, so it
        never joins a live run.
      enum:
        - started
        - queued
    Nanos:
      type: string
      description: A whole number of nanos (10⁻⁹ US dollars) as a decimal string.
      pattern: ^(0|[1-9][0-9]*)$
    Grant:
      type: object
      description: One grant as the fleet's list shows it.
      required:
        - id
        - kind
        - name
        - status
      properties:
        approved_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When a person or the workspace's connection approved it, or `null`.
        id:
          type: string
          description: The grant's own row id — what a revoke addresses it by.
        kind:
          type: string
          description: '`secret`, `integration` or `host`, from [`grant_type`].'
        name:
          type: string
          description: The vault key or integration the fleet asked for.
        requested_scope:
          type:
            - object
            - 'null'
          description: A wider GitHub scope asked for and not yet approved, or `null`.
        scope:
          type:
            - object
            - 'null'
          description: >-
            The GitHub scope in force, `{repositories, access, base? | bases?}`,
            or `null`.
        status:
          type: string
          description: Where the decision stands, from [`status`].
    HttpEgress:
      type: string
      description: Which public HTTPS destinations HTTP tools may reach.
      enum:
        - restricted
        - public
    MemoryAccess:
      type: object
      description: Current shared-memory permissions.
      required:
        - read
        - publish
      properties:
        publish:
          type: boolean
          description: Publish permission.
        read:
          type: boolean
          description: Read permission.
      additionalProperties: false
    Trigger:
      type: object
      description: |-
        One trigger: a webhook source, the GitHub App subscription, or one Slack
        channel. The fleet adds it by tool; a person lists and removes it.
      required:
        - id
        - kind
        - source
        - created_at
      properties:
        channel:
          type:
            - string
            - 'null'
          description: A mention's channel identifier, or `null`.
        created_at:
          type: string
          format: date-time
          description: When the fleet added it, such as `2026-10-24T05:00:00.000Z`.
        events:
          type:
            - array
            - 'null'
          items:
            type: string
          description: The event names that wake the fleet, or `null` for every event.
        id:
          type: string
          description: 'The trigger''s identity: what a remove names.'
        kind:
          $ref: '#/components/schemas/TriggerKind'
          description: What wakes the fleet.
        repositories:
          type:
            - array
            - 'null'
          items:
            type: string
          description: The repositories whose App events wake the fleet, or `null`.
        source:
          type: string
          description: >-
            A webhook's source slug, `github` for an App event, `slack` for a
            mention.
        url:
          type:
            - string
            - 'null'
          description: >-
            A webhook's delivery address, `/v1/webhooks/{fleet_id}/{source}` on
            this

            deployment, or `null` for another kind.
    TriggerKind:
      type: string
      description: >-
        What wakes the fleet: a signed delivery to its own URL, an event from
        the

        workspace's GitHub App, or a mention in one Slack channel.
      enum:
        - webhook
        - app_event
        - mention
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Send a dashboard session token, an account API key (`agt_t`), or a
        command-line credential (`afc_`) as a Bearer token. Each endpoint lists
        accepted credential types.

````

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