Skip to main content

Full replacement (PUT)

PUT /indicators/{indicator_id}
Replaces all updatable fields on the indicator. All required fields must be provided. Returns the updated Indicator object with the domain populated.

Path parameters

indicator_id
string
required
ObjectId string of the indicator to update.

Request body

name
string
required
Display name of the indicator.
periodicity
string
required
Measurement frequency.
favourites
integer
required
Favourite count.
governance
boolean
required
Governance classification flag.
domain
string
required
ObjectId string of the domain to assign the indicator to. Must be an existing domain.
subdomain
string
required
Subdomain name. Must exist in the specified domain’s subdomains list.
description
string
Longer description.
font
string
Data source attribution.
scale
string
Measurement scale.
unit
string
Unit of measurement.
carrying_capacity
string
Carrying capacity description.

Errors

StatusCondition
400indicator_id is not a valid ObjectId format
400domain ID does not reference an existing domain
400subdomain is not in the specified domain’s subdomains list
404No indicator with the given ID exists
422Request body is missing required fields or contains invalid types

Example

curl --request PUT \
  --url 'http://localhost:8080/indicators/64a1f2b3c4d5e6f7a8b9c0d1' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Annual tourist arrivals",
    "periodicity": "annual",
    "favourites": 45,
    "governance": false,
    "domain": "64a1f2b3c4d5e6f7a8b9c0a1",
    "subdomain": "Visitor volume",
    "description": "Updated description for annual tourist arrivals.",
    "font": "National Tourism Board",
    "scale": "national",
    "unit": "persons",
    "carrying_capacity": null
  }'

Partial update (PATCH)

PATCH /indicators/{indicator_id}
Updates only the fields provided in the request body. Omitted fields retain their current values. Returns the updated Indicator object with the domain populated.

Path parameters

indicator_id
string
required
ObjectId string of the indicator to update.

Request body

All fields are optional. Only fields present in the request body are written to the database.
name
string
Display name.
periodicity
string
Measurement frequency.
favourites
integer
Favourite count.
governance
boolean
Governance classification flag.
domain
string
ObjectId string of the new domain. If provided alongside subdomain, the subdomain is validated against the new domain.
subdomain
string
Subdomain name.
description
string
Longer description.
font
string
Data source attribution.
scale
string
Measurement scale.
unit
string
Unit of measurement.
carrying_capacity
string
Carrying capacity description.

Errors

StatusCondition
400indicator_id is not a valid ObjectId format
400domain ID does not reference an existing domain
400subdomain is not in the specified domain’s subdomains list
404No indicator with the given ID exists

Examples

Update only the favourites count:
curl --request PATCH \
  --url 'http://localhost:8080/indicators/64a1f2b3c4d5e6f7a8b9c0d1' \
  --header 'Content-Type: application/json' \
  --data '{"favourites": 50}'
Move an indicator to a different domain and subdomain:
curl --request PATCH \
  --url 'http://localhost:8080/indicators/64a1f2b3c4d5e6f7a8b9c0d1' \
  --header 'Content-Type: application/json' \
  --data '{
    "domain": "64a1f2b3c4d5e6f7a8b9c0a3",
    "subdomain": "Visitor spending"
  }'

POST /indicators/{indicator_id}/resources
Associates a resource with an indicator. This operation is idempotent — linking the same resource ID a second time has no effect. Returns the updated full Indicator object.

Path parameters

indicator_id
string
required
ObjectId string of the indicator.

Request body

resource_id
string
required
ID string of the resource to link.

Errors

StatusCondition
400indicator_id is not a valid ObjectId format
404No indicator with the given ID exists

Example

curl --request POST \
  --url 'http://localhost:8080/indicators/64a1f2b3c4d5e6f7a8b9c0d1/resources' \
  --header 'Content-Type: application/json' \
  --data '{"resource_id": "64a1f2b3c4d5e6f7a8b9c0b2"}'

Get resources

GET /indicators/{indicator_id}/resources
Returns the array of resource ID strings linked to an indicator.

Path parameters

indicator_id
string
required
ObjectId string of the indicator.

Response

An array of resource ID strings.
200
[
  "64a1f2b3c4d5e6f7a8b9c0b2",
  "64a1f2b3c4d5e6f7a8b9c0b3"
]

Errors

StatusCondition
400indicator_id is not a valid ObjectId format
404No indicator with the given ID exists

Example

curl --request GET \
  --url 'http://localhost:8080/indicators/64a1f2b3c4d5e6f7a8b9c0d1/resources'

Build docs developers (and LLMs) love