API Overview¶
CommonGraph exposes a REST API for programmatic access to graph data.
Quick Links¶
- Full API Documentation — Interactive Swagger UI (when backend is running)
- Endpoints Reference — Common endpoints and examples
- Authentication — How to authenticate with the API
Base URL¶
Development: http://localhost:8000
Production: https://yourdomain.com
Common Endpoints¶
Nodes¶
GET /api/nodes— List nodesPOST /api/nodes— Create nodeGET /api/nodes/{id}— Get node detailsPUT /api/nodes/{id}— Update nodeDELETE /api/nodes/{id}— Delete node
Edges¶
GET /api/edges— List edgesPOST /api/edges— Create edgeGET /api/edges/{id}— Get edge detailsPUT /api/edges/{id}— Update edgeDELETE /api/edges/{id}— Delete edge
Authentication¶
POST /api/auth/login— Authenticate and get tokenPOST /api/auth/logout— Invalidate tokenGET /api/auth/me— Get current user info
Schemas¶
GET /api/schema— Get platform schemaGET /api/schema/nodes— List node typesGET /api/schema/edges— List edge types
Response Format¶
All API responses use JSON:
{
"data": { /* response data */ },
"meta": {
"status": "success",
"timestamp": "2025-01-15T10:30:00Z"
}
}
Error Handling¶
Errors return appropriate HTTP status codes with details:
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid input",
"details": [...]
}
}
Rate Limiting¶
API rate limits are applied per user. See Authentication for details.
Interactive Documentation¶
When CommonGraph is running, visit http://localhost:8000/docs for interactive API documentation with try-it-out functionality.
Next Steps¶
- Review Endpoints for examples
- Learn about Authentication
- Check full docs at
/docsendpoint