API Documentation

Everything you need to integrate ClockEye into your applications.

Getting Started

Authentication

The ClockEye API supports two authentication methods:

API Key Authentication

Best for server-to-server integrations. Include your API key in the X-API-Key header.

curl -H "X-API-Key: your-api-key" \
  https://api.clockeye.ai/api/projects

Bearer Token Authentication

For user-authenticated requests. Use OAuth 2.0 or login to obtain tokens.

curl -H "Authorization: Bearer your-access-token" \
  https://api.clockeye.ai/api/time-entries

Base URL

https://api.clockeye.ai/api

Rate Limits

PlanRequests / Hour
Free100
Standard1,000
Pro5,000
EnterpriseUnlimited

Error Handling

Errors return JSON with the following structure:

{
  "error": "Human-readable error message",
  "code": "MACHINE_READABLE_CODE",
  "details": {}
}

Time Entries

List Time Entries

GET/time-entries

Retrieve a paginated list of time entries.

Query Parameters

ParameterTypeDescription
user_idstringFilter by user ID
project_idstringFilter by project ID
start_datedateStart date (YYYY-MM-DD)
end_datedateEnd date (YYYY-MM-DD)
pageintegerPage number (default: 1)
curl -H "X-API-Key: your-api-key" \
  "https://api.clockeye.ai/api/time-entries?start_date=2024-01-01&end_date=2024-01-31"

Start Timer

POST/time-entries/start

Start a new timer. If a timer is already running, it will be stopped first.

curl -X POST https://api.clockeye.ai/api/time-entries/start \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "proj_123",
    "task_id": "task_456",
    "description": "Working on feature"
  }'

Stop Timer

POST/time-entries/stop

Stop the current running timer and save the time entry.

curl -X POST https://api.clockeye.ai/api/time-entries/stop \
  -H "X-API-Key: your-api-key"

SDKs

JavaScript / TypeScript

npm install @clockeye/sdk
import { ClockEyeClient } from '@clockeye/sdk';

const client = new ClockEyeClient({
  apiKey: 'your-api-key'
});

// List projects
const projects = await client.projects.list();

// Start timer
const timer = await client.timeEntries.start({
  projectId: 'proj_123',
  description: 'Working on feature'
});

// Stop timer
const entry = await client.timeEntries.stop();

Python

pip install clockeye
from clockeye import ClockEyeClient

client = ClockEyeClient(api_key='your-api-key')

# List projects
projects = client.projects.list()

# Start timer
timer = client.time_entries.start(
    project_id='proj_123',
    description='Working on feature'
)

# Stop timer
entry = client.time_entries.stop()

Webhooks

Create Webhook

POST/webhooks
curl -X POST https://api.clockeye.ai/api/webhooks \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-server.com/webhooks/clockeye",
    "events": ["time_entry.created", "time_entry.stopped"]
  }'

Available Events

  • time_entry.created - New time entry created
  • time_entry.updated - Time entry modified
  • time_entry.deleted - Time entry removed
  • time_entry.started - Timer started
  • time_entry.stopped - Timer stopped
  • screenshot.captured - Screenshot taken
  • project.created - New project created
  • project.updated - Project modified
  • project.deleted - Project removed
  • user.invited - User invitation sent
  • user.joined - User accepted invitation
  • user.removed - User removed

Verify Signature

All webhook requests include a signature header for verification:

const crypto = require('crypto');

function verifyWebhookSignature(payload, signature, secret) {
  const expected = `sha256=${crypto
    .createHmac('sha256', secret)
    .update(payload)
    .digest('hex')}`;

  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected)
  );
}

Need Help?

Contact our developer support team for assistance.

Contact Support