NOTICE: This is the documentation for the legacy REST API. It is being replaced with the GraphQL API.
The todo.sr.ht API allows you to browse, create, and manage repositories on todo.sr.ht programmatically. This API follows the standard sourcehut API conventions.
Authentication is done via the meta.sr.ht OAuth flow. The following OAuth scopes are available for todo.sr.ht:
{
"id": integer,
"created": "timestamp",
"submitter": { short-form user resource },
"text": "string (markdown)",
"ticket" { short-form ticket resoruce }
}
Short form:
{
"id": integer,
"created": "timestamp",
"submitter": { short-form user resource },
"text": "string (markdown)"
}
{
"id": integer,
"created": "timestamp",
"event_type": [ ...list of event types... ],
"old_status": status or null,
"old_resolution": resolution or null,
"new_status": status or null,
"new_resolution": resolution or null,
"user": { short-form user resource } or null,
"ticket": { short-form ticket resource } or null,
"comment": { short-form comment resource } or null,
"label": [ ...list of strings... ] or null,
"by_user": { short-form user resource } or null,
"from_ticket": { short-form ticket resource } or null
}
Event type may be one or more of created
, comment
, status_change
,
label_added
, label_removed
, assigned_user
, unassigned_user
,
user_mentioned
, or ticket_mentioned
.
Status fields may be one of reported
, confirmed
, in_progress
,
pending
, or resolved
.
Resolution fields may be one of unresolved
, fixed
, implemented
,
wont_fix
, by_design
, invalid
, duplicate
, or not_our_bug
.
The by_user
and from_ticket
features are used for events where a ticket or
user was mentioned in a comment somewhere. The ticket field and user field are
set to the mentioned ticket or user, and the by_user
or from_ticket
field
are set according to the discussion where the mention occured.
{
"name": "string",
"created": "timestamp",
"colors": {
"background": "#rrggbb",
"text": "#rrggbb"
},
"tracker": { short-form tracker resource }
}
Short form:
{
"name": "string",
"colors": {
"background": "#rrggbb",
"text": "#rrggbb"
}
}
{
"id": integer,
"ref": "string",
"tracker": { short-form tracker resource },
"title": "ticket subject",
"created": "timestamp",
"updated": "timestamp",
"submitter": { short-form user resource },
"description": "string (markdown)",
"status": status,
"resolution": resolution,
"permissions": {
"anonymous": [ ...list of strings... ] or null,
"submitter": [ ...list of strings... ] or null,
"user": [ ...list of strings... ] or null,
},
"labels": [ ...list of label names... ],
"assignees": [ ...list of short-form user resources... ]
}
Status fields may be one of reported
, confirmed
, in_progress
,
pending
, or resolved
.
Resolution fields may be one of unresolved
, fixed
, implemented
,
wont_fix
, by_design
, invalid
, duplicate
, or not_our_bug
.
Permissions may be one or more of browse
, submit
, comment
, edit
, and
triage
. If null, the permissions are inherited from the tracker.
Short form:
{
"id": integer,
"ref": "string",
"tracker": { short-form tracker resource }
}
{
"owner": { short-form user resource },
"created": "timestamp",
"updated": "timestamp",
"name": "string",
"description": "string (markdown)",
"default_permissions": {
"anonymous": [ ...list of permissions... ],
"submitter": [ ...list of permissions... ],
"user": [ ...list of permissions... ]
}
}
Permissions may be one or more of browse
, submit
, comment
, edit
, and
triage
.
Short form:
{
"owner": { short-form user resource },
"created": "timestamp",
"updated": "timestamp",
"name": "string",
}
Note: usernames are prefixed with ~
.
Retrieves a user resource.
Equivalent to /api/user/:username, implies the authenticated user.
List of tracker resources owned by this user.
OAuth scope: trackers:read
Equivalent to /api/user/:username/trackers, implies the authenticated user.
OAuth scope: trackers:read
Creates a new tracker resource.
OAuth scope: trackers:write
Request body
{
"name": "tracker name",
"description": "tracker description (markdown)" (optional)
}
Response
The new tracker resource
Retrieves a tracker resource.
OAuth scope: trackers:read
Equivalent to /api/user/:username/trackers/:tracker-name, implies the authenticated user.
OAuth scope: trackers:read
Updates a tracker resource.
{
"description": "tracker description (markdown)" (optional)
}
OAuth scope: trackers:write
Equivalent to /api/user/:username/trackers/:tracker-name, implies the authenticated user.
OAuth scope: trackers:write
Deletes a tracker resource.
OAuth scope: trackers:write
Equivalent to /api/user/:username/trackers/:tracker-name, implies the authenticated user.
OAuth scope: trackers:write
List of label resources associated with this tracker.
OAuth scope: trackers:read
Equivalent to /api/:username/trackers/:tracker-name/labels, implies the authenticated user.
OAuth scope: trackers:read
List of ticket resources associated with this tracker.
OAuth scope: tickets:read
Equivalent to /api/user/:username/trackers/:tracker-name/tickets, implies the authenticated user.
OAuth scope: tickets:read
Creates a new ticket resources associated with this tracker.
OAuth scope: tickets:write
Request body
{
"title": "ticket title",
"description": "ticket description (markdown)" (optional)
}
Response
The new ticket resource
Equivalent to /api/user/:username/trackers/:tracker-name/tickets, implies the authenticated user.
OAuth scope: tickets:write
Retrieves a ticket resource.
OAuth scope: tickets:read
Equivalent to /api/user/:username/trackers/:tracker-name/tickets/:ticket-id, implies the authenticated user.
OAuth scope: tickets:read
Updates a ticket resource. This endpoint is used to:
OAuth scope: tickets:write
Request body
{
"comment": "comment text (markdown)" (optional),
"status": "ticket status enum" (optional),
"resolution": "ticket resolution enum" (optional),
"labels": ["list of desired label names"] (optional)
}
Ticket status enum
One of:
reported
confirmed
in_progress
pending
resolved
Ticket resolution enum
One of:
unresolved
fixed
implemented
wont_fix
by_design
invalid
duplicate
not_our_bug
Response
{
"ticket": { affected ticket resource },
"events": [
list of event resources created by this update
]
}
Equivalent to /api/user/:username/trackers/:tracker-name/tickets/:ticket-id, implies the authenticated user.
OAuth scope: tickets:write
List of event resources associated with this ticket.
OAuth scope: tickets:read
Equivalent to /api/user/:username/trackers/:tracker-name/tickets/:ticket-id/events, implies the authenticated user.
OAuth scope: tickets:read
Edits a comment. Note that the comment ID is required, not the event ID.
Request body
{
"text": "new comment text (markdown)"
}
OAuth scope: tickets:write
Equivalent to /api/user/:username/trackers/:tracker-name/tickets/:ticket-id/comments/:comment-id, implies the authenticated user.
OAuth scope: tickets:write
Webhook for user events. Includes the standard webhook endpoints
Issued when the user creates a new tracker.
OAuth scope: trackers:read
Request body
The new tracker resource.
Issued when the user updates a tracker.
OAuth scope: trackers:read
Request body
The affected tracker resource.
Issued when the user deletes a tracker.
OAuth scope: trackers:read
Request body
{
"id": the affected tracker ID
}
Issued when the user creates a new ticket.
OAuth scope: tickets:read
Request body
The new ticket resource.
Issued when a new event is created for a ticket on this tracker.
OAuth scope: tickets:read
Request body
The new event resource.
Webhook for tracker events. Includes the standard webhook endpoints
Issued when a new label is added to this tracker.
OAuth scope: trackers:read
Request body
The new label resource.
Issued when a label is removed from this tracker.
OAuth scope: trackers:read
Request body
{
"id": affected label ID
}
Issued when a ticket is created for this tracker.
OAuth scope: tickets:read
Request body
The new ticket resource.
Webhook for ticket events. Includes the standard webhook endpoints
Issued when this tickets details are updated.
OAuth scope: tickets:read
Request body
The updated ticket resource.
Issued when a new event is created for this this ticket.
OAuth scope: tickets:read
Request body
The new event resource.
commit 64dd454d025e91c76405cd1d04f51ea8e7a4f6a7 Author: wheezard <90904039+wheezard@users.noreply.github.com> Date: 2024-09-07T05:46:36+04:00 man: fixed a typo (missing closing parenthesis)