Save a flow variable or secret (secret values are write-only)
POST
/v1/flows/variables
const url = 'https://api.monita.ai/v1/flows/variables';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"handle":"example","kind":"variable","scope":"user","value":"example","projectId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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" }'Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
handle
required
string
kind
required
string
scope
required
string
value
required
string
projectId
string
Responses
Section titled “Responses”Created
Media typeapplication/json
object
variable
required
object
id
required
string
handle
required
string
kind
required
string
scope
required
string
projectId
required
string
value
required
string
hint
required
string
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"}