Skip to content
Reference>REST API>/agent_groups

Agent Groups ​

The /agent_groups endpoint provides read-only access to agent groups. Agent groups are logical groupings of agents, allowing deployments to be assigned to a group rather than a specific agent.

See Also

GET /api/v1/agent_groups — Find Agent Groups ​

Retrieve a list of agent groups.

Endpoint ​

GET https://app.metakraftwerk.com/api/v1/agent_groups

Query Parameters ​

ParameterTypeRequiredDescription
namestringNoFilter by agent group name.

Response Schema ​

Returns an array of agent group objects:

FieldTypeDescription
idintegerUnique agent group ID.
namestringAgent group name.
descriptionstringDescription of the agent group.

Examples ​

cURL ​

bash
# List all agent groups
curl -X GET "https://app.metakraftwerk.com/api/v1/agent_groups" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

# Find by name
curl -X GET "https://app.metakraftwerk.com/api/v1/agent_groups?name=DEV_AGENTS" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

JavaScript (Fetch) ​

javascript
const response = await fetch(
  'https://app.metakraftwerk.com/api/v1/agent_groups?name=DEV_AGENTS',
  { headers: { 'Authorization': `Bearer ${accessToken}` } }
);

const agentGroups = await response.json();

Response Example ​

json
[
  {
    "id": 1,
    "name": "DEV_AGENTS",
    "description": null
  }
]

Error Responses ​

StatusConditionExample Message
401Missing or invalid tokenNot authenticated

GET /api/v1/agent_groups/:id — Get Agent Group ​

Retrieve a single agent group by its ID.

Endpoint ​

GET https://app.metakraftwerk.com/api/v1/agent_groups/:id

Path Parameters ​

ParameterTypeRequiredDescription
idintegerYesThe agent group ID.

Examples ​

cURL ​

bash
curl -X GET "https://app.metakraftwerk.com/api/v1/agent_groups/1" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

JavaScript (Fetch) ​

javascript
const response = await fetch(
  'https://app.metakraftwerk.com/api/v1/agent_groups/1',
  { headers: { 'Authorization': `Bearer ${accessToken}` } }
);

const agentGroup = await response.json();

Error Responses ​

StatusConditionExample Message
401Missing or invalid tokenNot authenticated
404Agent group not foundNo record found for id 'X'

POST /api/v1/agent_groups — Create ​

Not implemented

PUT /api/v1/agent_groups — Update ​

Not implemented

PATCH /api/v1/agent_groups/:id — Patch ​

Not implemented

DELETE /api/v1/agent_groups/:id — Remove ​

Not implemented