Proposals API
Manage data modification proposals.
Endpoints
POST /proposals
POST Create a proposal.
curl -X POST "https://api.ofself.ai/api/v1/proposals" \
-H "X-API-Key: your-key" \
-H "X-User-ID: user-123" \
-H "Content-Type: application/json" \
-d '{
"proposal_type": "create_node",
"canonical_data": {
"entities": [{
"title": "Meeting Notes",
"value": "Content...",
"node_type": "note"
}]
},
"raw_data": {
"source": "my-app",
"original_text": "..."
}
}'
Proposal Types:
| Type | Description |
|---|---|
create_node | Create new nodes |
update_node | Modify existing nodes |
delete_node | Remove nodes |
merge_nodes | Combine multiple nodes |
create_relationship | Add connections |
GET /proposals
GET List proposals.
curl -X GET "https://api.ofself.ai/api/v1/proposals?status=pending" \
-H "X-API-Key: your-key" \
-H "X-User-ID: user-123"
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
status | string | pending, approved, rejected |
proposal_type | string | Filter by type |
page | integer | Page number |
GET /proposals/:proposal_id
GET Get proposal details.
POST /proposals/:proposal_id/approve
POST Approve a proposal.
curl -X POST "https://api.ofself.ai/api/v1/proposals/prop_abc/approve" \
-H "X-API-Key: your-key" \
-H "X-User-ID: user-123" \
-H "Content-Type: application/json" \
-d '{
"modifications": {}
}'
Response: Returns created node IDs.
{
"status": "approved",
"created_nodes": ["node_1", "node_2"],
"approved_at": "2024-01-15T10:35:00Z"
}
POST /proposals/:proposal_id/reject
POST Reject a proposal.
curl -X POST "https://api.ofself.ai/api/v1/proposals/prop_abc/reject" \
-H "X-API-Key: your-key" \
-H "X-User-ID: user-123" \
-H "Content-Type: application/json" \
-d '{
"reason": "Not relevant to me"
}'
Proposal Lifecycle
Created (pending) → Approved → Applied
↘ Rejected