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

# Delegate a Request to an Agent

> Delegates the Request to an Agent, or takes it back from its Agent when `delegated_agent` is null. Only an Agent that is a member of the Request's team inbox can be delegated to; list them with `GET /v1/agents?delegable_on_request={uid}`. The API key owner becomes the delegator: the Request goes back to them at handoff, and they receive the Agent's approvals. Archived Requests cannot be delegated. Agent tokens are refused. Requests outside the API key owner's request visibility return a 404. This endpoint may change or be removed without prior notice.



## OpenAPI

````yaml /api-reference/openapi.yml patch /v1/requests/{uid}/delegated_agent
openapi: 3.0.1
info:
  title: Siit Public API
  version: v0
servers:
  - url: https://api.siit.io
security: []
paths:
  /v1/requests/{uid}/delegated_agent:
    parameters:
      - name: uid
        in: path
        description: The UID (or `friendly_id`) of the request
        required: true
        schema:
          type: string
    patch:
      tags:
        - Unstable
        - Request
      summary: Delegate a Request to an Agent
      description: >-
        Delegates the Request to an Agent, or takes it back from its Agent when
        `delegated_agent` is null. Only an Agent that is a member of the
        Request's team inbox can be delegated to; list them with `GET
        /v1/agents?delegable_on_request={uid}`. The API key owner becomes the
        delegator: the Request goes back to them at handoff, and they receive
        the Agent's approvals. Archived Requests cannot be delegated. Agent
        tokens are refused. Requests outside the API key owner's request
        visibility return a 404. This endpoint may change or be removed without
        prior notice.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - delegated_agent
              properties:
                delegated_agent:
                  type: string
                  nullable: true
                  description: >-
                    UID of the Agent to delegate to, or null to take the Request
                    back
                sent_by_uid:
                  type: string
                  nullable: true
                  description: >-
                    UID of the ADMIN user to act as, who then becomes the
                    delegator. Please note only the "Owner" account can use
                    this.
      responses:
        '200':
          description: Delegates the Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/request_delegation_object'
        '400':
          description: Agent not member of the Request inbox
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors_object'
        '403':
          description: No access to Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors_object'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors_object'
        '422':
          description: Agent stopped working on the Request at once
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors_object'
      security:
        - bearer: []
components:
  schemas:
    request_delegation_object:
      type: object
      properties:
        result:
          type: object
          properties:
            request_uid:
              type: string
              description: The UID of the Request
            delegated_agent:
              allOf:
                - $ref: '#/components/schemas/agent_reference'
              nullable: true
              description: The Agent now working on the Request, or null once taken back
    errors_object:
      type: object
      properties:
        error:
          type: string
        troubleshoot:
          type: string
    agent_reference:
      type: object
      properties:
        uid:
          type: string
          readOnly: true
          description: The UID of the Agent
        name:
          type: string
          description: The Agent name
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````