Skip to main content

Endpoint

POST /indicators/{domain_id}/{subdomain_name}/

Path parameters

domain_id
string
required
ObjectId string of an existing domain. Returns 400 if the value is not a valid ObjectId format.
subdomain_name
string
required
Name of the subdomain to assign the indicator to. The subdomain must already exist in the domain’s subdomains list. Returns 400 if the subdomain is not found.

Request body

name
string
required
Display name of the indicator.
periodicity
string
required
How frequently the indicator is measured (e.g., "annual", "monthly", "quarterly").
favourites
integer
required
Initial favourite count for the indicator.
governance
boolean
required
Whether to classify this indicator as a governance indicator.
description
string
Optional longer description of the indicator.
font
string
Optional data source or attribution.
scale
string
Optional measurement scale description.
unit
string
Optional unit of measurement.
carrying_capacity
string
Optional carrying capacity value or description.

Response

Returns the full Indicator object with the domain field populated as a complete domain object.
id
string
required
ObjectId string of the newly created indicator.
name
string
required
Display name of the indicator.
periodicity
string
required
Measurement frequency.
favourites
integer
required
Favourite count.
governance
boolean
required
Governance classification flag.
description
string
Longer description. null if not provided.
font
string
Data source attribution. null if not provided.
scale
string
Measurement scale. null if not provided.
unit
string
Unit of measurement. null if not provided.
carrying_capacity
string
Carrying capacity description. null if not provided.
domain
object
required
Populated domain object.
subdomain
string
required
Subdomain name the indicator was created under.
resources
string[]
required
Array of resource ID strings. Empty array on creation.

Errors

StatusCondition
400domain_id is not a valid ObjectId format
400subdomain_name does not exist in the domain’s subdomains list
400Domain with the given domain_id does not exist
422Request body is missing required fields or contains invalid types

Examples

curl --request POST \
  --url 'http://localhost:8080/indicators/64a1f2b3c4d5e6f7a8b9c0a1/Visitor%20volume/' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Annual tourist arrivals",
    "periodicity": "annual",
    "favourites": 0,
    "governance": false,
    "description": "Total number of tourist arrivals recorded each year.",
    "font": "National Tourism Board",
    "scale": "national",
    "unit": "persons",
    "carrying_capacity": null
  }'

Sample response

200
{
  "id": "64a1f2b3c4d5e6f7a8b9c0d1",
  "name": "Annual tourist arrivals",
  "periodicity": "annual",
  "favourites": 0,
  "governance": false,
  "description": "Total number of tourist arrivals recorded each year.",
  "font": "National Tourism Board",
  "scale": "national",
  "unit": "persons",
  "carrying_capacity": null,
  "domain": {
    "id": "64a1f2b3c4d5e6f7a8b9c0a1",
    "name": "Tourism flows",
    "color": "#3B82F6",
    "image": "",
    "icon": "",
    "subdomains": ["Visitor volume", "Visitor spending", "Visitor origin"]
  },
  "subdomain": "Visitor volume",
  "resources": []
}

Build docs developers (and LLMs) love