Agent
Create an agent session
POST
/v1/agent/sessions Start a new agent session and stream results over Server-Sent Events.
Request
curl -X POST "https://api.rendley.com/v1/agent/sessions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": "<message>",
"project_id": "<project_id>",
"thread_id": "<thread_id>"
}' const res = await fetch("https://api.rendley.com/v1/agent/sessions", {
method: "POST",
headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json" },
body: JSON.stringify({
"message": "<message>",
"project_id": "<project_id>",
"thread_id": "<thread_id>"
}),
});
const { data } = await res.json(); import requests
res = requests.post(
"https://api.rendley.com/v1/agent/sessions",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"message": "<message>",
"project_id": "<project_id>",
"thread_id": "<thread_id>"
},
)
data = res.json()["data"] Request body
| Name | Type | Required | Description |
|---|---|---|---|
attachments | array<object> | Optional | |
message | string | Required | |
project_id | string | Required | |
thread_id | string | Required |
Response codes
| Status | Description |
|---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized |
Resume an agent session
POST
/v1/agent/sessions/resume Resume an interrupted agent session and stream results over Server-Sent Events.
Request
curl -X POST "https://api.rendley.com/v1/agent/sessions/resume" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"response": "<response>",
"thread_id": "<thread_id>"
}' const res = await fetch("https://api.rendley.com/v1/agent/sessions/resume", {
method: "POST",
headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json" },
body: JSON.stringify({
"response": "<response>",
"thread_id": "<thread_id>"
}),
});
const { data } = await res.json(); import requests
res = requests.post(
"https://api.rendley.com/v1/agent/sessions/resume",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"response": "<response>",
"thread_id": "<thread_id>"
},
)
data = res.json()["data"] Request body
| Name | Type | Required | Description |
|---|---|---|---|
interrupt_id | string | Optional | |
interrupt_type | "plan_review" | "request_upgrade" | "tool_review" | "context_request" | "command_execution" | "file_upload" | "edit_feedback" | Optional | |
response | string | Required | |
thread_id | string | Required |
Response codes
| Status | Description |
|---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized |
Create an agent thread
POST
/v1/agent/threads Create a new agent thread for a project.
Request
curl -X POST "https://api.rendley.com/v1/agent/threads" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"project_id": "<project_id>"
}' const res = await fetch("https://api.rendley.com/v1/agent/threads", {
method: "POST",
headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json" },
body: JSON.stringify({
"project_id": "<project_id>"
}),
});
const { data } = await res.json(); import requests
res = requests.post(
"https://api.rendley.com/v1/agent/threads",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"project_id": "<project_id>"
},
)
data = res.json()["data"] Request body
| Name | Type | Required | Description |
|---|---|---|---|
project_id | string | Required |
Response codes
| Status | Description |
|---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized |
Get the last agent thread
GET
/v1/agent/threads/last Get the most recent agent thread for a project.
Request
curl "https://api.rendley.com/v1/agent/threads/last?project_id=PROJECT_ID" \
-H "Authorization: Bearer YOUR_API_KEY" const res = await fetch("https://api.rendley.com/v1/agent/threads/last?project_id=PROJECT_ID", {
headers: { Authorization: "Bearer YOUR_API_KEY" },
});
const { data } = await res.json(); import requests
res = requests.get(
"https://api.rendley.com/v1/agent/threads/last?project_id=PROJECT_ID",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
data = res.json()["data"] Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
project_id | string | Required | Project ID |
Response codes
| Status | Description |
|---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized |