Common integration patterns
Every integration starts with an API key. Generate one in Settings → Developer → Generate API Key, then use it as a Bearer token on every request. The four most common patterns are:- Daily sync — Query today’s blocks each morning and push them to a Notion or Obsidian task list to keep your notes in sync with your study plan.
- Progress dashboard — Call
GET /v1/statsweekly to pull streak counts and completion rates into Grafana, Notion charts, or any BI tool you already use. - Schedule automation — Create blocks programmatically from a course syllabus CSV or calendar
.icsfile so you never have to enter sessions by hand. - AI assistant — Connect the Take Time MCP Server to Claude or Cursor so your AI assistant can read and update your schedule via natural language.
All API requests require the
Authorization: Bearer <key> header. Requests without a valid key return 401 UNAUTHORIZED.Listing today’s blocks
TheGET /v1/blocks endpoint accepts a date query parameter in YYYY-MM-DD format. Fetch today’s blocks and filter for incomplete sessions to build a quick daily briefing.
Marking a block complete
Send aPATCH request to /v1/blocks/:id with done: true to mark a block complete. You can also update the topic, start, end, or subject_id fields in the same request.
Pulling progress stats
GET /v1/stats returns aggregated progress data for a given time period. Use the period parameter — today, week, month, or all — to control how far back the data goes.
data object includes:
| Field | Type | Description |
|---|---|---|
total_blocks | integer | Total blocks in the period. |
completed_blocks | integer | Number of blocks marked done. |
completion_rate | number | Fraction of scheduled blocks completed (0–1). |
streak_days | integer | Current consecutive-day streak. |
total_minutes | integer | Total study minutes in the period. |
heatmap | object | Map of { "YYYY-MM-DD": count } for each day in the period. |
period: today, week, month, all.
Error handling
Every Take Time API response uses a consistent{ data, error, meta } envelope. The data field is null when an error occurs, and the error object contains a machine-readable code and a human-readable message.
Node.js
| Code | Meaning |
|---|---|
VALIDATION_ERROR | One or more input fields failed validation. Check the message for field-level details. |
NOT_FOUND | The block or activity ID you referenced does not exist. |
RATE_LIMITED | You’ve exceeded your plan’s request quota. Respect the Retry-After response header. |
UNAUTHORIZED | The API key is missing, malformed, or revoked. |
Best practices
- Use date range filters. Pass
date_fromanddate_totoGET /v1/blocksinstead of making one request per day. Range queries reduce round-trips and are counted as a single API call. - Always check
errorbefore readingdata. Even a200 OKresponse can carry anerrorobject in edge cases. Treaterror !== nullas a failure regardless of HTTP status. - Handle
RATE_LIMITEDgracefully. Read theRetry-Afterheader and implement exponential backoff rather than hammering the API on failure. - Validate block IDs before patching. Call
GET /v1/blockswith a date filter to confirm a block exists before sending aPATCH. This avoidsNOT_FOUNDerrors in automation scripts. - Store your API key in environment variables. Never hardcode keys in source files. Use
process.env.TAKETIME_API_KEYin Node.js or your platform’s secrets manager.