Key Value

Delete a key-value pair

delete

Permanently removes a key-value pair from storage. Returns 404 if the key does not exist. This operation cannot be undone. Only users with owner role or application tokens can perform this operation.

Authorizations
Path parameters
keystringRequired
Responses
204
The key-value pair has been successfully deleted.
delete
DELETE /sfp/api/key-value/{key} HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*

No content

Create a new key-value pair

post

Creates a new key-value pair. Will fail if the key already exists. Use upsert endpoint to create or update. Values can be any JSON-serializable data. Optional TTL and tags can be specified.

Authorizations
Body
keystringOptional
valuestringOptional
Responses
201
The key-value pair has been successfully created.
application/json
post
POST /sfp/api/key-value HTTP/1.1
Host: 
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 29

{
  "key": "text",
  "value": "text"
}
{
  "key": "text",
  "value": "text"
}

Create or update a key-value pair

post

Creates a new key-value pair or updates an existing one. This is the preferred method for storing data when you want to ensure the value is saved regardless of whether the key exists.

Authorizations
Body
keystringOptional
valuestringOptional
Responses
200
The key-value pair has been successfully created or updated.
application/json
post
POST /sfp/api/key-value/upsert HTTP/1.1
Host: 
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 29

{
  "key": "text",
  "value": "text"
}
{
  "key": "text",
  "value": "text"
}

Get the value for a given key

get

Retrieves the value associated with the specified key. Returns 404 if the key does not exist. Expired keys (if TTL was set) are automatically removed and will return 404.

Authorizations
Path parameters
keystringRequired
Responses
200
The value has been successfully retrieved.
get
GET /sfp/api/key-value/{key} HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*

No content

Update the value for a given key

put

Updates an existing key-value pair. Will fail with 404 if the key does not exist. Use this when you need to ensure the key exists before updating. TTL and tags can also be updated.

Authorizations
Path parameters
keystringRequired
Body
valuestringOptional
Responses
200
The value has been successfully updated.
application/json
put
PUT /sfp/api/key-value/{key} HTTP/1.1
Host: 
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 16

{
  "value": "text"
}
{
  "key": "text",
  "value": "text"
}

Last updated

Was this helpful?