Developer
News and Updates
Get Support
Sign in
Get Support
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
  • Key-Value Store
  • Custom Entity Store
  • Transaction
  • Batch
Platform
Forge / Reference / KVS/Custom Entity Store API

Custom Entity Store

Postman Collection
OpenAPI

The Custom Entity Store lets you store data in custom entities, which are data structures you can define according to your app's needs. Custom entities let you assign multiple values (or "attributes") to a single key (or "entity") and define indexes to optimize queries against these values.

POST

Get custom entity value by key

Gets a custom entity value by key.

Scopes
storage:app

Request

Request bodyapplication/json

key

string

Required
entityName

string

Required
options

GetOptions

Responses

Successfully retrieved the value corresponding to the key and the entity

application/json

EntityGetResponseSchema
POST/v1/entity/get
1 2 3 4 5 6 7 8 9 10 11 12 13 curl --request POST \ --url 'https://api.atlassian.com/forge/storage/kvs/v1/entity/get' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "key": "<string>", "entityName": "<string>", "options": { "metadataFields": { "0": "CREATED_AT" } } }'
200Response
1 2 3 4 5 6 7 { "key": "<string>", "value": {}, "entityName": "<string>", "createdAt": 116, "updatedAt": 121 }
POST

Set custom entity value by key

Stores a JSON value with a specified key, for the selected entity. Optionally, you can specify a TTL (Time To Live) to automatically expire the data after a specified duration.

Scopes
storage:app

Request

Request bodyapplication/json

key

string

Required
value

object

Required
entityName

string

Required
options

ExtendedSetOptions

Responses

Successfully set the value with metadata fields returned

application/json

EntitySetResponseSchema
POST/v1/entity/set
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 curl --request POST \ --url 'https://api.atlassian.com/forge/storage/kvs/v1/entity/set' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "key": "<string>", "value": {}, "entityName": "<string>", "options": { "ttl": { "value": 38, "unit": "SECONDS" }, "keyPolicy": "FAIL_IF_EXISTS", "returnValue": "PREVIOUS", "returnMetadataFields": { "0": "CREATED_AT" } } }'
200Response
1 2 3 4 5 6 7 8 { "key": "<string>", "value": {}, "entityName": "<string>", "createdAt": 122, "updatedAt": 127, "expireTime": "<string>" }
POST

Delete custom entity value by key

Deletes a value by key, for the selected entity.

Scopes
storage:app

Request

Request bodyapplication/json

key

string

Required
entityName

string

Required

Responses

Successfully deleted the key and the corresponding value of the entity

POST/v1/entity/delete
1 2 3 4 5 6 7 curl --request POST \ --url 'https://api.atlassian.com/forge/storage/kvs/v1/entity/delete' \ --header 'Content-Type: application/json' \ --data '{ "key": "<string>", "entityName": "<string>" }'
POST

Query custom entities

Retrieves custom entities matching the provided list of criteria using query conditions. See Querying the Custom Entity Store for more information about building complex queries.

Scopes
storage:app

Request

Request bodyapplication/json

entityName

string

Required
indexName

string

Required
partition

array<anyOf [string, number, boolean]>

range

object

filters

oneOf [AndFilterSchema, OrFilterSchema]

sort

string

cursor

string

limit

integer

options

object

Responses

Successfully retrieved the data from storage for an entity

application/json

QueryResponseSchema

QueryResponseSchema
POST/v1/entity/query
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 curl --request POST \ --url 'https://api.atlassian.com/forge/storage/kvs/v1/entity/query' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "entityName": "<string>", "indexName": "<string>", "partition": [ "<string>" ], "range": { "condition": "BEGINS_WITH", "values": [ "<string>" ] }, "filters": {}, "sort": "ASC", "cursor": "<string>", "limit": 2154, "options": { "metadataFields": [ "CREATED_AT" ] } }'

Rate this page: