Skip to content

Save a flow variable or secret (secret values are write-only)

POST
/v1/flows/variables
curl --request POST \
--url https://api.monita.ai/v1/flows/variables \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "handle": "example", "kind": "variable", "scope": "user", "value": "example", "projectId": "example" }'
Media typeapplication/json
object
handle
required
string
/^[a-z0-9_]{1,40}$/
kind
required
string
Allowed values: variable secret
scope
required
string
Allowed values: user project org
value
required
string
>= 1 characters <= 500 characters
projectId
string

Created

Media typeapplication/json
object
variable
required
object
id
required
string
handle
required
string
kind
required
string
Allowed values: variable secret
scope
required
string
Allowed values: user project org
projectId
required
string
nullable
value
required
string
nullable
hint
required
string
nullable
editable
required
boolean
createdAt
required
number
updatedAt
required
number
Example
{
"variable": {
"kind": "variable",
"scope": "user"
}
}

Invalid input

Media typeapplication/json
object
error
required
string
Examplegenerated
{
"error": "example"
}

Insufficient permissions for this scope

Media typeapplication/json
object
error
required
string
Examplegenerated
{
"error": "example"
}

Handle already exists in this scope

Media typeapplication/json
object
error
required
string
Examplegenerated
{
"error": "example"
}

Secrets unavailable (FLOWS_VAR_KEK not set)

Media typeapplication/json
object
error
required
string
Examplegenerated
{
"error": "example"
}