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

# Subscribe an agent to another agent

> **Security Requirements**

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



## OpenAPI

````yaml /openapi/swarmd.json post /registry/v1/agents/{agentId}/subscriptions
openapi: 3.0.1
info:
  title: OpenAPI definition
  version: v0
servers:
  - url: https://api.swarmd.ai
    description: Production
  - url: https://api.sandbox.swarmd.ai
    description: Sandbox
security: []
tags:
  - name: Policy Groups
    x-displayName: Policy Groups
  - name: Policy Bindings
    x-displayName: Policy Bindings
  - name: Webhooks
    x-displayName: Webhooks
  - 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: Conversations
    x-displayName: Conversations
  - name: Agent Discovery
    x-displayName: Agent Discovery
  - name: User Subscriptions
    x-displayName: User Subscriptions
  - name: MCP Servers
    x-displayName: MCP Servers
  - name: Kill Switches
    x-displayName: Kill Switches
  - name: Channels
    x-displayName: Channels
  - name: Channel Subscriptions
    x-displayName: Channel Subscriptions
  - name: Agents
    x-displayName: Agents
  - 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 Integrity
    x-displayName: Audit Integrity
  - name: Audit Events
    x-displayName: Audit Events
  - name: Audit Traces
    x-displayName: Audit Traces
  - name: A2A Payments
    x-displayName: A2A Payments
paths:
  /registry/v1/agents/{agentId}/subscriptions:
    post:
      tags:
        - Agent Subscriptions
      summary: Subscribe an agent to another agent
      description: |-
        **Security Requirements**

        | Auth Types | Entities | Permissions | Required Roles |
        |------------|----------|-------------|----------------|
        | USER | REGISTRY | WRITE | REGISTRY:WRITE |
      operationId: subscribe
      parameters:
        - name: agentId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentSubscriptionRequest'
        required: true
      responses:
        '204':
          description: No Content
      security:
        - bearerAuth: []
components:
  schemas:
    AgentSubscriptionRequest:
      required:
        - sinkAgentId
      type: object
      properties:
        sinkAgentId:
          type: string
          format: uuid
        authConfig:
          $ref: '#/components/schemas/SubscriptionAuthConfig'
    SubscriptionAuthConfig:
      required:
        - authType
      type: object
      properties:
        authType:
          type: string
          enum:
            - NONE
            - OAUTH2
            - API_KEY
            - BEARER
        oauth2:
          $ref: '#/components/schemas/OAuth2Config'
        apiKey:
          $ref: '#/components/schemas/ApiKeyConfig'
        bearer:
          $ref: '#/components/schemas/BearerTokenConfig'
    OAuth2Config:
      required:
        - clientId
        - clientSecret
        - tokenUrl
      type: object
      properties:
        clientId:
          type: string
        clientSecret:
          type: string
        tokenUrl:
          type: string
        scopes:
          type: array
          items:
            type: string
    ApiKeyConfig:
      required:
        - apiKeyHeader
        - apiKeyValue
      type: object
      properties:
        apiKeyValue:
          type: string
        apiKeyHeader:
          type: string
    BearerTokenConfig:
      required:
        - token
      type: object
      properties:
        token:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token (USER, AGENT, or SERVICE auth)

````