API Endpoints
Coordinator REST API reference.
Base URL
Replace {COORDINATOR_URL} with your coordinator service URL.
Local Development:
http://localhost:3001/apiProduction:
https://your-coordinator-domain.com/apiRegister Schedule
Register a schedule with recipient data for execution.
Endpoint: POST /api/schedules
Request:
{
"schedulePda": "schedule_pubkey_here",
"scheduleId": [1, 2, 3, ...],
"vaultEmployer": "employer_pubkey_here",
"tokenMint": "USDC_mint_address",
"recipients": [
{ "address": "recipient1_pubkey", "amount": "100000" },
{ "address": "recipient2_pubkey", "amount": "200000" }
]
}Response:
{
"success": true,
"schedulePda": "schedule_pubkey_here",
"merkleRoot": [1, 2, 3, ...]
}Example:
curl -X POST {COORDINATOR_URL}/api/schedules \
-H "Content-Type: application/json" \
-d '{
"schedulePda": "...",
"scheduleId": [1, 2, 3, ...],
"vaultEmployer": "...",
"tokenMint": "...",
"recipients": [...]
}'Local Development Example:
curl -X POST http://localhost:3001/api/schedules \
-H "Content-Type: application/json" \
-d '{
"schedulePda": "...",
"scheduleId": [1, 2, 3, ...],
"vaultEmployer": "...",
"tokenMint": "...",
"recipients": [...]
}'Get Schedule
Get schedule recipient data.
Endpoint: GET /api/schedules/:schedulePda
Response:
{
"schedulePda": "...",
"scheduleId": [1, 2, 3, ...],
"vaultEmployer": "...",
"tokenMint": "...",
"recipients": [
{ "address": "...", "amount": "100000" }
],
"proofs": [...],
"merkleRoot": [1, 2, 3, ...],
"createdAt": 1234567890
}Example:
curl {COORDINATOR_URL}/api/schedules/SchedulePDA...Local Development Example:
curl http://localhost:3001/api/schedules/SchedulePDA...Health Check
Check coordinator health.
Endpoint: GET /api/health
Response:
{
"status": "ok",
"timestamp": 1234567890
}Example:
curl {COORDINATOR_URL}/api/healthLocal Development Example:
curl http://localhost:3001/api/healthError Responses
All endpoints return errors in this format:
{
"error": "Error message",
"details": "..."
}Status Codes:
200- Success400- Bad Request404- Not Found500- Internal Server Error