Add a layer
Add datasets to a Data Studio project as layers, configured through the project's pipeline body via PUT.
Add a layer
Session-authenticated portal API — authenticate with a portal Bearer token (session JWT), not an API key. It also requires the relevant organization permissions (DATA_STUDIO_ACCESS / DATA_STUDIO_CREATE / DATA_STUDIO_EXECUTE) and the Data Studio add-on on the organization.
A Data Studio project holds layers, the datasets and sources you bring into the workspace to work with. A layer references one or more datasets and carries display and filter settings.
How layers are configured
There is no separate "add layer" REST route, layers live inside the project's pipeline configuration, which you set by sending the configuration object on PUT .../projects/:projectId. To add a layer, fetch the project, add an entry to the layer list, and write it back.
A layer entry describes which datasets it draws from, how it appears, and any filters applied:
| Field | Type | Description |
|---|---|---|
id |
string | Stable identifier for the layer within the project. |
name |
string | Display name. |
datasetIds |
string[] | Datasets the layer draws from. |
color |
string | Display color. |
visible |
boolean | Whether the layer is shown. |
filters |
object | Optional filters (search, categories, cities, countries, postal codes, and more). |
Example
Add a single layer to a project by writing the workspace configuration. Only the relevant part of the body is shown:
curl -X PUT \
-H "Authorization: Bearer eyJhbGci..." \
-H "Content-Type: application/json" \
-d '{
"pipeline": {
"version": 1,
"layers": [
{
"id": "layer-hotels",
"name": "Hotels (NL)",
"datasetIds": ["nl-hotels-poi"],
"color": "#2563eb",
"visible": true,
"filters": { "countries": ["nl"] }
}
],
"transformers": [],
"output": { "format": "csv", "includeCoordinates": true, "fields": { "mappings": [] } }
}
}' \
"https://api.topolab.nl/v1/organization/8f0c2e1a-4b6d-4c2a-9e3f-1a2b3c4d5e6f/data-studio/projects/c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
The response is the updated project, including the stored configuration. To add more layers, send the full layer list each time, the configuration is replaced, not merged.
Authentication
Same rules as the rest of the API: a Bearer JWT (see Authentication), organization membership, the DATA_STUDIO_CREATE permission to modify a project, and the data-studio addon.
Next
- Run a pipeline, process the layers you have added.
- Create a project, the
PUTbody that holds layers. - Want Data Studio enabled? Contact us.