Add, remove, or replace location IDs on the allowlist, depending on the request's operation type.
Requests that change the same allowlist at the same time may be rejected with 409; retry them.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Update Allowlist requests
An Update Allowlist request takes an operation type and a list of Tripadvisor Location IDs, and applies them to your existing allowlist. Update Allowlist only supports POST requests.
A request is an HTTP POST to a URL in the form:
https://terra.tripadvisor.com/api/allowlist
Pass the operation type and IDs in the JSON request body:
curl -X POST "https://terra.tripadvisor.com/api/allowlist?version=1" \
-H "Content-Type: application/json" \
-H "X-API-Key: API_KEY" \
-d '{ "operation_type": "APPEND", "allowlist": [187147, 188151] }'operation_type
| Value | Effect |
|---|---|
APPEND | Adds the submitted IDs. IDs already present are left unchanged. IDs on the allowlist but absent from the request are unaffected. |
DELETE | Removes the submitted IDs. IDs not on the allowlist have nothing to remove. Other IDs are unaffected. |
OVERWRITE | Replaces the entire allowlist with the submitted IDs. Any ID previously on the allowlist but absent from the request is removed. |
Update Allowlist responses
The response carries three counts: added, deleted and no_change.
How they sum depends on the operation:
- For
APPEND,added + deleted + no_changeequals the number of IDs submitted. - For
DELETE, an ID that was never on the allowlist is not counted, so the sum may be less than the number submitted. - For
OVERWRITE,deletedcounts existing allowlist IDs that were absent from the request rather than IDs submitted, so the sum may exceed the number submitted.
{ "added": 2, "deleted": 0, "no_change": 0 }Note: OVERWRITE with an empty allowlist empties the allowlist. There is no confirmation step.
Note: changes take effect immediately. An added Location is retrievable on the next call; a removed Location returns 404 at once.
Note: this endpoint is rate-limited separately from content endpoints and returns 429 when exceeded. Batch changes into one request rather than sending one ID per request.
Examples
Add two Locations
curl -X POST "https://terra.tripadvisor.com/api/allowlist?version=1" \
-H "Content-Type: application/json" -H "X-API-Key: API_KEY" \
-d '{ "operation_type": "APPEND", "allowlist": [187147, 188151] }'Remove a Location
curl -X POST "https://terra.tripadvisor.com/api/allowlist?version=1" \
-H "Content-Type: application/json" -H "X-API-Key: API_KEY" \
-d '{ "operation_type": "DELETE", "allowlist": [187147] }'Replace the entire allowlist
curl -X POST "https://terra.tripadvisor.com/api/allowlist?version=1" \
-H "Content-Type: application/json" -H "X-API-Key: API_KEY" \
-d '{ "operation_type": "OVERWRITE", "allowlist": [190420, 190421] }'