Skip to main content

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:

TypeDescription
create_nodeCreate new nodes
update_nodeModify existing nodes
delete_nodeRemove nodes
merge_nodesCombine multiple nodes
create_relationshipAdd 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:

ParameterTypeDescription
statusstringpending, approved, rejected
proposal_typestringFilter by type
pageintegerPage 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