# Assign Agent Private Cloud (APC) to an Agent

**Payload Example**

```python
if "apc_id" in apc_create_response:
    apc_assign_payload = {
        "groc_account_id": "your_account_id",
        "agent_uuid": register_payload["agent_uuid"],  # Use the agent_uuid from the registration payload
        "apc_id": apc_create_response["apc_id"],  # Use the APC ID from the creation response
        "agent_type": "gateway"
    }
```

Example Code

```python
# Assign an agent to the APC
if "apc_id" in apc_create_response:
    apc_assign_payload = {
        "groc_account_id": "your_account_id",
        "agent_uuid": register_payload["agent_uuid"],  # Use the agent_uuid from the registration payload
        "apc_id": apc_create_response["apc_id"],  # Use the APC ID from the creation response
        "agent_type": "gateway"
    }
    apc_assign_response = agent.apc_agent_assign(apc_assign_payload)
    print("APC Agent Assignment Response:", apc_assign_response)
else:
    print("APC Creation failed. Cannot assign agent to APC.")

```

Example Response

```python
Agent APC assigned: {'agent_uuid': '6771233a1333h13113', 'apc_id': '0a2c8913-88fc-4441-ac7e-ac726d5b8779', 'message': 'Agent assigned to apc.'}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.groclake.ai/lakes/agent-management-and-deployment/agentlake/assign-agent-private-cloud-apc-to-an-agent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
