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.
Gets a value by key.
storage:appstring
RequiredGetOptions
Successfully retrieved the value corresponding to the key.
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"
}
}
}'1
2
3
4
5
6
{
"key": "<string>",
"value": "<string>",
"createdAt": 116,
"updatedAt": 121
}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.
storage:appstring
RequiredoneOf [string, boolean, number, array<undefined>, object]
RequiredExtendedSetOptions
Successfully set the value with metadata fields returned
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"
}
}
}'1
2
3
4
5
6
7
{
"key": "<string>",
"value": "<string>",
"createdAt": 122,
"updatedAt": 127,
"expireTime": "<string>"
}Deletes a value by key. Write conflicts are resolved using a last-write-wins strategy.
storage:appstring
RequiredSuccessfully deleted the key and the corresponding value
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>"
}'Retrieve key-value pairs matching the provided list of criteria. This method does not return secret values set by Set secret value.
storage:appnumber
string
array<WhereCondition>
object
Successfully retrieved the data from storage
QueryResponseSchema
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"
]
}
}'Gets a value by key, which was stored using Set secret value by key. The value is decrypted before being returned.
storage:appstring
RequiredGetOptions
Successfully retrieved the decrypted value corresponding to the key
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"
}
}
}'1
2
3
4
5
6
{
"key": "<string>",
"value": "<string>",
"createdAt": 116,
"updatedAt": 121
}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.
storage:appstring
RequiredoneOf [string, boolean, number, array<undefined>, object]
RequiredExtendedSetOptions
Successfully set the value with metadata fields returned
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"
}
}
}'1
2
3
4
5
6
7
{
"key": "<string>",
"value": "<string>",
"createdAt": 122,
"updatedAt": 127,
"expireTime": "<string>"
}Deletes a secret value by key.
storage:appstring
RequiredSuccessfully deleted the key and the corresponding encrypted value
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: