Country groups
Named groups of countries for targeting.
List country groups
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Pluto-Workspace | string (uuid) | Optional | The workspace to act in, for credentials that can reach several (sessions, agent tokens). API keys belong to one workspace; another value is a 403. |
Response
countryGroups- Groups.
countryGroups[].countryCodes- Countries.
countryGroups[].id- ID.
countryGroups[].name- Name.
countryGroups[].version- Increments on every change; send as
expectedVersion.
curl "$PLUTO_API/country-groups" \
-H "Authorization: Bearer $PLUTO_KEY"Create a country group
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Idempotency-Key | string | Optional | The command ID. A retry with the same key returns the stored result; the same key with different input is a 409. Without it a retry cannot be recognized. |
Pluto-Workspace | string (uuid) | Optional | The workspace to act in, for credentials that can reach several (sessions, agent tokens). API keys belong to one workspace; another value is a 403. |
Request body
countryCodes- Countries.
id- Optional ID.
name- Name.
Response
countryCodes- Countries.
id- ID.
name- Name.
version- Increments on every change; send as
expectedVersion.
Errors
- 400The request is malformed.
- 401No valid credential.
- 403The credential lacks the permission, or belongs to another workspace.
- 409Conflict: a stale
expectedVersion(the body carriescurrent), a duplicate, or an Idempotency-Key reused with different input. - 422Validation failed;
errorslists every field problem at once. - 429Too many requests from this credential. Wait
Retry-Afterseconds. People in the app have their own budget, so an agent swarm can't starve them.
curl -X POST "$PLUTO_API/country-groups" \
-H "Authorization: Bearer $PLUTO_KEY" \
-H "Idempotency-Key: 500e6621-c93a-4d6e-a631-6feb99fa4500" \
-H "Content-Type: application/json" \
-d '{
"countryCodes": [
"US"
],
"id": "d2162b73-4128-4e69-82db-418ad890557f",
"name": "North America"
}'Update a country group
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The country group's ID. |
Idempotency-Key | string | Optional | The command ID. A retry with the same key returns the stored result; the same key with different input is a 409. Without it a retry cannot be recognized. |
Pluto-Workspace | string (uuid) | Optional | The workspace to act in, for credentials that can reach several (sessions, agent tokens). API keys belong to one workspace; another value is a 403. |
Request body
countryCodes- Countries.
expectedVersion- The version you last read. A mismatch is a conflict that returns the current entity.
name- Name.
Response
countryCodes- Countries.
id- ID.
name- Name.
version- Increments on every change; send as
expectedVersion.
Errors
- 400The request is malformed.
- 401No valid credential.
- 403The credential lacks the permission, or belongs to another workspace.
- 404Not found in this workspace.
- 409Conflict: a stale
expectedVersion(the body carriescurrent), a duplicate, or an Idempotency-Key reused with different input. - 422Validation failed;
errorslists every field problem at once. - 429Too many requests from this credential. Wait
Retry-Afterseconds. People in the app have their own budget, so an agent swarm can't starve them.
curl -X PATCH "$PLUTO_API/country-groups/d2162b73-4128-4e69-82db-418ad890557f" \
-H "Authorization: Bearer $PLUTO_KEY" \
-H "Idempotency-Key: d3d81e95-b5f3-47d9-bb30-14963944159e" \
-H "Content-Type: application/json" \
-d '{
"countryCodes": [
"US"
],
"expectedVersion": 3,
"name": "North America"
}'Delete a country group
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The country group's ID. |
Idempotency-Key | string | Optional | The command ID. A retry with the same key returns the stored result; the same key with different input is a 409. Without it a retry cannot be recognized. |
Pluto-Workspace | string (uuid) | Optional | The workspace to act in, for credentials that can reach several (sessions, agent tokens). API keys belong to one workspace; another value is a 403. |
Response
Done; no content.
Errors
- 400The request is malformed.
- 401No valid credential.
- 403The credential lacks the permission, or belongs to another workspace.
- 404Not found in this workspace.
- 409Conflict: a stale
expectedVersion(the body carriescurrent), a duplicate, or an Idempotency-Key reused with different input. - 422Validation failed;
errorslists every field problem at once. - 429Too many requests from this credential. Wait
Retry-Afterseconds. People in the app have their own budget, so an agent swarm can't starve them.
curl -X DELETE "$PLUTO_API/country-groups/d2162b73-4128-4e69-82db-418ad890557f" \
-H "Authorization: Bearer $PLUTO_KEY" \
-H "Idempotency-Key: b0cebd89-b21e-405b-ae12-e5b4f789fd5d"