Cloud APIs
StandardDataStoresApi_V2
createStandardDataStoreEntry

createStandardDataStoreEntry

Creates an entry in a standard datastore.

Parameters

NameTypeDescription
universeIdIdentifierThe ID of the universe to create the entry in.
dataStorestringthe name of the datastore to create the entry in.
scope?stringThe optional scope for the dataStore.
entryIdstringThe ID (key / name) for the entry.
valueSchemaThe value (content) for the entry.
users?ArrayNonEmptyIfConstArray metadata containing the IDs of the users this entry is affiliated with.
attributes?Record<any, any>Key-Value Pairs metadata containing arbitrary data.

Example

type InventorySchema = { Iron?: number; Gold?: number; Copper?: number; Stone?: number; Wood?: number };
const { data: entry } = await StandardDataStoresApi_V2.createStandardDataStoreEntry<InventorySchema>({
  universeId: 5097539509,
  dataStore: "InventoryStore",
  entryId: "users/45348281",
  value: { Iron: 50 },
  users: [45348281],
}); 

Example Data

{
  path: "universes/5097539509/data-stores/InventoryStore/entries/users:45348281",
  createTime: 2024-07-22T19:06:55.829Z,
  revisionId: "08DCAA81744A406E.0000000001.08DCAA81744A406E.01",
  revisionCreateTime: 2024-07-22T19:06:55.829Z,
  state: "ACTIVE",
  etag: "08DCAA81744A406E.0000000001.08DCAA81744A406E.01",
  value: { Iron: 50 },
  id: "users:45348281",
  users: ["users/45348281"],
  attributes: {},
} 

Endpoint

POST /v2/universes/{universe}/data-stores/{data-store}/entries
POST /v2/universes/{universe}/data-stores/{data-store}/scopes/{scope}/entries