Scope: what a key may read
How your contract and your key decide which records you see.
Your contract defines which data your organisation may read: an area (regions, municipalities, individual venues, or a radius around a point), and optionally domains and genres. A key can narrow this further when it is created:
- Area. If the key names an area of its own, that area replaces the contract's area for this key, and it must lie inside the contract's area. A key limited to two venues sees those two venues, not the whole region of the contract. If the key names no area, it uses the contract's area.
- Domains and genres. The key's list is intersected with the contract's list.
- Nothing left. If the key's narrowing does not fit inside the contract (for example a region outside the contract area, or no shared domain or genre), the key is rejected on every request with
403andcode: "API_KEY_SCOPE_OUTSIDE_CONTRACT". The key itself is valid; change or remove its limits in the organisation settings, or have the contract extended. The answer does not name the contract's area. An empty genre or area list on a key does not narrow anything. - Resources. A key can be limited to certain endpoints, for example only
eventsandlocations(the path segment after/v1). Other endpoints answer403withcode: "API_KEY_PERMISSION_DENIED". - Other limits a key can carry: allowed IP addresses (
403withcode: "API_KEY_IP_NOT_ALLOWED"from other addresses), an expiry date, its own request rate, and which image rights it accepts (Images and credits).
How scope shows up in answers:
- Events, showtimes and event series are in scope when their venue is. Domain limits apply to them as well.
- Festivals are in scope when their region or one of their venues is. Regions are in scope when they lie in your area.
- Venues are in scope when they lie in your area.
- Artists, works and genres are not limited by area. Genres follow your domain limit: you see the genres used in your domains.
- A genre limit applies to event series, festivals, showtimes and events, in lists, single records and search: a record is in scope when it is tagged with one of the genres (a parent group covers its genres). Events and showtimes have the genres of their event series. A record without any genre is outside a genre limit. Venues, artists, works and regions have no genres and are not limited by it.
- Lists contain only records in scope. A single record outside your scope answers
404 Not Found, never403, so a key cannot learn that a record exists.