Universal API
The Universal API provides a single, unified interface to access all Performance Hub services through both GraphQL and REST endpoints.
What is the Universal API?
The Universal API combines the best of both worlds:
- GraphQL Interface - Query exactly the data you need
- REST Interface - Use familiar REST patterns
- Unified Authentication - Single auth token for all services
- Cross-Service Operations - Perform operations across multiple services
Key Features
GraphQL Support
Use GraphQL to query multiple resources in a single request with precise field selection.
REST Compatibility
All GraphQL operations are also available through REST endpoints.
Type-Safe Schema
Complete schema documentation with type definitions.
Real-time Subscriptions
Subscribe to real-time updates via GraphQL subscriptions.
Getting Started
GraphQL Endpoint
POST https://universal-api.performancehub.co/graphql
REST Endpoint
https://universal-api.performancehub.co/v1/rest
Example GraphQL Query
query GetOrganisation {
organisation(id: "org_123") {
id
name
facilities {
id
name
members {
count
}
}
}
}
Example REST Request
curl -X GET \
'https://universal-api.performancehub.co/v1/rest/organisations/org_123' \
-H 'Authorization: Bearer YOUR_TOKEN'
Schema Explorer
Access our interactive schema explorer at: https://universal-api.performancehub.co/explorer
Rate Limits
- GraphQL: 100 operations per minute
- REST: 500 requests per minute
- Subscriptions: 10 concurrent connections
Benefits
Reduced Network Overhead
Fetch all required data in a single GraphQL query instead of multiple REST calls.
Flexible Queries
Request only the fields you need, reducing payload size.
Strong Typing
Benefit from compile-time type checking with GraphQL code generators.