

Site settings includes the ID of topics and the custom field definitions, which are useful when editing datasets.
| 200 | Returns the site settings JSON. |
{
// Used in the browser tab title
"title": "Barnet Open Data",
"topics": {
"waste-and-recycling": {
"img": "https://.../waste-recycling.png", // or null
"title": "Waste & Recycling"
},
// [...topics are set up through the web interface]
},
// Search sidebar. Valid values are "topic", "logo", "tag", "format",
// "sharing", or "custom.<key>" for a custom field:
"searchFilters": [
"topic",
"format",
"tag"
],
"licences": [
// Set up through the web interface
{
"url": "https://.../doc/open-government-licence/version/3/",
"title": "UK Open Government Licence (OGL v3)"
},
// [...]
],
// -- UI Design
// Edit these with caution!
"design": {
// Images & links
"logo": "https://cdn.datapress.cloud/barnet/img/design/brand-logo.png",
"emailLogo": "https://cdn.datapress.cloud/barnet/img/design/email-logo.png",
"favicon": "https://cdn.datapress.cloud/barnet/img/design/favicon.ico",
"navbarType": "is-primary", // "is-primary", "is-dark" or "is-white"
"footer": {
"copyright": "© Barnet Council",
"home": {
"img": "https://cdn.datapress.cloud/barnet/img/design/logo_barnet.png",
"url": "https://www.barnet.gov.uk",
"alt": "Barnet Council"
}
},
// Analytics integrations. Google Tag Manager may be a string or a list:
"googleTagManager": "GTM-...",
"googleAnalytics4": "G-...",
// Theme colours
"uiColorPrimary": "blue",
"uiColorSecondary": "slate",
"uiMetaThemeColor": "#1e40af"
},
// Navigation and footer menus
"menus": {
// [...set up through the web interface]
},
// Blog location, eg. "/blog" or "" to disable:
"blogRoot": "/blog",
"blogTitle": "News",
// -- Site Settings
"customFields": {
// [...set up through the web interface]
},
"id": "mysite", // Immutable
"hostname": "data.website", // Immutable
"hostnameProd": "data.website", // Immutable
"canonical": "https://data.website", // Immutable
"https": true, // Immutable
}
| Authorization | API key with administrator permissions. | string | Required |
| 200 | Returns the updated site settings JSON. |
| 400 | Returns a JSON object explaining the error. |
| 403 | API key does not have administrator permissions. |
import requests, os, json
api_key = os.getenv("DATAPRESS_API_KEY")
headers = { "Authorization": api_key }
patch = [
{
"op": "replace",
"path": "/topics/waste-and-recycling/title",
"value": "Reduce, Reuse, Recycle"
}
]
url = f"https://data.website/api/v3/site"
# This will submit the patch with the header "Content-Type: application/json"
response = requests.patch(url, json=patch, headers=headers)
print(json.dumps(response.json(), indent=2))
{
// [...full JSON structure...]
"topics": {
"waste-and-recycling": {
"img": "https://.../waste-recycling.png",
"title": "Reduce, Reuse, Recycle"
},
// [...other topics...]
}
}