POST
/
action
/
get_variable_from_database
curl --request POST \
  --url https://api-lr.agent.ai/v1/action/get_variable_from_database \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "variable": "<string>",
  "variable_retrieval_depth": "most_recent_value",
  "agent_db_historical_values": "last hour",
  "agent_db_variable_retrieval_count": "<string>"
}'
{
  "status": 123,
  "response": {}
}

Authorizations

Authorization
string
header
required

Bearer token from your account (https://agent.ai/user/settings#credits)

Body

application/json
variable
string
required

The variable to retrieve.

variable_retrieval_depth
enum<string>
default:
most_recent_value
required

How far back to retrieve data.

Available options:
most_recent_value,
historical_values
agent_db_historical_values
enum<string>

Historical data interval.

Available options:
last hour,
last day,
last week,
last month,
all time
agent_db_variable_retrieval_count
string

Number of items to retrieve (default: 10).

Response

200 - application/json
Retrieved variable data
status
integer

HTTP status code of the action response

response
object

Response data from the action