Skip to content

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/graphql

The API uses standard GraphQL conventions:

  • Queries for reading data
  • Mutations for creating, updating, or deleting data

Authentication Flow

  1. Register or login to obtain a session
  2. Request an access token using requestAccessToken
  3. Include the JWT token in all subsequent requests via the Authorization header
  4. For tenant-specific operations, include the X-Tenant-ID header

Multi-Tenancy

primaTime is a multi-tenant system. Each organization is a separate tenant with isolated data. After authentication, you must:

  1. Select a tenant (organization) you have access to
  2. Include the tenant ID in the X-Tenant-ID header 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

primaTime API Documentation