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/apiRate Limits
| Plan | Requests / Hour |
|---|---|
| Free | 100 |
| Standard | 1,000 |
| Pro | 5,000 |
| Enterprise | Unlimited |
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-entriesRetrieve a paginated list of time entries.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
user_id | string | Filter by user ID |
project_id | string | Filter by project ID |
start_date | date | Start date (YYYY-MM-DD) |
end_date | date | End date (YYYY-MM-DD) |
page | integer | Page 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/startStart 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/stopStop 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
/webhookscurl -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 createdtime_entry.updated- Time entry modifiedtime_entry.deleted- Time entry removedtime_entry.started- Timer startedtime_entry.stopped- Timer stoppedscreenshot.captured- Screenshot takenproject.created- New project createdproject.updated- Project modifiedproject.deleted- Project removeduser.invited- User invitation sentuser.joined- User accepted invitationuser.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)
);
}