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

# Open a retirement case for an agent

> **Security Requirements**

| Auth Types | Entities | Permissions | Required Roles |
|------------|----------|-------------|----------------|
| USER | REGISTRY | WRITE | REGISTRY:WRITE |



## OpenAPI

````yaml /openapi/swarmd.json post /registry/v1/agents/{agentId}/retirement
openapi: 3.1.0
info:
  title: Relay
  version: v0
servers:
  - url: https://api.dev.swarmd.ai
    description: Development
security: []
tags:
  - name: Policy Groups
    x-displayName: Policy Groups
  - name: Policy Bindings
    x-displayName: Policy Bindings
  - name: Evaluation Packs
    x-displayName: Evaluation Packs
  - name: Webhooks
    x-displayName: Webhooks
  - name: MCP JSON-RPC
    x-displayName: MCP JSON-RPC
  - name: Conversations
    x-displayName: Conversations
  - name: Human JSON-RPC
    x-displayName: Human JSON-RPC
  - name: Channel JSON-RPC
    x-displayName: Channel JSON-RPC
  - name: HITL Approvals
    x-displayName: HITL Approvals
  - name: Agent JSON-RPC
    x-displayName: Agent JSON-RPC
  - name: Tasks
    x-displayName: Tasks
  - name: Push Notifications
    x-displayName: Push Notifications
  - name: Messaging
    x-displayName: Messaging
  - name: LLM Runtime
    x-displayName: LLM Runtime
  - name: Agent Discovery
    x-displayName: Agent Discovery
  - name: Governance
    x-displayName: Governance
  - name: MCP Servers
    x-displayName: MCP Servers
  - name: LLM Gateways
    x-displayName: LLM Gateways
  - name: Agents
    x-displayName: Agents
  - name: User Subscriptions
    x-displayName: User Subscriptions
  - name: LLM Providers
    x-displayName: LLM Providers
  - name: LLM Gateway Subscriptions
    x-displayName: LLM Gateway Subscriptions
  - name: Kill Switches
    x-displayName: Kill Switches
  - name: Channels
    x-displayName: Channels
  - name: Channel Subscriptions
    x-displayName: Channel Subscriptions
  - name: Agent Subscriptions
    x-displayName: Agent Subscriptions
  - name: Marketplace
    x-displayName: Marketplace
  - name: Identity Providers
    x-displayName: Identity Providers
  - name: Groups
    x-displayName: Groups
  - name: Authentication
    x-displayName: Authentication
  - name: Users
    x-displayName: Users
  - name: Tenants
    x-displayName: Tenants
  - name: Audit Retention
    x-displayName: Audit Retention
  - name: Audit Monitors
    x-displayName: Audit Monitors
  - name: Audit Integrity
    x-displayName: Audit Integrity
  - name: Audit Events
    x-displayName: Audit Events
  - name: Audit Traces
    x-displayName: Audit Traces
  - name: Audit Dashboard
    x-displayName: Audit Dashboard
  - name: A2A Payments
    x-displayName: A2A Payments
  - name: Licence Verification
    x-displayName: Licence Verification
  - name: ECR Credentials
    x-displayName: ECR Credentials
paths:
  /registry/v1/agents/{agentId}/retirement:
    post:
      tags:
        - Governance
      summary: Open a retirement case for an agent
      description: |-
        **Security Requirements**

        | Auth Types | Entities | Permissions | Required Roles |
        |------------|----------|-------------|----------------|
        | USER | REGISTRY | WRITE | REGISTRY:WRITE |
      operationId: openAgentRetirement
      parameters:
        - name: agentId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Registry_RetirementRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Registry_RetirementCaseResponse'
      security:
        - Registry_bearerAuth: []
components:
  schemas:
    Registry_RetirementRequest:
      type: object
      properties:
        reasonCategory:
          type: string
          enum:
            - END_OF_LIFE
            - SUPERSEDED
            - NON_CONFORMITY
            - SERIOUS_INCIDENT
            - CONTRACT_ENDED
            - NEVER_USED
        reason:
          type: string
        successorSubjectId:
          type: string
          format: uuid
        marketAction:
          type: string
          enum:
            - NONE
            - WITHDRAWN
            - RECALLED
    Registry_RetirementCaseResponse:
      type: object
      properties:
        caseId:
          type: string
          format: uuid
        subjectType:
          type: string
          enum:
            - AGENT
            - MCP_SERVER
            - LLM_GATEWAY
        subjectId:
          type: string
          format: uuid
        subjectName:
          type: string
        status:
          type: string
          enum:
            - OPEN
            - APPROVED
            - COMPLETED
            - CANCELLED
        reasonCategory:
          type: string
          enum:
            - END_OF_LIFE
            - SUPERSEDED
            - NON_CONFORMITY
            - SERIOUS_INCIDENT
            - CONTRACT_ENDED
            - NEVER_USED
        reason:
          type: string
        marketAction:
          type: string
          enum:
            - NONE
            - WITHDRAWN
            - RECALLED
        successorSubjectId:
          type: string
          format: uuid
        impact:
          $ref: '#/components/schemas/Registry_RetirementImpact'
        checklist:
          type: array
          items:
            $ref: '#/components/schemas/Registry_RetirementChecklistItem'
        checklistComplete:
          type: boolean
        approvalRequired:
          type: boolean
        approval:
          $ref: '#/components/schemas/Registry_GovernanceApprovalResponse'
        initiatedBy:
          type: string
          format: uuid
        createdAt:
          type: string
          format: date-time
        completedBy:
          type: string
          format: uuid
        completedAt:
          type: string
          format: date-time
        checkpointId:
          type: string
          format: uuid
        logRetentionUntil:
          type: string
          format: date
        documentationRetentionUntil:
          type: string
          format: date
        putIntoServiceAt:
          type: string
          format: date-time
    Registry_RetirementImpact:
      type: object
      properties:
        subscribers:
          type: array
          items:
            $ref: '#/components/schemas/Registry_Dependant'
        subscriptions:
          type: array
          items:
            $ref: '#/components/schemas/Registry_Dependant'
        userSubscribers:
          type: array
          items:
            $ref: '#/components/schemas/Registry_Dependant'
        channelSubscribers:
          type: array
          items:
            $ref: '#/components/schemas/Registry_Dependant'
        mcpServers:
          type: array
          items:
            $ref: '#/components/schemas/Registry_Dependant'
        llmGateways:
          type: array
          items:
            $ref: '#/components/schemas/Registry_Dependant'
        policyBindings:
          type: integer
          format: int32
        openHitlHolds:
          type: integer
          format: int32
        monitors:
          type: integer
          format: int32
        lastPassedEvaluationRunAt:
          type: string
          format: date-time
        computedAt:
          type: string
          format: date-time
    Registry_RetirementChecklistItem:
      type: object
      properties:
        id:
          type: string
        article:
          type: string
        label:
          type: string
        mandatory:
          type: boolean
        satisfied:
          type: boolean
        detail:
          type: string
        fixTarget:
          type: string
          enum:
            - CLASSIFICATION
            - ACCOUNTABILITY
            - COMPLIANCE_RECORD
            - ATTESTATION
            - IMPACT_PROFILE
            - POLICY_BINDINGS
            - EVALUATIONS
            - MONITORS
            - AUDIT_SETTINGS
            - TRANSPARENCY
    Registry_GovernanceApprovalResponse:
      type: object
      properties:
        approvalId:
          type: string
          format: uuid
        kind:
          type: string
          enum:
            - RETIREMENT
            - SUSPENSION_LIFT
        subjectType:
          type: string
          enum:
            - AGENT
            - MCP_SERVER
            - LLM_GATEWAY
        subjectId:
          type: string
          format: uuid
        subjectName:
          type: string
        riskTier:
          type: string
          enum:
            - UNCLASSIFIED
            - OUT_OF_SCOPE
            - MINIMAL
            - LIMITED
            - HIGH_RISK_EXEMPT
            - HIGH_RISK
            - PROHIBITED
        caseId:
          type: string
          format: uuid
        requestedBy:
          type: string
          format: uuid
        requestedAt:
          type: string
          format: date-time
        reason:
          type: string
        status:
          type: string
          enum:
            - PENDING
            - APPROVED
            - REJECTED
            - WITHDRAWN
        decidedBy:
          type: string
          format: uuid
        decidedAt:
          type: string
          format: date-time
        decisionNote:
          type: string
    Registry_Dependant:
      type: object
      properties:
        kind:
          type: string
        id:
          type: string
          format: uuid
        name:
          type: string
        detail:
          type: string
  securitySchemes:
    Registry_bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token (USER, AGENT, or SERVICE auth)

````