Create a new agent and generate an authentication token for it. Network policies are not included in the creation response.
Requires Bearer token authentication
Request Body
Operating system (required)
Agent IP address (must be valid IP format)
Agent kind (must be valid agent kind)
Agent labels (maximum 64 labels, keys ≤63 chars, values ≤1024 chars)
Example
curl -X POST "https://api.garnet.ai/v1/agents" \
-H "Authorization: Bearer $GARNET_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "production-server-1",
"os": "linux",
"ip": "10.0.1.100",
"kind": "kubernetes",
"labels": {
"environment": "production",
"region": "us-west-1"
}
}'
Response
Agent authentication token
ISO 8601 timestamp of creation
Error Examples
{
"error": "invalid label key format"
}
{
"error": "invalid agent: os is required"
}