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

Key-Value Store

Postman Collection
OpenAPI

The Key-Value Store provides simple storage for key/value pairs. Use this to persistently store data that you'd like to retrieve through the Query operation.

POST

Get value by key

Gets a value by key.

Scopes
storage:app

Request

Request bodyapplication/json

key

string

Required
options

GetOptions

Responses

Successfully retrieved the value corresponding to the key.

application/json

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

Set value by key

Stores a JSON value with a specified key. Forge resolves write conflicts using a last-write-wins strategy by default, but this can be configured via the key policy option. 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

oneOf [string, boolean, number, array<undefined>, object]

Required
options

ExtendedSetOptions

Responses

Successfully set the value with metadata fields returned

application/json

SetResponseSchema
POST/v1/set
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 curl --request POST \ --url 'https://api.atlassian.com/forge/storage/kvs/v1/set' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "key": "<string>", "value": "<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 { "key": "<string>", "value": "<string>", "createdAt": 122, "updatedAt": 127, "expireTime": "<string>" }
POST

Delete value by key

Deletes a value by key. Write conflicts are resolved using a last-write-wins strategy.

Scopes
storage:app

Request

Request bodyapplication/json

key

string

Required

Responses

Successfully deleted the key and the corresponding value

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

Query key-value pairs

Retrieve key-value pairs matching the provided list of criteria. This method does not return secret values set by Set secret value.

Scopes
storage:app

Request

Request bodyapplication/json

limit

number

after

string

where

array<WhereCondition>

options

object

Responses

Successfully retrieved the data from storage

application/json

QueryResponseSchema

QueryResponseSchema
POST/v1/query
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 curl --request POST \ --url 'https://api.atlassian.com/forge/storage/kvs/v1/query' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "limit": 2154, "after": "<string>", "where": [ { "condition": "BEGINS_WITH", "property": "key", "values": [ "<string>" ] } ], "options": { "metadataFields": [ "CREATED_AT" ] } }'
POST

Get secret value by key

Gets a value by key, which was stored using Set secret value by key. The value is decrypted before being returned.

Scopes
storage:app

Request

Request bodyapplication/json

key

string

Required
options

GetOptions

Responses

Successfully retrieved the decrypted value corresponding to the key

application/json

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

Set secret value by key

Stores sensitive credentials in JSON format, with encryption. Values set with this method can only be accessed with Get secret value by key. Write conflicts are resolved using a last-write-wins strategy by default, but this can be configured via the key policy option. 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

oneOf [string, boolean, number, array<undefined>, object]

Required
options

ExtendedSetOptions

Responses

Successfully set the value with metadata fields returned

application/json

SetResponseSchema
POST/v1/secret/set
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 curl --request POST \ --url 'https://api.atlassian.com/forge/storage/kvs/v1/secret/set' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "key": "<string>", "value": "<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 { "key": "<string>", "value": "<string>", "createdAt": 122, "updatedAt": 127, "expireTime": "<string>" }
POST

Delete secret value by key

Deletes a secret value by key.

Scopes
storage:app

Request

Request bodyapplication/json

key

string

Required

Responses

Successfully deleted the key and the corresponding encrypted value

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

Rate this page: