Copy-ready calls for every SDK operation. Required and optional inputs are shown inline in each code block.
List agents or create a new agent.
from roe import RoeClient
client = RoeClient()
result = client.agents.list(
page=1, # optional
page_size=1, # optional
)Create a new base agent.
from roe import RoeClient
client = RoeClient()
result = client.agents.create(
name="name", # required
engine_class_id="engine_class_id", # required
input_definitions=[{"key": "text", "data_type": "text/plain"}], # optional
engine_config={"model": "gpt-5.5-2026-04-23"}, # optional
version_name="version_name", # optional
description="description", # optional
)Get results for multiple agent jobs
from roe import RoeClient
client = RoeClient()
result = client.agents.jobs.retrieve_result_many(
job_ids=["job_id"],
)Get status for multiple agent jobs
from roe import RoeClient
client = RoeClient()
result = client.agents.jobs.retrieve_status_many(
job_ids=["job_id"],
)Get tool result artifact (result only)
from roe import RoeClient
client = RoeClient()
result = client.agents.jobs.retrieve_artifact(
job_id="job_id", # required
artifact_key="artifact_key", # required
)Serve a reference file associated with an agent job.
from roe import RoeClient
client = RoeClient()
content = client.agents.jobs.download_reference(
job_id="job_id",
resource_id="resource_id",
as_attachment=False,
)Get agent job result data.
from roe import RoeClient
client = RoeClient()
result = client.agents.jobs.retrieve_result(
job_id="job_id", # required
)Cancel an agent job
from roe import RoeClient
client = RoeClient()
result = client.agents.jobs.cancel(
job_id="job_id", # required
)Delete agent job data
from roe import RoeClient
client = RoeClient()
result = client.agents.jobs.delete_data(
job_id="job_id", # required
)Get agent job status.
from roe import RoeClient
client = RoeClient()
result = client.agents.jobs.retrieve_status(
job_id="job_id", # required
)Run agent synchronously
from roe import RoeClient
client = RoeClient()
result = client.agents.run_sync(
agent_id="agent_id",
text="text",
metadata={},
)Run agent asynchronously.
from roe import RoeClient
client = RoeClient()
job = client.agents.run(
agent_id="agent_id",
timeout_seconds=300,
text="text",
metadata={},
)Run agent asynchronously with multiple inputs
from roe import RoeClient
client = RoeClient()
batch = client.agents.run_many(
agent_id="agent_id",
batch_inputs=[{"text": "text"}],
timeout_seconds=300,
metadata={},
)Run agent version synchronously
from roe import RoeClient
client = RoeClient()
result = client.agents.run_version_sync(
agent_id="agent_id",
version_id="version_id",
text="text",
metadata={},
)Run agent version asynchronously.
from roe import RoeClient
client = RoeClient()
job = client.agents.run_version(
agent_id="agent_id",
version_id="version_id",
timeout_seconds=300,
text="text",
metadata={},
)Delete a base agent.
from roe import RoeClient
client = RoeClient()
result = client.agents.delete(
agent_id="agent_id", # required
)Retrieve an agent.
from roe import RoeClient
client = RoeClient()
result = client.agents.retrieve(
agent_id="agent_id", # required
)Partially update an agent.
from roe import RoeClient
client = RoeClient()
result = client.agents.update(
agent_id="agent_id", # required
name="name", # optional
disable_cache=True, # optional
cache_failed_jobs=True, # optional
)Update a base agent.
from roe import RoeClient
client = RoeClient()
result = client.agents.replace(
agent_id="agent_id", # required
name="name", # optional
disable_cache=True, # optional
cache_failed_jobs=True, # optional
)Duplicate an agent.
from roe import RoeClient
client = RoeClient()
result = client.agents.duplicate(
agent_id="agent_id", # required
)List agent jobs or create a new agent job.
from roe import RoeClient
client = RoeClient()
result = client.agents.jobs.list(
agent_id="agent_id", # required
page=1, # optional
page_size=1, # optional
status_code="status_code", # optional
version_name="version_name", # optional
metadata="metadata", # optional
created_from="created_from", # optional
created_to="created_to", # optional
search="search", # optional
ordering="ordering", # optional
)Cancel all running agent jobs (:cancelAll)
from roe import RoeClient
client = RoeClient()
result = client.agents.jobs.cancel_all(
agent_id="agent_id", # required
)List agent versions.
from roe import RoeClient
client = RoeClient()
result = client.agents.versions.list(
agent_id="agent_id", # required
)Create a new agent version.
from roe import RoeClient
client = RoeClient()
result = client.agents.versions.create(
agent_id="agent_id", # required
input_definitions=[{"key": "text", "data_type": "text/plain"}], # optional
engine_config={"model": "gpt-5.5-2026-04-23"}, # optional
version_name="version_name", # optional
description="description", # optional
)Retrieve the current version of an agent.
from roe import RoeClient
client = RoeClient()
result = client.agents.versions.retrieve_current(
agent_id="agent_id", # required
)Delete an agent version.
from roe import RoeClient
client = RoeClient()
result = client.agents.versions.delete(
agent_id="agent_id", # required
version_id="version_id", # required
)Retrieve an agent version.
from roe import RoeClient
client = RoeClient()
result = client.agents.versions.retrieve(
agent_id="agent_id", # required
version_id="version_id", # required
get_supports_eval=True, # optional
)Partially update an agent version.
from roe import RoeClient
client = RoeClient()
result = client.agents.versions.update(
agent_id="agent_id", # required
version_id="version_id", # required
version_name="version_name", # optional
description="description", # optional
)Update an agent version.
from roe import RoeClient
client = RoeClient()
result = client.agents.versions.replace(
agent_id="agent_id", # required
version_id="version_id", # required
version_name="version_name", # optional
description="description", # optional
)List/create connections.
from roe import RoeClient
client = RoeClient()
result = client.connections.list(
connector_type="connector_type", # optional
search="search", # optional
page=1, # optional
page_size=1, # optional
)List/create connections.
from roe import RoeClient
client = RoeClient()
result = client.connections.create(
connector_type="connector_type", # required
name="name", # required
config={}, # required
description="description", # optional
auth_config={}, # optional
)Test credentials without storing them.
from roe import RoeClient
client = RoeClient()
result = client.connections.test_credentials(
connector_type="connector_type", # required
config={}, # required
auth_config={}, # optional
)Manage connection.
from roe import RoeClient
client = RoeClient()
result = client.connections.delete(
connection_id="connection_id", # required
)Manage connection.
from roe import RoeClient
client = RoeClient()
result = client.connections.retrieve(
connection_id="connection_id", # required
)Manage connection.
from roe import RoeClient
client = RoeClient()
result = client.connections.update(
connection_id="connection_id", # required
name="name", # optional
description="description", # optional
config={}, # optional
auth_config={}, # optional
)Manage connection.
from roe import RoeClient
client = RoeClient()
result = client.connections.replace(
connection_id="connection_id", # required
name="name", # optional
description="description", # optional
config={}, # optional
auth_config={}, # optional
)Test connection.
from roe import RoeClient
client = RoeClient()
result = client.connections.test(
connection_id="connection_id", # required
)List all connector types.
from roe import RoeClient
client = RoeClient()
result = client.connectors.list()Get connector details.
from roe import RoeClient
client = RoeClient()
result = client.connectors.retrieve(
connector_type="connector_type", # required
)List supported model IDs
from roe import RoeClient
client = RoeClient()
result = client.discovery.list_supported_models(
capability="capability", # optional
)List supported agent engine types
from roe import RoeClient
client = RoeClient()
result = client.discovery.list_agent_engine_types()List all KBs for the org, or start a new draft.
from roe import RoeClient
client = RoeClient()
result = client.knowledge_base.list(
page=1, # optional
page_size=10, # optional
)List all KBs for the org, or start a new draft.
from roe import RoeClient
client = RoeClient()
result = client.knowledge_base.create(
company="company",
brief="brief",
)Names-only typology+tactic catalog.
from roe import RoeClient
client = RoeClient()
result = client.knowledge_base.catalog()Import a finalized Atlas lens into roe-main by its atlas_lens_id.
from roe import RoeClient
client = RoeClient()
result = client.knowledge_base.import_lens("atlas_lens_id")Fetch a lens directly from Atlas by its atlas_lens_id and return the names-only projection.
from roe import RoeClient
client = RoeClient()
result = client.knowledge_base.lens_by_atlas_id("atlas_lens_id")Get or delete a single KB.
from roe import RoeClient
client = RoeClient()
client.knowledge_base.delete("knowledge_base_id")Get or delete a single KB.
from roe import RoeClient
client = RoeClient()
result = client.knowledge_base.retrieve("knowledge_base_id")Poll the atlas draft.
from roe import RoeClient
client = RoeClient()
result = client.knowledge_base.poll_draft("knowledge_base_id")Commit the agreed selection into a lens and mark the KB active.
from roe import RoeClient
client = RoeClient()
result = client.knowledge_base.finalize("knowledge_base_id")Kick off another async generation round with feedback.
from roe import RoeClient
client = RoeClient()
result = client.knowledge_base.regenerate("knowledge_base_id")Approve or decline a pending regeneration proposal.
from roe import RoeClient
client = RoeClient()
result = client.knowledge_base.resolve("knowledge_base_id")Persist hand-edits to the working selection (typology + tactic opt-in/out).
from roe import RoeClient
client = RoeClient()
result = client.knowledge_base.patch_selection(
"knowledge_base_id",
refs=[],
)Standalone best-effort lens sync (display mode).
from roe import RoeClient
client = RoeClient()
result = client.knowledge_base.sync("knowledge_base_id")Unlink a knowledge base: remove the local KnowledgeBase row only, leaving the Atlas lens (and any in-progress draft) untouched.
from roe import RoeClient
client = RoeClient()
client.knowledge_base.unlink("knowledge_base_id")List all policies and create a new policy.
from roe import RoeClient
client = RoeClient()
result = client.policies.list(
page=1, # optional
page_size=1, # optional
)List all policies and create a new policy.
from roe import RoeClient
client = RoeClient()
result = client.policies.create(
name="name", # required
content={}, # required
description="description", # optional
version_name="version_name", # optional
)Retrieve, update, or delete a single policy by ID.
from roe import RoeClient
client = RoeClient()
result = client.policies.delete(
policy_id="policy_id", # required
)Retrieve, update, or delete a single policy by ID.
from roe import RoeClient
client = RoeClient()
result = client.policies.retrieve(
policy_id="policy_id", # required
)Retrieve, update, or delete a single policy by ID.
from roe import RoeClient
client = RoeClient()
result = client.policies.update(
policy_id="policy_id", # required
name="name", # optional
description="description", # optional
)Retrieve, update, or delete a single policy by ID.
from roe import RoeClient
client = RoeClient()
result = client.policies.replace(
policy_id="policy_id", # required
name="name", # required
description="description", # optional
)Create a new policy version or list all versions of a specific policy.
from roe import RoeClient
client = RoeClient()
result = client.policies.versions.list(
policy_id="policy_id",
page=1,
page_size=10,
)Create a new policy version or list all versions of a specific policy.
from roe import RoeClient
client = RoeClient()
result = client.policies.versions.create(
policy_id="policy_id",
content={},
version_name="version_name",
base_version_id="base_version_id",
)Get a specific policy version by policy_id and version_id.
from roe import RoeClient
client = RoeClient()
result = client.policies.versions.retrieve(
policy_id="policy_id",
version_id="version_id",
)List Roe tables
from roe import RoeClient
client = RoeClient()
result = client.tables.list()Run a read-only Roe table query
from roe import RoeClient
client = RoeClient()
result = client.tables.query(
sql="sql", # required
limit=1, # optional
)Get a Roe table query result
from roe import RoeClient
client = RoeClient()
result = client.tables.query_result(
table_query_id="table_query_id", # required
)Delete a Roe table
from roe import RoeClient
client = RoeClient()
result = client.tables.delete(
table_name="table_name", # required
)Describe a Roe table
from roe import RoeClient
client = RoeClient()
result = client.tables.describe(
table_name="table_name", # required
)Preview a Roe table
from roe import RoeClient
client = RoeClient()
result = client.tables.preview(
table_name="table_name", # required
limit=1, # optional
)Upload a CSV as a Roe table
from roe import RoeClient
client = RoeClient()
result = client.tables.upload(
table_name="table_name",
file="file.csv",
with_headers=True,
)Get the current user
from roe import RoeClient
client = RoeClient()
result = client.users.me()These workflows assume ROE_API_KEY and ROE_ORGANIZATION_ID are set.
The first example provisions a policy and an agent from scratch; the later two
reuse an existing agent id so they stay focused on the run-and-fetch calls.
from roe import RoeClient
client = RoeClient()
policy = client.policies.create(
name="AML Investigation Policy",
content={
"guidelines": {
"categories": [
{
"title": "Transaction Patterns",
"rules": [
{
"title": "Structuring below reporting thresholds",
"flag": "RED_FLAG",
"description": "Deposits just under CTR thresholds in a short window.",
}
],
}
]
},
"dispositions": {
"classifications": [
{"name": "SAR", "description": "File a Suspicious Activity Report."},
{"name": "DISMISS", "description": "Close as non-suspicious."},
]
},
},
)
agent = client.agents.create(
name="AML Investigation Agent",
engine_class_id="AMLInvestigationEngine",
input_definitions=[
{
"key": "alert_data",
"data_type": "text/plain",
"description": "Alert to investigate.",
}
],
engine_config={
"policy_version_id": str(policy.current_version_id),
"alert_data": "${alert_data}",
},
)
job = client.agents.run(
agent_id=str(agent.id),
timeout_seconds=300,
alert_data="Customer made 9 cash deposits of $9,500 over three days.",
)
result = job.wait(interval=5.0, timeout=300)
for output in result.outputs:
print(f"{output.key}: {output.value}")import json
import os
from pathlib import Path
from roe import RoeClient
client = RoeClient()
agent_id = os.environ["ROE_URL_AGENT_ID"]
job = client.agents.run(
agent_id=agent_id,
timeout_seconds=300,
url="https://www.roe-ai.com/",
metadata={"use_case": "website-scan"},
)
result = job.wait(interval=5.0, timeout=300)
for output in result.outputs:
try:
payload = json.loads(output.value)
except json.JSONDecodeError:
continue
for ref in payload.get("references", []):
resource_id = ref.get("resource_id")
if resource_id:
content = client.agents.jobs.download_reference(job.id, resource_id)
Path(f"{resource_id}.bin").write_bytes(content)import os
from roe import RoeClient
client = RoeClient()
agent_id = os.environ["ROE_TEXT_AGENT_ID"]
batch = client.agents.run_many(
agent_id=agent_id,
batch_inputs=[
{"text": "Summarize the customer complaint."},
{"text": "Extract the requested follow-up action."},
],
timeout_seconds=300,
)
results = batch.wait(interval=5.0, timeout=300)
for job_result in results:
if job_result is None:
continue
for output in job_result.result or []:
print(f"{output.key}: {output.value}")