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

# Create a workspace

> Creates a named workspace in the caller's tenant. The server assigns the workspace identifier. This operation does not accept a replay key or retry automatically. After an uncertain response, query the tenant's workspaces with the exact name. Retrying the same tenant-unique name cannot create a second row and returns 409 when the first request committed.




## OpenAPI

````yaml https://raw.githubusercontent.com/agentsfleet/agentsfleet/main/public/openapi.json post /v1/workspaces
openapi: 3.1.0
info:
  title: agentsfleet Control Plane API
  version: 1.0.0
  description: API for managing workspaces, fleets, triggers, and runs.
  contact:
    name: agentsfleet
    url: https://agentsfleet.net
servers:
  - url: https://api.agentsfleet.net
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Health
    description: System status and readiness probes
    x-mintlify:
      navigation: Health
  - name: Authentication
    description: Command Line Interface (CLI) sign-in sessions and GitHub sign-in
    x-mintlify:
      navigation: Authentication
  - name: Workspaces
    description: Create and manage workspaces
    x-mintlify:
      navigation: Workspaces
  - name: Tenant
    description: Manage tenant provider settings and models
    x-mintlify:
      navigation: Tenant
  - name: auth-identity-events
    description: >-
      Process signed account events from Clerk. This route is not for customer
      fleets.
    x-mintlify:
      navigation: Auth Identity Events
  - name: Fleets
    description: Create, configure, and run fleets
    x-mintlify:
      navigation: Fleets
  - name: Schedules
    description: Manage and receive scheduled Fleet events
    x-mintlify:
      navigation: Schedules
  - name: Memory
    description: Read and search saved fleet memory
    x-mintlify:
      navigation: Memory
  - name: Secrets
    description: Manage named secrets for fleets in a workspace
    x-mintlify:
      navigation: Secrets
  - name: Admin
    description: Manage shared provider keys and models
    x-mintlify:
      navigation: Admin
  - name: Billing
    description: Read tenant balances and charge records
    x-mintlify:
      navigation: Billing
  - name: Integration Grants
    description: Manage fleet access to third-party services
    x-mintlify:
      navigation: Integration Grants
  - name: Connectors
    description: Connect workspaces to third-party providers
    x-mintlify:
      navigation: Connectors
  - name: Fleet Keys
    description: Manage keys that let external clients call a fleet
    x-mintlify:
      navigation: Fleet Keys
  - name: API Keys
    description: Manage tenant admin API keys
    x-mintlify:
      navigation: API Keys
  - name: Webhooks
    description: Receive signed events and approval decisions
    x-mintlify:
      navigation: Webhooks
  - name: Approvals
    description: List, inspect, and resolve pending approvals
    x-mintlify:
      navigation: Approvals
  - name: Fleet
    description: Enroll and manage runners
    x-mintlify:
      navigation: Fleet
  - name: Fleet Bundles
    description: Manage fleet source bundles in a workspace
    x-mintlify:
      navigation: Fleet Bundles
  - name: Fleet library
    description: Browse and add reusable fleet sources
    x-mintlify:
      navigation: Fleet library
  - name: Model Library
    description: List models available to the tenant
    x-mintlify:
      navigation: Model Library
paths:
  /v1/workspaces:
    post:
      tags:
        - Workspaces
      summary: Create a workspace
      description: >
        Creates a named workspace in the caller's tenant. The server assigns the
        workspace identifier. This operation does not accept a replay key or
        retry automatically. After an uncertain response, query the tenant's
        workspaces with the exact name. Retrying the same tenant-unique name
        cannot create a second row and returns 409 when the first request
        committed.
      operationId: create_workspace
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 128
                  pattern: >-
                    ^(?![\u0009-\u000D\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028-\u2029\u202F\u205F\u3000]*$)[\u0009-\u000D\u0020]*[^\u0000-\u0020\u007F-\u009F\u061C\u200E-\u200F\u2028-\u202E\u2066-\u2069](?:[^\u0000-\u001F\u007F-\u009F\u061C\u200E-\u200F\u2028-\u202E\u2066-\u2069]*[^\u0000-\u0020\u007F-\u009F\u061C\u200E-\u200F\u2028-\u202E\u2066-\u2069])?[\u0009-\u000D\u0020]*$
                  description: >-
                    Required human-readable workspace name. Leading and trailing
                    ASCII whitespace is removed. The remaining name must not be
                    empty, must contain at most 128 Unicode code points, and
                    must not contain control or directional formatting
                    characters. The name must be unique within the tenant.
      responses:
        '201':
          description: Workspace created
          content:
            application/json:
              schema:
                type: object
                required:
                  - workspace_id
                  - name
                  - request_id
                  - tenant_id
                properties:
                  workspace_id:
                    type: string
                    format: uuid
                    description: Unique workspace identifier
                  name:
                    type: string
                    description: The caller-supplied workspace name.
                  request_id:
                    type: string
                    description: Unique request identifier
                  tenant_id:
                    type: string
                    format: uuid
                    x-stability: stable
                    description: Tenant identifier resolved by the server.
        '409':
          description: A workspace with this name already exists in the tenant
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorBody'
                  - type: object
                    required:
                      - current_state
                    properties:
                      error_code:
                        type: string
                        enum:
                          - UZ-WORKSPACE-001
                      current_state:
                        type: string
                        enum:
                          - name_exists
              example:
                docs_uri: >-
                  https://docs.agentsfleet.net/api-reference/error-codes#UZ-WORKSPACE-001
                title: Workspace name already exists
                detail: A workspace with this name already exists
                error_code: UZ-WORKSPACE-001
                request_id: req_01JWORKSPACE
                current_state: name_exists
                user_message: >-
                  A workspace with that name already exists. Check the refreshed
                  list or choose another name.
        default:
          $ref: '#/components/responses/Error'
components:
  schemas:
    ErrorBody:
      type: object
      description: RFC 7807 problem detail error response (application/problem+json)
      required:
        - docs_uri
        - title
        - detail
        - error_code
        - request_id
      properties:
        docs_uri:
          type: string
          format: uri
          description: Stable link to documentation for this error code
          example: https://docs.agentsfleet.net/api-reference/error-codes#UZ-AGT-009
        title:
          type: string
          description: Short human-readable label, same for every occurrence of this code
          example: Fleet not found
        detail:
          type: string
          description: Instance-specific context describing what went wrong
          example: No fleet with id 'abc123' in this workspace.
        error_code:
          type: string
          description: Machine-readable error code
          example: UZ-AGT-009
        request_id:
          type: string
          description: Correlation ID for this request
        current_state:
          type: string
          description: >-
            Resource state that blocked the requested change. Present only on
            409 responses.
          example: paused
        user_message:
          type: string
          description: >
            Plain message safe to show to a user. Present only when an error
            defines one.


            Use `detail` or `title` when this field is absent.
          example: >-
            We couldn't find that Fleet. It may have been deleted, or the ID
            doesn't match one in this workspace.
        etag:
          type: string
          description: >-
            Resource version returned on 412 responses so the caller can refetch
            and retry.
  responses:
    Error:
      description: RFC 7807 problem detail error response
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Obtain a token via the CLI auth flow (POST /v1/auth/sessions) or GitHub
        OAuth

````