cURL Examples
Copy-paste cURL examples for every WorldFlow AI endpoint. Set the TOKEN variable first:
export TOKEN="your-jwt-token-here"
export SYNAPSE_URL="https://api.worldflowai.com"
Authentication
Exchange API Key for JWT
curl -X POST $SYNAPSE_URL/api/v1/auth/token \
-H "Content-Type: application/json" \
-d '{"api_key": "sk-syn-abc123"}'
Save the token:
export TOKEN=$(curl -s -X POST $SYNAPSE_URL/api/v1/auth/token \
-H "Content-Type: application/json" \
-d '{"api_key": "sk-syn-abc123"}' | jq -r '.access_token')
Projects
Create Project
curl -X POST $SYNAPSE_URL/api/v1/memory/projects \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"projectId": "my-project",
"name": "My Project",
"roadmap": "Build an awesome product"
}'
List Projects
curl $SYNAPSE_URL/api/v1/memory/projects \
-H "Authorization: Bearer $TOKEN"
Get Project
curl $SYNAPSE_URL/api/v1/memory/projects/my-project \
-H "Authorization: Bearer $TOKEN"
Delete Project
curl -X DELETE $SYNAPSE_URL/api/v1/memory/projects/my-project \
-H "Authorization: Bearer $TOKEN"
Store (COMMIT)
Store Milestone
curl -X POST $SYNAPSE_URL/api/v1/memory/projects/my-project/store \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"branchName": "main",
"branchPurpose": "Core feature implementation",
"cumulativeProgress": "Set up project, added authentication",
"thisContribution": "Implemented rate limiting",
"agentId": "my-agent",
"agentType": "custom"
}'
Recall (CONTEXT)
Overview
curl "$SYNAPSE_URL/api/v1/memory/projects/my-project/recall" \
-H "Authorization: Bearer $TOKEN"
Branch View
curl "$SYNAPSE_URL/api/v1/memory/projects/my-project/recall?view=branch&branch=main&limit=5" \
-H "Authorization: Bearer $TOKEN"
Milestone View
curl "$SYNAPSE_URL/api/v1/memory/projects/my-project/recall?view=milestone&milestoneId=ms-abc123" \
-H "Authorization: Bearer $TOKEN"
Log View
curl "$SYNAPSE_URL/api/v1/memory/projects/my-project/recall?view=log&branch=main&limit=20" \
-H "Authorization: Bearer $TOKEN"
Log (OTA)
Append Log Entry
curl -X POST $SYNAPSE_URL/api/v1/memory/projects/my-project/log \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"branchName": "main",
"agentId": "my-agent",
"phase": "observation",
"content": "User requested adding rate limiting to the proxy endpoint"
}'
Branches
Create Branch
curl -X POST $SYNAPSE_URL/api/v1/memory/projects/my-project/branches \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"branchName": "feature-auth",
"parentBranch": "main",
"purpose": "Implement JWT authentication",
"agentId": "my-agent"
}'
List Branches
curl $SYNAPSE_URL/api/v1/memory/projects/my-project/branches \
-H "Authorization: Bearer $TOKEN"
Get Branch
curl $SYNAPSE_URL/api/v1/memory/projects/my-project/branches/feature-auth \
-H "Authorization: Bearer $TOKEN"
Abandon Branch
curl -X POST $SYNAPSE_URL/api/v1/memory/projects/my-project/branches/feature-auth/abandon \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"reason": "Superseded by OAuth2 implementation"}'
Merge
Merge Branch
curl -X POST $SYNAPSE_URL/api/v1/memory/projects/my-project/merge \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sourceBranch": "feature-auth",
"targetBranch": "main",
"mergeSummary": "Auth complete: JWT, login, password reset, RBAC",
"agentId": "my-agent"
}'
Roadmap
Update Roadmap
curl -X PUT $SYNAPSE_URL/api/v1/memory/projects/my-project/roadmap \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"roadmap": "Phase 1: Cache (done)\nPhase 2: Memory (done)\nPhase 3: Intelligence (in progress)"}'
Search
Per-Project Search
curl -X POST $SYNAPSE_URL/api/v1/memory/projects/my-project/search \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"query": "authentication", "limit": 10}'
Cross-Project Search
curl -X POST $SYNAPSE_URL/api/v1/memory/search \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"query": "rate limiting",
"limit": 20,
"projectIds": ["my-project", "other-project"]
}'
Metrics
Store Session Metrics
curl -X POST $SYNAPSE_URL/api/v1/memory/projects/my-project/metrics \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sessionId": "sess-abc123",
"agentId": "my-agent",
"agentType": "custom",
"milestonesRecalled": 5,
"compactionCount": 2,
"toolCallsTotal": 47,
"sessionDurationSecs": 1800,
"startedAt": "2026-02-10T14:00:00Z",
"endedAt": "2026-02-10T14:30:00Z"
}'
Get Metrics Summary
curl $SYNAPSE_URL/api/v1/memory/projects/my-project/metrics/summary \
-H "Authorization: Bearer $TOKEN"
Promote
Promote Cache Entry
curl -X POST $SYNAPSE_URL/api/v1/memory/projects/my-project/promote \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"cacheKey": "cache-key-xyz",
"reuseScore": 0.92,
"summary": "Frequently reused explanation of async/await",
"l2Collection": "default"
}'
Contributors
Upsert Contributor
curl -X POST $SYNAPSE_URL/api/v1/memory/contributors \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"contributorId": "alice",
"displayName": "Alice Chen",
"agentIds": ["claude-code-alice", "cursor-alice"],
"role": "Senior Engineer"
}'
List Contributors
curl $SYNAPSE_URL/api/v1/memory/contributors \
-H "Authorization: Bearer $TOKEN"
Get Contributor
curl $SYNAPSE_URL/api/v1/memory/contributors/alice \
-H "Authorization: Bearer $TOKEN"
Delete Contributor
curl -X DELETE $SYNAPSE_URL/api/v1/memory/contributors/alice \
-H "Authorization: Bearer $TOKEN"
Contributor Activity
curl "$SYNAPSE_URL/api/v1/memory/contributors/alice/activity?limit=10" \
-H "Authorization: Bearer $TOKEN"
External Sources
Create Source
curl -X POST $SYNAPSE_URL/api/v1/memory/sources \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sourceId": "slack-eng",
"projectId": "my-project",
"sourceType": "slack",
"config": {"channelId": "C0123456789"}
}'
List Sources
curl $SYNAPSE_URL/api/v1/memory/sources \
-H "Authorization: Bearer $TOKEN"
Update Source
curl -X PUT $SYNAPSE_URL/api/v1/memory/sources/slack-eng \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"enabled": false}'
Delete Source
curl -X DELETE $SYNAPSE_URL/api/v1/memory/sources/slack-eng \
-H "Authorization: Bearer $TOKEN"
Trigger Sync
curl -X POST $SYNAPSE_URL/api/v1/memory/sources/slack-eng/sync \
-H "Authorization: Bearer $TOKEN"
Sync Status
curl $SYNAPSE_URL/api/v1/memory/sources/slack-eng/status \
-H "Authorization: Bearer $TOKEN"
Intelligence
Query
curl -X POST $SYNAPSE_URL/api/v1/memory/intelligence/query \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"question": "What did the team work on this week?",
"timeRange": "7d"
}'
Execute Action
curl -X POST $SYNAPSE_URL/api/v1/memory/intelligence/action \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": "create_jira_ticket",
"params": {
"project": "SYN",
"summary": "Follow up on auth implementation"
}
}'
Proxy (OpenAI Compatible)
Chat Completions
curl -X POST $SYNAPSE_URL/v1/chat/completions \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "What is a REST API?"}]
}'
Chat Completions (Streaming)
curl -X POST $SYNAPSE_URL/v1/chat/completions \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "What is a REST API?"}],
"stream": true
}'
List Models
curl $SYNAPSE_URL/v1/models \
-H "Authorization: Bearer $TOKEN"
Proxy (Anthropic Compatible)
Messages
curl -X POST $SYNAPSE_URL/v1/messages \
-H "Authorization: Bearer $TOKEN" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-20250514",
"max_tokens": 200,
"messages": [{"role": "user", "content": "What is a REST API?"}]
}'
Messages (Streaming)
curl -X POST $SYNAPSE_URL/v1/messages \
-H "Authorization: Bearer $TOKEN" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-20250514",
"max_tokens": 200,
"messages": [{"role": "user", "content": "What is a REST API?"}],
"stream": true
}'