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

# Ask for a host, secret or integration

> Asks for `name` for the assigned fleet: a workspace secret or a connected integration. An alternative `host` asks for a DNS hostname for web access. `github` names its `scope`. A request the fleet's approved grant already covers answers 200 with no card. For a connected integration, the workspace's connection approves the card and answers 201 with state `approved`. That holds on a turn no fleet started, for a grant no person revoked. The run then ends waiting and resumes with the access. Any other raises a card carrying the run's turn and answers 201 with state `raised`; the run then ends waiting for a person's answer. A card already open for the name answers 200. A retry the connection completes answers 201 `approved` again. A name the workspace lacks answers `UZ-AGT-022`, an integration it has not connected `UZ-AGT-023`.



## OpenAPI

````yaml https://raw.githubusercontent.com/agentsfleet/agentsfleet/main/public/openapi.json post /v1/runners/me/runs/{run_id}/access
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/runners/me/runs/{run_id}/access:
    post:
      tags:
        - Integration Grants
      summary: Ask for a host, secret or integration
      description: >-
        Asks for `name` for the assigned fleet: a workspace secret or a
        connected integration. An alternative `host` asks for a DNS hostname for
        web access. `github` names its `scope`. A request the fleet's approved
        grant already covers answers 200 with no card. For a connected
        integration, the workspace's connection approves the card and answers
        201 with state `approved`. That holds on a turn no fleet started, for a
        grant no person revoked. The run then ends waiting and resumes with the
        access. Any other raises a card carrying the run's turn and answers 201
        with state `raised`; the run then ends waiting for a person's answer. A
        card already open for the name answers 200. A retry the connection
        completes answers 201 `approved` again. A name the workspace lacks
        answers `UZ-AGT-022`, an integration it has not connected `UZ-AGT-023`.
      operationId: runner_request_access
      parameters:
        - name: run_id
          in: path
          description: Run identifier (version 7 universally unique identifier, or UUID).
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccessRequest'
        required: true
      responses:
        '200':
          description: Covered, or a card is already open
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessRequested'
        '201':
          description: >-
            A card was raised, or the workspace's connection approved the
            request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessRequested'
        '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'
        '404':
          description: The resource was not found or is not accessible to you
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '409':
          description: The request conflicts with the resource's current state
          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:
        - RunnerBearerAuth: []
components:
  schemas:
    AccessRequest:
      allOf:
        - type: object
          description: '`POST /v1/runners/me/runs/{run_id}/access` request.'
          required:
            - fencing_token
          properties:
            evidence:
              oneOf:
                - $ref: '#/components/schemas/RedirectEvidence'
                  description: >-
                    Redirect evidence recorded by the runner, present only for a
                    matching host.
                - type: 'null'
            fencing_token:
              type: integer
              format: int64
              description: >-
                The run's fencing token; a holder the fleet has superseded is
                refused.
              minimum: 0
            host:
              oneOf:
                - $ref: '#/components/schemas/Hostname'
                  description: A host grant, mutually exclusive with a credential name.
                - type: 'null'
            name:
              type:
                - string
                - 'null'
              description: >-
                The workspace vault key or connected integration, such as
                `sentry` or

                `github`.
            scope:
              type:
                - object
                - 'null'
              description: >-
                The GitHub scope, `{repositories, access, base? | bases?}`;
                required for

                `github` and refused for any other name. The daemon reads it
                through

                `af_fleet_runtime::config::RepositoryBinding::parse`.
          additionalProperties: false
        - oneOf:
            - type: object
              required:
                - name
              properties:
                evidence:
                  type: 'null'
                host:
                  type: 'null'
                name:
                  type: string
                  minLength: 1
            - type: object
              required:
                - host
              properties:
                host:
                  type: string
                name:
                  type: 'null'
                scope:
                  type: 'null'
      description: >-
        Provide one credential name or one host. Only host requests accept
        redirect evidence, and its to_host must match the requested host.
    AccessRequested:
      type: object
      description: What an access request did.
      required:
        - state
        - grant_id
      properties:
        gate_id:
          type:
            - string
            - 'null'
          description: >-
            The card when observed. A concurrent pending request may not yet see
            its ID.

            Runners use `state` to decide whether this turn waits or continues.
        grant_id:
          type: string
          description: The fleet's grant for the name.
        state:
          $ref: '#/components/schemas/AccessOutcome'
          description: >-
            What took place independent of whether the transaction saw the card
            ID.
    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.
    RedirectEvidence:
      type: object
      description: The adjacent hosts observed on a refused redirect during this run.
      required:
        - tool
        - from_host
        - to_host
      properties:
        from_host:
          $ref: '#/components/schemas/Hostname'
          description: The host that returned the redirect.
        to_host:
          $ref: '#/components/schemas/Hostname'
          description: The destination refused before connection.
        tool:
          $ref: '#/components/schemas/RefusedTool'
          description: The tool that encountered the refused redirect.
      additionalProperties: false
    Hostname:
      type: string
      description: >-
        A DNS hostname for a web-host grant, canonicalized before any lookup or
        recording.
    AccessOutcome:
      type: string
      description: >-
        Which run owns the decision card, or whether the grant already covers
        this request.
      enum:
        - raised
        - approved
        - pending
        - covered
    RefusedTool:
      type: string
      description: The tool whose actual network refusal supplied the redirect evidence.
      enum:
        - web_fetch
  securitySchemes:
    RunnerBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: agt_r
      description: >-
        Runner token beginning with agt_r, returned once by POST
        /v1/admin/runners

````

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