Skip to main content

Spaces

createSpace

To create a space programmatically, you can call the following query.

smplrClient.createSpace({ 
name: string
notes?: string
}): Promise<{
sid: string
}>

With sid the Smplrspace ID of the space.

  • name is the name of the space to create.
  • notes - optional - are internal team notes attached to the space.

listSpaces

To list all the spaces on your organization account, you can call the following query.

smplrClient.listSpaces(): Promise<{
sid: string;
deprecated_id: string;
name: string;
created_at: string;
status: string;
}[]>

You can learn more about sid and deprecated_id in the dedicated page on SIDs.

getSpace

To get all details about a space, you can call the following query.

smplrClient.getSpace(spaceId: string, options?: { useCache?: boolean }): Promise<{
sid: string // spaceId
created_at: string
modified_at: string
name: string
public_link_enabled: boolean
status: 'draft' | 'published' | 'archived'
definition: object | null
embed_image: string | null
short_code: string | null
assetmap: object | null
}>
  • spaceId - unique identifier of the space in Smplrspace, something like "spc_xxx". Refer to the page on SIDs to learn more.
  • options - optional - as described below.
  • options.useCache - optional - set this to control whether the request should use the client's local cache. Default value: false

getSpaceFromCache

This is the synchronous equivalent of the query right above.

smplrClient.getSpaceFromCache(spaceId: string): Space

where spaceId and Space are as defined in getSpace, without the Promise.

getSpaceAssetmap (entities)

info

"Assets" are gradually being renamed to "Entities". You'll read entity/ies is the app and asset(s) here, until the change is complete. They are one and the same concept. Except this API to be deprecated soon, and a much wider API surface to be introduced as the entity manager enters general availability.

To get the full assetmap (list of entities) of a space, as saved in the entity manager (previously mapper) in the app, you can call the following query.

smplrClient.getSpaceAssetmap(spaceId: string): Promise<unknown>
  • spaceId - unique identifier of the space in Smplrspace, something like "spc_xxx".

Note that this query is currently not typed as the entity manager (previously mapper) is still in private beta. You should expect an array of "entity groups" (previously asset groups), each "entity group" being an object. The return value corresponds to the JSON export from the entity manager (previously mapper) in the app.

getSpaceAssetmapFromCache

This is the synchronous equivalent of the query right above.

smplrClient.getSpaceAssetmapFromCache(spaceId: string): unknown

where spaceId and the return value are as defined in getSpaceAssetmap.

Need any other data?

Get in touch with any use-case that would require new queries to be exposed.