Skip to content
Connect an agent

Variables

Set a variable

Set a variable.

PUT/v1/variables/{name}

TL;DR

QuestionAnswer
What does it do?Set a variable.
What does it need?An API key or an OAuth access token.
What does it take?A JSON body with the fields below, and name in the path.
What does it return?Status 200 with a body of type Variable.
In the SDK?flung.variables.set()
As an MCP tool?set_variable
What can go wrong?401 Missing, unknown, revoked or expired API key; 422 The request failed validation; 429 Too many requests for this credential; wait for retry-after seconds. Every failure has the same error shape.

Example

bash
curl -X PUT 'https://api.flung.dev/v1/variables/string' \  --header "Authorization: Bearer $FLUNG_API_KEY" \  --header 'Content-Type: application/json' \  --data '{  "value": "string"}'

A successful answer looks like this:

json
{  "name": "string",  "value": "string",  "updatedAt": "2026-11-01T09:00:00.000Z"}

Path parameters

FieldTypeRequiredDescription
namestringyes

Request body

The body has the type an object, with the fields below.

FieldTypeRequiredDescription
valuestringyesat most 2000 characters.

Responses

StatusMeaningBody
200The variable.Variable
401Missing, unknown, revoked or expired API key.Error
422The request failed validation.Error
429Too many requests for this credential; wait for retry-after seconds.Error

Response body

A 200 answer has the type Variable.

FieldTypeRequiredDescription
namestringyes
valuestringyes
updatedAtstringyes

See also

DocWhy
API referenceEvery endpoint
SchemasEvery request and response type
ErrorsEvery error code and what to do about it
set_variableThe same operation as an MCP tool