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

# Register a tenant runner

> Registers a runner that takes only the calling tenant's work. Requires `runner:tenant`, which a platform admin grants per account. A host registers once: `host_id` is unique within the tenant, and `Idempotency-Key` is not used. Registering a host again answers 409 with `current_state` `registered` and `Location` naming its runner. The token appears only once, so recover it with that runner's `rotate` action. Durable tasks are stored off whatever the body asks; only a platform admin turns them on.



## OpenAPI

````yaml https://raw.githubusercontent.com/agentsfleet/agentsfleet/main/public/openapi.json post /v1/tenants/me/runners
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/tenants/me/runners:
    post:
      tags:
        - Runners
      summary: Register a tenant runner
      description: >-
        Registers a runner that takes only the calling tenant's work. Requires
        `runner:tenant`, which a platform admin grants per account. A host
        registers once: `host_id` is unique within the tenant, and
        `Idempotency-Key` is not used. Registering a host again answers 409 with
        `current_state` `registered` and `Location` naming its runner. The token
        appears only once, so recover it with that runner's `rotate` action.
        Durable tasks are stored off whatever the body asks; only a platform
        admin turns them on.
      operationId: register_tenant_runner
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterRequest'
        required: true
      responses:
        '201':
          description: Runner registered; the bearer token is returned exactly once
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegisterResponse'
        '400':
          description: The request is invalid
          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: This host is already registered; `Location` names its runner
          headers:
            Location:
              schema:
                type: string
              description: The runner the host is registered as
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '413':
          description: The request body exceeds this endpoint's size limit
          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:
    RegisterRequest:
      type: object
      description: >-
        `POST /v1/admin/runners` request. Authorized by an existing operator
        credential,

        not an enrollment token. The operator ASSIGNS the policy; the host never

        declares one.
      required:
        - host_id
        - assigned_policy
        - labels
      properties:
        assigned_policy:
          $ref: '#/components/schemas/AssignedPolicy'
          description: The policy the operator assigns to it.
        host_id:
          type: string
          description: Stable identifier for the host being enrolled.
        labels:
          type: array
          items:
            type: string
          description: |-
            Operator labels for placement and filtering. A label given twice is
            stored once.
      additionalProperties: false
    RegisterResponse:
      type: object
      description: >-
        Registered runner and its access token. Save the token securely; it is
        returned once and

        only its hash is stored.
      required:
        - runner_id
        - runner_token
        - assigned_policy
      properties:
        assigned_policy:
          $ref: '#/components/schemas/AssignedPolicy'
          description: |-
            The assignment AS STORED, with the worker count clamped, so the
            enrolling operator sees exactly what the host will apply.
        runner_id:
          type: string
          description: The runner's durable identifier.
        runner_token:
          type: string
          description: The minted bearer token. Secret — revealed once, never re-readable.
      additionalProperties: false
    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.
    AssignedPolicy:
      type: object
      description: >-
        Sandbox isolation, outgoing network access, and concurrency settings
        assigned to this

        runner.
      required:
        - durable_tasks_enabled
        - sandbox_tier
        - network_policy
        - registry_allowlist
        - worker_count
      properties:
        decision_model_id:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            Canonical `UUIDv7` of the platform decision model; absent disables
            decisions.
        durable_tasks_enabled:
          type: boolean
          description: >-
            Permit new durable task runs; existing runs retain their issued
            mode.
        network_policy:
          $ref: '#/components/schemas/RunnerNetworkPolicy'
          description: Outgoing network access policy to apply.
        registry_allowlist:
          type: array
          items:
            type: string
          description: >-
            Default package registries added to each assignment's allowed
            network hosts. An empty

            list uses the runner's defaults.
        sandbox_tier:
          $ref: '#/components/schemas/SandboxTier'
          description: Isolation strength to apply.
        worker_count:
          type: integer
          format: int32
          description: Concurrent workers the runner may start. Clamped on both sides.
          minimum: 0
    RunnerNetworkPolicy:
      type: string
      description: Outgoing network access policy assigned to a runner.
      enum:
        - allow_all
        - deny_all_egress
        - allow_list_egress
    SandboxTier:
      type: string
      description: |-
        The isolation strength assigned to a runner, named for the engine that
        delivers it.
      enum:
        - firecracker
  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.