For Developers

Create Geo

POST https://ed.link/api/v2/teams/:team_id/origin-policies/:policy_id/geos

Adds an ISO country code rule to the origin policy.

Permissions

Requires the origin_policies.create system permission.

Parameters

ParameterTypeRequiredDescription
:team_idUUIDYesThe ID of the team.
:policy_idUUIDYesThe ID of the origin policy.

Request Body

PropertyTypeRequiredDescription
country_codeStringYesISO 3166-1 alpha-2 country code (e.g. US, CA, GB).

Sample Request

const response = await axios.post(
    `https://ed.link/api/v2/teams/${team_id}/origin-policies/${policy_id}/geos`,
    {
        country_code: 'US'
    },
    {
        headers: {
            authorization: `Bearer ${user_session_token}`,
            'content-type': 'application/json'
        }
    }
);

Sample Response

{
    "$data": {
        "id": "e22a4b88-1c39-4d6b-9520-21a4fa800311",
        "country_code": "US"
    }
}