Rendley docs

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

NameTypeRequiredDescription
attachmentsarray<object>Optional
messagestringRequired
project_idstringRequired
thread_idstringRequired
Response codes
StatusDescription
200OK
400Bad Request
401Unauthorized

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

NameTypeRequiredDescription
interrupt_idstringOptional
interrupt_type"plan_review" | "request_upgrade" | "tool_review" | "context_request" | "command_execution" | "file_upload" | "edit_feedback"Optional
responsestringRequired
thread_idstringRequired
Response codes
StatusDescription
200OK
400Bad Request
401Unauthorized

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

NameTypeRequiredDescription
project_idstringRequired
Response codes
StatusDescription
200OK
400Bad Request
401Unauthorized

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

NameTypeRequiredDescription
project_idstringRequiredProject ID
Response codes
StatusDescription
200OK
400Bad Request
401Unauthorized