For Developers
Replace Geos
PUT https://ed.link/api/v2/teams/:team_id/origin-policies/:policy_id/geos
Replaces all existing geographic country code rules with the provided array of rules.
Permissions
Requires the origin_policies.update system permission.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
:team_id | UUID | Yes | The ID of the team. |
:policy_id | UUID | Yes | The ID of the origin policy. |
Request Body
Array of country objects with country_code:
[
{
"country_code": "US"
},
{
"country_code": "CA"
}
]
Sample Request
const response = await axios.put(
`https://ed.link/api/v2/teams/${team_id}/origin-policies/${policy_id}/geos`,
[
{ country_code: 'US' },
{ country_code: 'CA' },
{ country_code: 'GB' }
],
{
headers: {
authorization: `Bearer ${user_session_token}`,
'content-type': 'application/json'
}
}
);
Sample Response
{
"$data": [
{
"id": "e22a4b88-1c39-4d6b-9520-21a4fa800311",
"country_code": "US"
},
{
"id": "f55c8a99-2d40-4e7c-a631-32b5fb900422",
"country_code": "CA"
},
{
"id": "a11d9c77-3e50-4f8d-b742-43c6fc000533",
"country_code": "GB"
}
]
}
