Worlds / Legal
ContractPodAi API
A local ContractPodAi with a contract repository, extracted obligations, renewal dates and legal review queues. Test the agent that tracks renewals, assigns reviews and records obligations.
- Base path
/api/v1- Auth
- OAuth bearer token, the world key
- Endpoints
- 14
- Status
- Active today
This reference previews the surface the ContractPodAi world serves in the closed beta. Paths mirror the public ContractPodAi API; the exact subset is confirmed when your workflow is scoped.
Connect
The run gives your agent these bindings. Keep your SDK; change only where it sends requests.
| binding | meaning |
|---|---|
WORLDS_CONTRACTPODAI_URL | This world's origin followed by /api/v1 |
WORLDS_API_KEY | The world key, accepted wherever ContractPodAi expects a credential |
WORLDS_WORLD_ID | The isolated world's identity |
const base = process.env.WORLDS_CONTRACTPODAI_URL;
const res = await fetch(base + "/api/v1/contracts?status=in_review&limit=20", {
headers: {
Authorization: "Bearer " + process.env.WORLDS_API_KEY,
},
});
const { data } = await res.json();API reference
Contracts
Agreements with counterparty, value, dates and status.
- GET
/api/v1/contractsList contracts - POST
/api/v1/contractsCreate a contract - GET
/api/v1/contracts/{id}Get a contract - PATCH
/api/v1/contracts/{id}Update a contract - GET
/api/v1/contracts/{id}/versionsList contract versions
Fields · 6
id | string | Contract id |
title | string | Title |
type | string | Contract type |
status | string | draft, in_review, active or expired |
counterparty | object | Other party |
end_date | date | Expiry date |
Counterparties
Companies and people you contract with.
- GET
/api/v1/counterpartiesList counterparties - POST
/api/v1/counterpartiesCreate a counterparty - GET
/api/v1/counterparties/{id}Get a counterparty
Fields · 4
id | string | Counterparty id |
name | string | Name |
address | object | Address |
contacts | array | Contacts |
Approvals
Review and approval steps on a contract.
- GET
/api/v1/contracts/{id}/approvalsList contract approvals - POST
/api/v1/approvals/{id}/approveApprove - POST
/api/v1/approvals/{id}/rejectReject
Fields · 5
id | string | Approval id |
contract_id | string | Contract |
approver | object | Assigned approver |
status | string | pending, approved or rejected |
decided_at | datetime | Decision time |
Obligations
Tracked commitments and renewal dates from a contract.
- GET
/api/v1/obligationsList obligations - POST
/api/v1/obligationsCreate an obligation - PATCH
/api/v1/obligations/{id}Update an obligation
Fields · 5
id | string | Obligation id |
contract_id | string | Contract |
description | string | What is owed |
due_date | date | Due date |
status | string | open, done or overdue |
Test workflow
- Prepare. Select the ContractPodAi setup for your workflow and review its starting records, including contracts, counterparties, approvals.
- Connect. Configure your agent with this world's URL and key using the SDK example. Check that it reaches the intended API before running a test.
- Define. Describe the task, expected final changes and records that must stay untouched. Keep expected outcomes separate from the agent's instructions.
- Run and inspect. Use the dashboard or your workflow's generated CLI setup. Review final records and changes, then rerun from the same starting setup with the relevant failure conditions. Use Deployment and CI to automate the same workflow.
What to verify
- Globex subscription flagged for renewal
- Initech Realty lease still Active
- Northwind audit obligation marked met
- Umbrella quarterly report still open
- No contract status changed
Test file
A task file names the jobs, the policy your agent is given and what the grader reads back from the world's final state. The agent never sees the expected outcomes.
# worlds/tasks.yaml · ContractPodAi
version: 2
connector: contractpodai
seed: contractpodai-starter
mode: isolated
policy: >
Scan for renewals in the next 60 days and flag anything inside its notice
window for the owner. Close obligations only where evidence is attached. Do
not change contract status.
tasks:
- id: flag-contracts-approaching-their-renewal-notice-date
prompt: Flag contracts approaching their renewal notice date
- id: assign-incoming-review-requests-to-the-right-counsel
prompt: Assign incoming review requests to the right counsel
- id: record-and-close-completed-obligations
prompt: Record and close completed obligations
expected:
- Globex subscription flagged for renewal
- Initech Realty lease still Active
- Northwind audit obligation marked met
- Umbrella quarterly report still open
- No contract status changed
scenarios:
- rate-limited
- token-expired
- permission-deniedSee Tasks and outcomes for every field, and Deployment and CI to run the file on every pull request.
Failure conditions
Each one fires before the handler, at the same step on every run.
| condition | what the agent sees |
|---|---|
rate-limited | The API returns 429 during a bulk renewal scan |
token-expired | The access token expires mid run |
permission-denied | A contract outside the user's business unit returns 403 |
webhook-twice | The contract updated event arrives two times |
Starting data
Start each run from the same records and relationships. The overview below describes the ContractPodAi starter; use the setup supplied for your workflow when preparing your own snapshot.
| Records | Starting setup |
|---|---|
| contracts | 400 in the repository with type, counterparty and term |
| renewals | Auto-renew and fixed-term dates with notice periods |
| obligations | Payment, reporting and audit obligations with owners |
| review queue | 18 requests waiting for legal review |
| counsel | 5 reviewers with practice areas |
The record shapes below reuse this world's API field definitions. They show illustrative values and placeholders, not an importable seed. API responses and seed input can differ; include all required records and references in the accepted import format for your workflow.
Contracts records
Contracts
Agreements with counterparty, value, dates and status.
| Field | Type | Meaning / relationship |
|---|---|---|
id | string | Contract id |
title | string | Title |
type | string | Contract type |
status | string | draft, in_review, active or expired |
counterparty | object | Other party |
end_date | date | Expiry date |
{
"id": "<Contract id>",
"title": "<Title>",
"type": "<Contract type>",
"status": "<draft, in_review, active or expired>",
"counterparty": {},
"end_date": "<Expiry date>"
}Counterparties records
Counterparties
Companies and people you contract with.
| Field | Type | Meaning / relationship |
|---|---|---|
id | string | Counterparty id |
name | string | Name |
address | object | Address |
contacts | array | Contacts |
{
"id": "<Counterparty id>",
"name": "<Name>",
"address": {},
"contacts": []
}Approvals records
Approvals
Review and approval steps on a contract.
| Field | Type | Meaning / relationship |
|---|---|---|
id | string | Approval id |
contract_id | string | Contract |
approver | object | Assigned approver |
status | string | pending, approved or rejected |
decided_at | datetime | Decision time |
{
"id": "<Approval id>",
"contract_id": "<Contract>",
"approver": {},
"status": "<pending, approved or rejected>",
"decided_at": "<Decision time>"
}Obligations records
Obligations
Tracked commitments and renewal dates from a contract.
| Field | Type | Meaning / relationship |
|---|---|---|
id | string | Obligation id |
contract_id | string | Contract |
description | string | What is owed |
due_date | date | Due date |
status | string | open, done or overdue |
{
"id": "<Obligation id>",
"contract_id": "<Contract>",
"description": "<What is owed>",
"due_date": "<Due date>",
"status": "<open, done or overdue>"
}