Use this API to list to-do items, mark them as done, and create a to-do item for an issue or a merge request.

Create a to-do item for an issuable

POST /api/v4/projects/{id}/issues/{issue_iid}/todo

Creates a to-do item for the current user on a specified issuable. If a to-do item already exists for the user on that issuable, returns a 304 status code.

Parameters

NameTypeDescription
id
Path, required
StringID or URL-encoded path of the project
issue_iid
Path, required
IntegerThe internal ID of an issuable

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesTodo
400Bad Request—
404Not Found—

Create a to-do item for an issuable

POST /api/v4/projects/{id}/merge_requests/{merge_request_iid}/todo

Creates a to-do item for the current user on a specified issuable. If a to-do item already exists for the user on that issuable, returns a 304 status code.

Parameters

NameTypeDescription
id
Path, required
StringID or URL-encoded path of the project
merge_request_iid
Path, required
IntegerThe internal ID of an issuable

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesTodo
400Bad Request—
404Not Found—

List all to-do items

GET /api/v4/todos

Lists all to-do items. When no filter is applied, it returns all pending to-do items for the current user. Different filters allow the user to refine the request.

Parameters

NameTypeDescription
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20
action
Query
StringFilter to-do items by action
Allowed values: assigned, review_requested, mentioned, build_failed, marked, approval_required, unmergeable, directly_addressed, member_access_requested, review_submitted, review_approved, review_changes_requested, ssh_key_expired, ssh_key_expiring_soon, transfer_failed, merge_train_removed
author_id
Query
IntegerFilter to-do items by author ID
project_id
Query
IntegerFilter to-do items by project ID
group_id
Query
IntegerFilter to-do items by group ID
state
Query
StringFilter to-do items by state
Allowed values: pending, done
type
Query
StringFilter to-do items by type
Allowed values: Commit, Issue, WorkItem, MergeRequest, DesignManagement::Design, AlertManagement::Alert, Namespace, Project, Key, WikiPage::Meta

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesTodo
400Bad Request—

Mark all to-do items as done

POST /api/v4/todos/mark_as_done

Marks all pending to-do items for the current user as done. It returns the HTTP status code 204 with an empty response.

Responses

CodeDescriptionSchema
201Created—
400Bad Request—

Mark a to-do item as done

POST /api/v4/todos/{id}/mark_as_done

Marks a to-do item for the current user as done.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the to-do item

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesTodo
400Bad Request—
404Not Found—

Schemas

Objects returned by the operations above and objects nested in their request bodies.

APIEntitiesCustomAttribute

PropertyTypeDescription
keyStringExample: foo
valueStringExample: bar

APIEntitiesNamespaceBasic

PropertyTypeDescription
avatar_urlStringURL of the namespace avatar. For a group, null if no avatar is set
Example: https://example.com/avatar/12345
full_pathStringFull path of the namespace, including the paths of its parent groups
Example: group/my_project
idInteger (int64)ID of the namespace
Example: 2
kindStringType of the namespace: user, group, or project
Example: project
nameStringName of the namespace
Example: project
parent_idInteger (int64)ID of the parent namespace. null for top-level namespaces
Example: 1
pathStringPath of the namespace
Example: my_project
web_urlStringWeb URL of the namespace. For a user namespace, the URL of the user profile
Example: https://example.com/group/my_project

APIEntitiesProjectIdentity

PropertyTypeDescription
created_atString (date-time)Example: 2020-05-07T04:27:17.016Z
descriptionStringExample: desc
idInteger (int64)Example: 1
nameStringExample: project1
name_with_namespaceStringExample: John Doe / project1
pathStringExample: project1
path_with_namespaceStringExample: namespace1/project1

APIEntitiesTodo

PropertyTypeDescription
action_nameStringExample: assigned
authorAPIEntitiesUserBasic—
bodyStringExample: Task description
created_atString (date-time)Example: 2016-06-17T07:52:35.225Z
groupAPIEntitiesNamespaceBasic—
idInteger (int64)—
projectAPIEntitiesProjectIdentity—
stateStringExample: pending
targetObject—
target_typeStringExample: Issue
target_urlStringExample: http://example.com/foo/bar/-/issues/1
updated_atString (date-time)Example: 2016-06-17T07:52:35.225Z

APIEntitiesUserBasic

PropertyTypeDescription
avatar_pathStringExample: /user/avatar/28/The-Big-Lebowski-400-400.png
avatar_urlStringURL of the user’s avatar
Example: https://gravatar.com/avatar/1
custom_attributesArray of APIEntitiesCustomAttribute—
idInteger (int64)ID of the user
Example: 1
lockedBooleanIf true, the user account is locked, and the user cannot sign in until the lock expires or an administrator unlocks the account
nameStringName of the user. For a bot user, **** if the current user cannot read the bot’s project or group
Example: Administrator
public_emailStringPublic email address of the user
Example: john@example.com
stateStringState of the user account. Possible values: active, blocked, ldap_blocked, blocked_pending_approval, banned, or deactivated
Example: active
usernameStringUsername of the user
Example: admin
web_urlStringURL of the user’s profile
Example: https://gitlab.example.com/root