Set Dataset Groups Endpoint
const url = 'https://example.com/datasets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/groups/';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"group_ids":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/datasets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/groups/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "group_ids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ] }'Share a dataset with exactly these sharing groups (owner or admin).
An owner may add only groups they belong to (403); an admin may add any. A private dataset shared with a group becomes restricted, and a restricted one left with no group or role grant becomes private; internal and public datasets keep their audience. 404 for an unknown group, and 422 when the change would hide the dataset from viewers of the owner’s shared maps or let a VRT reach people who cannot see all of its sources.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Request Bodyrequired
Section titled “ Request Bodyrequired ”object
Every group the dataset is shared with afterwards; an empty list unshares it. An owner may add only groups they belong to, and an admin any group.
Example generated
{ "group_ids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ]}Responses
Section titled “ Responses ”Successful Response
object
The dataset’s visibility after the change: a private dataset shared with a group becomes restricted, and a restricted one left with no group or role grant becomes private.
The sharing groups the dataset is shared with, by name.
object
Unique group identifier.
Group name.
Example generated
{ "visibility": "example", "groups": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example" } ], "metadata_warnings": [ "example" ]}Bad request — invalid payload
Unauthorized — missing or invalid credentials
Forbidden — caller lacks access to this resource
Not found
Conflict — resource state prevents the operation
Validation error
Too many requests — retry after the advertised interval
Headers
Section titled “ Headers ”Seconds until the request may be retried
Internal server error
Service unavailable — the database could not serve the request