Appearance
API Overview
The primaTime API is a comprehensive GraphQL-based API designed for time tracking, project management, and team collaboration. It provides a unified interface for managing organizations, projects, clients, tasks, time records, and more.
What You Can Do
With the primaTime API, you can:
- Manage Organizations — Create and configure workspaces for teams
- Track Time — Log time records against projects, tasks, and clients
- Manage Projects — Create projects, assign team members, and track progress
- Handle Clients — Organize client information and associate projects
- Manage Tasks — Create, assign, and track task completion within projects
- Generate Reports — Query time tracking summaries and financial reports
- Manage Users — Invite team members, assign roles, and control access
Key Concepts
GraphQL Endpoint
All API requests are sent to a single endpoint:
POST https://api.next.primatime.com/graphqlThe API uses standard GraphQL conventions:
- Queries for reading data
- Mutations for creating, updating, or deleting data
Authentication Flow
- Register or login to obtain a session
- Request an access token using
requestAccessToken - Include the JWT token in all subsequent requests via the
Authorizationheader - For tenant-specific operations, include the
X-Tenant-IDheader
Multi-Tenancy
primaTime is a multi-tenant system. Each organization is a separate tenant with isolated data. After authentication, you must:
- Select a tenant (organization) you have access to
- Include the tenant ID in the
X-Tenant-IDheader for all requests
Request/Response Flow
Basic Request Structure
Every GraphQL request contains:
json
{
"query": "...",
"variables": { ... }
}Example: Fetching Projects
graphql
query GetProjects {
projects(first: 10) {
edges {
node {
id
title
code
status {
title
}
}
}
pageInfo {
hasNextPage
endCursor
totalCount
}
}
}HTTP Request
bash
curl -X POST https://api.next.primatime.com/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "X-Tenant-ID: your-tenant-id" \
-d '{
"query": "query GetProjects { projects(first: 10) { edges { node { id title code } } pageInfo { hasNextPage totalCount } } }"
}'Response Structure
Successful responses follow this structure:
json
{
"data": {
"projects": {
"edges": [
{
"node": {
"id": "abc123",
"title": "Website Redesign",
"code": "WEB-001"
}
}
],
"pageInfo": {
"hasNextPage": true,
"totalCount": 42
}
}
}
}Next Steps
- Authentication — Learn how to authenticate API requests
- Tenant Handling — Understand multi-tenancy
- Working with GraphQL — Query patterns and best practices
- Error Handling — Handle API errors gracefully
- Grids & Filtering — Filter, sort, and paginate data
- GraphiQL Playground — Explore the API interactively