Skip to main content

Sprints API

Endpoints for managing sprints and sprint planning.

List Sprints

Get all sprints in a project.

GET /api/projects/[projectId]/sprints

Query Parameters

ParameterTypeDescription
statusstringFilter by status (planning, active, completed)

Response

[
{
"id": "clx1spr1",
"name": "Sprint 1",
"goal": "Complete authentication feature",
"startDate": "2024-01-15T00:00:00.000Z",
"endDate": "2024-01-29T00:00:00.000Z",
"status": "active",
"projectId": "clx1abc123",
"createdAt": "2024-01-10T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}
]

Create Sprint

Create a new sprint.

POST /api/projects/[projectId]/sprints

Request Body

{
"name": "Sprint 2",
"goal": "Build user dashboard",
"startDate": "2024-01-29",
"endDate": "2024-02-12"
}
FieldTypeRequiredDescription
namestringNoSprint name (auto-generated if not provided)
goalstringNoSprint objective
startDatestringNoStart date (ISO format)
endDatestringNoEnd date (ISO format)

Response

{
"id": "clx1spr2",
"name": "Sprint 2",
"goal": "Build user dashboard",
"startDate": "2024-01-29T00:00:00.000Z",
"endDate": "2024-02-12T00:00:00.000Z",
"status": "planning",
"projectId": "clx1abc123",
"createdAt": "2024-01-20T10:30:00.000Z",
"updatedAt": "2024-01-20T10:30:00.000Z"
}

Get Sprint

Get a specific sprint with tickets.

GET /api/projects/[projectId]/sprints/[sprintId]

Response

{
"id": "clx1spr1",
"name": "Sprint 1",
"goal": "Complete authentication feature",
"startDate": "2024-01-15T00:00:00.000Z",
"endDate": "2024-01-29T00:00:00.000Z",
"status": "active",
"tickets": [
{
"id": "clx1tkt1",
"title": "Implement login page",
"type": "Story",
"priority": "High",
"storyPoints": 5
}
],
"ticketHistory": [
{
"ticketId": "clx1tkt1",
"entryType": "added",
"enteredAt": "2024-01-15T10:30:00.000Z"
}
]
}

Get Active Sprint

Get the currently active sprint.

GET /api/projects/[projectId]/sprints/active

Response

Returns the active sprint or null if no sprint is active.

Update Sprint

Update sprint details.

PATCH /api/projects/[projectId]/sprints/[sprintId]

Request Body

{
"name": "Sprint 1 - Extended",
"goal": "Updated goal"
}

Delete Sprint

Delete a sprint. Tickets are moved to backlog (no sprint).

DELETE /api/projects/[projectId]/sprints/[sprintId]
note

Only sprints in planning status can be deleted.

Start Sprint

Start a planning sprint.

POST /api/projects/[projectId]/sprints/[sprintId]/start

Request Body

{
"startDate": "2024-01-29",
"endDate": "2024-02-12"
}

Prerequisites

  • Sprint must be in planning status
  • No other sprint can be active

Response

{
"id": "clx1spr2",
"status": "active",
"startDate": "2024-01-29T00:00:00.000Z",
"endDate": "2024-02-12T00:00:00.000Z"
}

Complete Sprint

Complete an active sprint.

POST /api/projects/[projectId]/sprints/[sprintId]/complete

Request Body

{
"incompleteAction": "moveToNextSprint",
"nextSprintId": "clx1spr3"
}
FieldTypeDescription
incompleteActionstringWhat to do with incomplete tickets
nextSprintIdstringTarget sprint for carryover (if applicable)

Incomplete Action Options

ActionDescription
moveToNextSprintMove to specified sprint (requires nextSprintId)
moveToBacklogRemove sprint assignment
keepInSprintLeave tickets in completed sprint

Response

{
"id": "clx1spr1",
"status": "completed",
"completedTicketCount": 8,
"incompleteTicketCount": 2,
"completedStoryPoints": 34,
"incompleteStoryPoints": 8
}

Extend Sprint

Extend an active sprint's end date.

POST /api/projects/[projectId]/sprints/[sprintId]/extend

Request Body

{
"newEndDate": "2024-02-05"
}

Sprint Settings

Get Settings

GET /api/projects/[projectId]/sprints/settings

Response

{
"defaultSprintDuration": 2,
"autoCarryOverIncomplete": true,
"doneColumnIds": ["clx1col3"]
}

Update Settings

PATCH /api/projects/[projectId]/sprints/settings

Request Body

{
"defaultSprintDuration": 3,
"autoCarryOverIncomplete": false,
"doneColumnIds": ["clx1col3", "clx1col4"]
}
FieldTypeDescription
defaultSprintDurationnumberDefault sprint length in weeks (1-4)
autoCarryOverIncompletebooleanAuto-move incomplete tickets on completion
doneColumnIdsstring[]Column IDs that indicate "done" status

Sprint Status

StatusDescription
planningSprint is being prepared, not yet started
activeSprint is in progress
completedSprint has ended

Carryover Tracking

Tickets that are carried over from one sprint to another are marked:

{
"id": "clx1tkt1",
"isCarriedOver": true,
"carriedFromSprintId": "clx1spr1",
"carriedOverCount": 1
}
FieldDescription
isCarriedOverWhether ticket was carried from another sprint
carriedFromSprintIdOriginal sprint the ticket was planned for
carriedOverCountNumber of times the ticket has been carried over