Add, remove, or replace location IDs on the allowlist, depending on the request's operation type

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.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

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

ValueEffect
APPENDAdds the submitted IDs. IDs already present are left unchanged. IDs on the allowlist but absent from the request are unaffected.
DELETERemoves the submitted IDs. IDs not on the allowlist have nothing to remove. Other IDs are unaffected.
OVERWRITEReplaces 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_change equals 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, deleted counts 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] }'

Related

Body Params

operation type and location IDs to apply to the allowlist

Request payload for adding, removing, or replacing location IDs on a partner config's allowlist.

allowlist
array of int32s, unique
required

Location IDs to add, remove, or use as the full replacement allowlist, depending on
operationType.

allowlist*
string
enum
required

How the allowlist location IDs in an upload request should be applied to a partner config's
existing allowlist.

Allowed:
Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
application/problem+json