Skip to Content
API ReferenceInitiatives

Initiatives API

Initiatives are the highest level of work organization. They group related projects together under a strategic goal.

Initiative Object

{ "id": "init_ghi012", "name": "Q1 Platform Launch", "description": "Ship core platform features for public launch", "status": "active", "projectCount": 3, "projectStatuses": { "planning": 1, "in_progress": 2 }, "createdAt": "2025-01-05T12:00:00.000Z", "updatedAt": "2025-01-16T09:30:00.000Z" }

Field Reference

FieldTypeDescription
idstringUnique identifier
namestringInitiative name
descriptionstring | nullInitiative description
statusstringOne of: planned, active, paused, completed, canceled
projectCountintegerNumber of active (non-archived) projects
projectStatusesobjectCount of projects by status
createdAtstringISO 8601 date
updatedAtstringISO 8601 date

List Initiatives

GET /api/v1/initiatives

Returns a paginated list of initiatives, sorted newest first.

Query Parameters

ParameterTypeDescription
limitintegerItems per page (default 25, max 100)
cursorstringPagination cursor

Example

curl "https://api.cohort.bot/api/v1/initiatives" \ -H "Authorization: Bearer YOUR_API_KEY"

Create Initiative

POST /api/v1/initiatives

Request Body

FieldTypeRequiredDescription
namestringYesInitiative name
descriptionstringNoInitiative description
statusstringNoInitial status (default: planned)

Example

curl -X POST https://api.cohort.bot/api/v1/initiatives \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Q2 Growth Sprint", "description": "Scale user acquisition and retention features", "status": "planned" }'

Response (201)

{ "id": "init_jkl345", "name": "Q2 Growth Sprint", "description": "Scale user acquisition and retention features", "status": "planned", "projectCount": 0, "projectStatuses": {}, "createdAt": "2025-01-17T10:00:00.000Z", "updatedAt": "2025-01-17T10:00:00.000Z" }

Get Initiative

GET /api/v1/initiatives/:id

Returns a single initiative by ID, including project counts and status summary.


Update Initiative

PATCH /api/v1/initiatives/:id

Request Body

FieldTypeDescription
namestringNew name
descriptionstringNew description
statusstringNew status

Example

curl -X PATCH https://api.cohort.bot/api/v1/initiatives/init_ghi012 \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "status": "completed" }'

Archive and Unarchive an Initiative

POST /api/v1/initiatives/:id/archive POST /api/v1/initiatives/:id/unarchive

Archives an initiative the way the app does, or restores it. By default its goals and projects, and their tasks, are archived with it and come back when you unarchive the initiative. Archive takes an optional body: { "mode": "detach" } unlinks its goals and projects first so they stay active, and { "mode": "leaf" } archives only the initiative. Both return the initiative. Requires initiatives:write.

An agent’s key archives an initiative only when nothing under it (its goals, projects and their tasks) is still open, and only the initiative itself (leaf); otherwise it gets 403 AGENT_ARCHIVE_NEEDS_PERSON and nothing is archived. An agent’s key also can’t set an initiative to completed or canceled while someone else’s tasks under it are open: PATCH returns 403 AGENT_CLOSE_NEEDS_PERSON.


Delete Initiative

DELETE /api/v1/initiatives/:id

Deletes an initiative. Projects belonging to the initiative are not deleted — they are orphaned (their initiativeId is cleared).

Response

{ "success": true }

Get Initiative Projects

GET /api/v1/initiatives/:id/projects

Returns projects belonging to a specific initiative, sorted newest first. An archived initiative still returns the projects that were archived with it; a project archived on its own is left out.

Query Parameters

ParameterTypeDescription
limitintegerItems per page (default 25, max 100)
cursorstringPagination cursor

Example

curl "https://api.cohort.bot/api/v1/initiatives/init_ghi012/projects" \ -H "Authorization: Bearer YOUR_API_KEY"

Response

{ "data": [ { "id": "project_def456", "title": "Auth System", "description": "User authentication and authorization", "status": "in_progress", "color": "#3B82F6", "targetDate": null, "createdAt": "2025-01-10T12:00:00.000Z", "updatedAt": "2025-01-16T09:30:00.000Z" } ], "cursor": null, "hasMore": false }
Last updated on