Use the ably spaces locations set command to set location in a space.
Synopsis
ably spaces locations set <space-name> <location> [options]Arguments
space-name Required
Required
The name of the space to set the location in.
location Required
Required
JSON location data to set.
Options
--duration | -D
The duration in seconds to maintain the location before automatically removing it.
--client-id
A client ID to use when setting the location.
--json
Output results as compact JSON. Mutually exclusive with --pretty-json.
--pretty-json
Output results in formatted JSON. Mutually exclusive with --json.
--verbose | -v
Enable verbose logging. Can be combined with --json or --pretty-json.
Examples
Set a location in a space:
ably spaces locations set "my-space" '{"x":10,"y":20}'Set a location with section data:
ably spaces locations set "my-space" '{"sectionId":"section1"}'Set a location and output in JSON format:
ably spaces locations set "my-space" '{"x":10,"y":20}' --jsonSee also
- Spaces — Explore all
ably spacescommands. - CLI reference — Full list of available commands.