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

# Bind Agent to Workspace

> Bind an agent to a workspace to enable A2A communication

```
POST /openapi/memorylake/api/v3/workspaces/{workspaceId}/agents
```

Binds an existing agent to the specified workspace. Once bound, the agent becomes available for A2A (Agent-to-Agent) communication and task execution within the workspace. An agent can be bound to multiple workspaces.

<Note>
  **Permission required:** `workspace:agent_bind`
</Note>

### Path Parameters

<ParamField path="workspaceId" type="string" required>
  Workspace identifier
</ParamField>

### Request Body

<ParamField body="agent_id" type="string" required>
  Identifier of the agent to bind to the workspace
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST 'https://app.memorylake.ai/openapi/memorylake/api/v3/workspaces/ws_abc123/agents' \
    -H 'Authorization: Bearer sk_xxxxxx' \
    -H 'Content-Type: application/json' \
    -d '{
      "agent_id": "agt_r8k2m1n3"
    }'
  ```
</RequestExample>

### Response

<ResponseField name="data" type="object">
  <Expandable title="Agent binding object">
    <ResponseField name="name" type="string">Agent name</ResponseField>
    <ResponseField name="agent_id" type="string">Agent identifier</ResponseField>
    <ResponseField name="custom_id" type="string">Custom identifier for external system integration</ResponseField>
    <ResponseField name="latest_version" type="integer">Latest version number of the agent</ResponseField>
    <ResponseField name="bound_at" type="string">Timestamp when the agent was bound to the workspace</ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Success (200) theme={null}
  {
    "success": true,
    "data": {
      "name": "Support Assistant",
      "agent_id": "agt_r8k2m1n3",
      "custom_id": "support-assistant-v1",
      "latest_version": 3,
      "bound_at": "2025-04-01T08:00:00Z"
    }
  }
  ```
</ResponseExample>
