Skip to content
getgeolens.com

Set the sharing groups for a story

PUT
/stories/{story_id}/groups/
curl --request PUT \
--url https://example.com/api/stories/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/groups/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "group_ids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "confirm": "share_maps" }'

Share a story 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 story shared with a group becomes restricted, and once published its members can read it; a restricted one left with no group becomes private. Internal and public stories keep their audience. 404 for an unknown group.

409 maps_narrower_than_story when the published story uses maps some member of a new group can’t read: detail.maps names the ones you can read, each with can_share, and detail.unreadable_maps counts the rest; see confirm.

story_id
required
Story Id
string format: uuid
Media type application/json
StoryGroupsUpdate
object
group_ids
required
Group Ids

Every group the story is shared with afterwards; an empty list unshares it. An owner may add only groups they belong to, and an admin any group.

Array<string>
<= 100 items
confirm
Any of:
string
Allowed value: share_maps

Successful Response

Media type application/json
StoryGroupsResponse
object
visibility
required
StoredStoryVisibility

The story’s visibility after the change: a private story shared with a group becomes restricted, and a restricted one left with no group becomes private.

string
Allowed values: private internal public restricted
groups
required
Groups

The sharing groups the story is shared with, by name.

Array<object>
GroupRef
object
id
required
Id

Unique group identifier.

string format: uuid
name
required
Name

Group name.

string
shared_map_ids
Shared Map Ids

Maps this request shared with the story’s new groups.

Array<string>

Example

{
"visibility": "private"
}

Bad request — invalid payload

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Unauthorized — missing or invalid credentials

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Forbidden — caller lacks access to this resource

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Not found

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Maps the published story uses that some new groups can’t read (detail.code maps_narrower_than_story, the maps under detail.maps), or another change holding the story’s lock (no detail.code).

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Validation error

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Too many requests — retry after the advertised interval

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}
Retry-After
integer

Seconds until the request may be retried

Internal server error

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Service unavailable — the database could not serve the request

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}