Agents
Create a routine
Runs prompt as a new turn of the agent every cadenceMinutes
(5 to 525600), first at firstRunAt (default: one cadence from
now). Each run uses the agent’s phone and is billed like any other
turn. A routine runs as the user who created it (for an API key, the
user who created the key) and stops when that user loses access to
the workspace. The plan limits how many routines a workspace has
(402 routine_limit).
An API key may manage routines in its own workspace; a signed-in user needs the admin or member role.
Retries: not safe: each call creates another routine. List the agent’s routines before retrying.
POST
/
v1
/
workspaces
/
{workspaceId}
/
agents
/
{agentId}
/
routines
Create a routine
curl --request POST \
--url https://api.lusor.ai/v1/workspaces/{workspaceId}/agents/{agentId}/routines \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"prompt": "<string>",
"cadenceMinutes": 262802,
"name": "<string>",
"firstRunAt": "2023-11-07T05:31:56Z"
}
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
cadenceMinutes: 262802,
name: '<string>',
firstRunAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.lusor.ai/v1/workspaces/{workspaceId}/agents/{agentId}/routines', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lusor.ai/v1/workspaces/{workspaceId}/agents/{agentId}/routines"
payload = {
"prompt": "<string>",
"cadenceMinutes": 262802,
"name": "<string>",
"firstRunAt": "2023-11-07T05:31:56Z"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdBy": "<string>",
"name": "<string>",
"prompt": "<string>",
"cadenceMinutes": 123,
"scheduledAt": "2023-11-07T05:31:56Z",
"lastRunAt": "2023-11-07T05:31:56Z",
"lastSessionId": "<string>",
"lastError": "<string>",
"enabled": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "validation_error",
"details": {}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
ApiKeyBearerAuth
Path Parameters
Body
application/json
Was this page helpful?
⌘I
Create a routine
curl --request POST \
--url https://api.lusor.ai/v1/workspaces/{workspaceId}/agents/{agentId}/routines \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"prompt": "<string>",
"cadenceMinutes": 262802,
"name": "<string>",
"firstRunAt": "2023-11-07T05:31:56Z"
}
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
cadenceMinutes: 262802,
name: '<string>',
firstRunAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.lusor.ai/v1/workspaces/{workspaceId}/agents/{agentId}/routines', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lusor.ai/v1/workspaces/{workspaceId}/agents/{agentId}/routines"
payload = {
"prompt": "<string>",
"cadenceMinutes": 262802,
"name": "<string>",
"firstRunAt": "2023-11-07T05:31:56Z"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdBy": "<string>",
"name": "<string>",
"prompt": "<string>",
"cadenceMinutes": 123,
"scheduledAt": "2023-11-07T05:31:56Z",
"lastRunAt": "2023-11-07T05:31:56Z",
"lastSessionId": "<string>",
"lastError": "<string>",
"enabled": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "validation_error",
"details": {}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}
