Description
Deactivate a Network Connector agent. Agents cannot be deleted. A deactivated agent keeps its identification code, port, and fingerprint. You can activate it again.
A deactivated agent cannot be edited or linked to a device. It remains readable with active set to false. To use it again, access POST | Activate Network Connector agent.
Prerequisites
- An application with the PAM resource permission set to Read and write, granted by the administrator in A2A. For more information, access How to manage authorizations in A2A for API v2.
- A valid OAuth 2.0 access token. For more information, access How to authenticate an application in A2A.
- An active agent. Deactivating an agent that is already deactivated returns
409. - The agent is not the application's default agent. The default agent is the one selected in the Network Connector field of the application parameters. For more information, access Application.
- No active resource, such as a device, uses the agent. Link those resources to another agent or deactivate them first.
Request
POST /api/v2/platform/network-connector/agents/{agent_id}/deactivate
Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
agent_id |
integer | Yes | Unique identification code of the agent. Accepts digits only. To find it, access GET | List all Network Connector agents. |
This action takes no request body and does not require the If-Match header.
Example request
POST {{url}}/api/v2/platform/network-connector/agents/12/deactivate
Response
HTTP/1.1 204 No Content
The response has no body. The ETag header carries the agent's new state.
Errors
| HTTP code | Message | Possible cause | Solution |
|---|---|---|---|
403 |
api.auth.insufficient_permission |
The application's PAM resource permission is Read-only. | Ask the administrator to set the PAM resource permission to Read and write in A2A. |
404 |
api.resource.not_found |
The agent does not exist. | Check the identification code sent in the path. |
404 |
api.route.not_found |
The agent_id value is not made up of digits only. |
Send the agent's identification code using digits only. |
409 |
api.resource.conflict.already_inactive |
The agent is already deactivated. | No action is needed. The agent is already in the requested state. |
409 |
network_connector_agent.is_application_default |
The agent is the application's default agent. | Select another agent in the Network Connector field of the application parameters, then resend the request. For more information, access Application. |
409 |
network_connector_agent.in_use |
Active resources still use the agent. The details field lists the kinds of resources, such as devices. |
Link those resources to another agent or deactivate them, then resend the request. |
For authentication errors, rate limits, and the error response format, access API v2 - Conventions and shared behaviors.
Example error response
409 active devices still use the agent:
{
"code": "network_connector_agent.in_use",
"message": "Cannot deactivate the agent while it is linked to other resources.",
"details": [
{
"category": "devices"
}
]
}