API
Version 2.0
Last updated 17.01.2025
Learn more about how to request access and more details on our Data sharing documentation
To be able to make requests to the API endpoints, you'll need an API key. This helps us to track usage and apply rate limiting, and ensure a performant experience for all API consumers. To find out more about how to apply for a key, see here.
Once a token has been obtained from the sessions endpoint, it can be used either via a bearer token header, or a token
parameter specified alongside the requests for other API calls. This is in addition to the API key, and is only needed for requests that require an authenticated user to access them.
sessions
Authenticate a user and obtain an authentication token used for authenticated calls to other API endpoints
-
Request parameters
{"session":{"email":"","password":""}}
-
Response output
{"id":"","created_at":"","updated_at":"","email":"","first_name":"","last_name":"","token":""}
Endpoints
- POST: /users/sign_in.json
- DELETE: /users/sign_out.json
- POST: /sessions.json
organizations
Returns a list of organizations for this platform
-
Request parameters
{"organization":{"name":"","short_description":"","description":"","primary_country":"","state":"","nearest_town_city":"","street_address":"","contact_details":"","email":"","phone":"","website":"","approved":"","region":"","logo":""}}
-
Response output
{"id":"","created_at":"","updated_at":"","owner_id":"","name":"","program_name":"","description":"","short_description":"","slug":"","primary_country":"","state":"","nearest_town_city":"","street_address":"","contact_details":"","email":"","phone":"","website":""}
Endpoints
- GET: /organizations/:organization_id/region.json
- GET: /organizations/:organization_id/edit-region-geojson.json
- GET: /organizations/:organization_id/locations.json
- GET: /organizations/:organization_id/locations_map.json
- GET: /organizations/:organization_id/contributors.json
- GET: /organizations.json
- POST: /organizations.json
- GET: /organizations/:uuid.json
- PATCH: /organizations/:uuid.json
- PUT: /organizations/:uuid.json
- DELETE: /organizations/:uuid.json
datasets
Returns a list of datasets for this platform
-
Request parameters
{"dataset":{"name":"","description":"","start_date":"","frequency":"","frequency_details":"","standards_guideline_id":"","concerns":"","certification_requirements":"","local_contexts":"","share_with_datastream":"","share_with_watershedreports":"","share_with_uk_opendata":"","region":[{}],"impact_intended_audience":[{}],"impact_intended_use":[{}]}}
-
Response output
{"id":"","created_at":"","updated_at":"","owner_id":"","organization_id":"","form_id":"","name":"","description":"","slug":"","start_date":"","certification_requirements":"","form":[{"id":"","created_at":"","updated_at":"","name":"","protocol":"","template":"","uuid":"","show_testers":"","show_sample_id":"","form_parameters":[{"id":"","created_at":"","updated_at":"","required":"","samples":"","row_order":"","parameter":[{"id":"","created_at":"","updated_at":"","name":"","qualitative":"","category":"","parameter_options":[{"id":"","created_at":"","updated_at":"","value":"","label":""}]}],"test_method":[{"id":"","created_at":"","updated_at":"","name":""}],"equipment":[{"id":"","created_at":"","updated_at":"","name":""}]}]}]}
Endpoints
- GET: /organizations/:organization_id/datasets.json
- POST: /organizations/:organization_id/datasets.json
- GET: /datasets/:dataset_id/locations.json
- GET: /datasets/:dataset_id/observations.json
- GET: /datasets/:dataset_id/region.json
- GET: /datasets/:dataset_id/edit-region-geojson.json
- GET: /datasets.json
- POST: /datasets.json
- GET: /datasets/:uuid.json
- PATCH: /datasets/:uuid.json
- PUT: /datasets/:uuid.json
- DELETE: /datasets/:uuid.json
locations
Returns the available locations for this platform
-
Request parameters
{"location":{"name":"","description":"","organization_id":"","latitude":"","longitude":"","body_of_water":"","water_body_type":"","assigned_data_collector":"","reference_photo":"","land_uses":[{}],"bank_vegetations":[{}]}}
-
Response output
{"id":"","created_at":"","updated_at":"","name":"","dataset_id":"","latitude":"","longitude":"","body_of_water":""}
Endpoints
- POST: /datasets/:dataset_id/locations.json
- GET: /locations/:location_id/observations.json
- GET: /locations.json
- POST: /locations.json
- GET: /locations/:uuid.json
- PATCH: /locations/:uuid.json
- PUT: /locations/:uuid.json
- DELETE: /locations/:uuid.json
forms
Forms
-
Response output
{"id":"","created_at":"","updated_at":"","name":"","protocol":"","template":"","uuid":"","show_testers":"","show_sample_id":"","form_parameters":[{"id":"","created_at":"","updated_at":"","required":"","samples":"","row_order":"","parameter":[{"id":"","created_at":"","updated_at":"","name":"","qualitative":"","category":"","parameter_options":[{"id":"","created_at":"","updated_at":"","value":"","label":""}]}],"test_method":[{"id":"","created_at":"","updated_at":"","name":""}],"equipment":[{"id":"","created_at":"","updated_at":"","name":""}]}]}
Endpoints
- GET: /datasets/:dataset_id/form.json
observations
Returns the observations recorded for this platform
-
Request parameters
{"observation":{"form_id":"","observed_at":"","observed_at_local":"","testers":"","sample_id":"","notes":"","photos":[{}],"readings_attributes":[{"form_parameter_id":"","unit_id":"","test_method_id":"","equipment_id":"","value":"","qualitative_value":"","values":[{}]}]}}
-
Response output
{"id":"","created_at":"","updated_at":"","owner_id":"","location_id":"","dataset_id":"","form_id":"","observed_at":"","notes":"","checked":"","qa_notes":"","tested_parameters":"","readings":[{"id":"","created_at":"","updated_at":"","parameter":"","unit":"","value":""}]}
Endpoints
- POST: /locations/:location_id/observations.json
- GET: /observations.json
- GET: /observations/:uuid.json
- PATCH: /observations/:uuid.json
- PUT: /observations/:uuid.json
- DELETE: /observations/:uuid.json
point_of_interests
Point Of Interests
-
Response output
{"id":"","created_at":"","updated_at":"","name":"","dataset_id":"","receiving_water_course":"","has_upstream":"","has_downstream":"","url":"","lat":"","lng":"","current_status":"","current_status_at":""}
Endpoints
- GET: /poi.json
- GET: /poi/:uuid.json