NOTICE: This is the documentation for the legacy REST API. It is being replaced with the GraphQL API.
The lists.sr.ht API allows you to browse, create, and subscribe to mailing lists on lists.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 lists.sr.ht:
{
"id": integer,
"created": "timestamp",
"subject": "message subject",
"message_id": "value of the Message-ID header",
"parent_id": integer or null,
"thread_id": integer,
"list": { short form list resource },
"sender": { short form user resource } or null,
"is_patch": boolean,
"is_request_pull": boolean,
"replies": integer,
"participants": integer,
"envelope": "original email"
}
Notes
is_patch
, is_request_pull
, replies
, participants
,
and envelope
.{
"created": "timestamp",
"updated": "timestamp",
"name": "name of this list",
"owner": { short form user resource },
"description": "list description (markdown)",
"permissions": {
"nonsubscriber": [ list of permissions ],
"subscriber": [ list of permissions ],
"account": [ list of permissions ]
}
}
Notes
permissions
field are "browse",
"reply", and "post".{
"id": integer,
"created": "timestamp",
"list": { short form list resource }
}
{
"id": integer,
"created": "timestamp",
"updated": "timestamp",
"subject": "patchset subject",
"prefix": "subject prefix",
"version": integer,
"status": "patchset status enum",
"list": { short form list resource },
"cover_letter": { short form email resource } or null,
"superseded_by": { short form patchset resource } or null
}
Notes
proposed
, needs_revision
, superseded
,
approved
, rejected
, or applied
.[PATCH foobar] Add foo to bar
, is
"foobar".Note: in all routes, :username
may be substituted with an email address,
and :email-id
may be the email's either of the "id" or "message_id" values.
Retrieves a user resource.
Equivalent to /api/user/:username, implies the authenticated user.
List of email resources received from this user.
OAuth scope: emails:read
Equivalent to /api/user/:username/emails, implies the authenticated user.
OAuth scope: emails:read
Retrieves an email resource.
OAuth scope: emails:read
Equivalent to GET /api/emails/:email-id; username
is
discarded.
OAuth scope: emails:read
Retrieves an array of each email implicated in the thread identified by its
first message's :email-id
.
OAuth scope: emails:read
Response
[
{ short form email resource },
...
]
Equivalent to GET /api/thread/:email-id; username
is
discarded.
OAuth scope: emails:read
List of mailing list resources owned by this user.
OAuth scope: lists:read
Equivalent to /api/user/:username/lists, implies the authenticated user.
OAuth scope: lists:read
Creates a new mailing list resource.
OAuth scope: lists:write
Request body
{
"name": "mailing list name",
"description": "mailing list description (markdown)" (optional)
}
Response
The new mailing list resource.
Retrieves a mailing list resource.
OAuth scope: lists:read
Equivalent to /api/user/:username/lists/:list-name, implies the authenticated user.
OAuth scope: lists:read
Updates a mailing list resource.
OAuth scope: lists:write
Request body
{
"description": "mailing list description (markdown)" (optional)
}
Response
The updated mailing list resource.
Deletes a mailing list resource.
OAuth scope: lists:write
Request body
None
Response
None
List of email resources posted to this list.
OAuth scope: lists:read
Equivalent to /api/user/:username/lists/:list-name/posts, implies the authenticated user.
OAuth scope: lists:read
List of patchset resources posted to this list.
OAuth scope: patches:read
Equivalent to /api/user/:username/lists/:list-name/patchsets, implies the authenticated user.
OAuth scope: patches:read
Retrieves a patchset resource.
OAuth scope: patches:read
Equivalent to /api/user/:username/lists/:list-name/patchsets/:id, implies the authenticated user.
OAuth scope: patches:read
Updates a patchset resource.
OAuth scope: patches:write
Request body
{
"status": "patchset status enum" (optional)
}
Response
The updated patchset resource.
Equivalent to /api/user/:username/lists/:list-name/patchsets/:id, implies the authenticated user.
OAuth scope: patches:write
Sets the status of a "tool" which is processing this patch, used for example to indicate the status of continous integration for a change.
Request body
{
"icon": "icon status enum",
"details": "user-friendly details, markdown",
"key": "arbitrary string"
}
"icon" shall be one of the following strings:
"details" supports a subset of Markdown, including only bold and italic styles, inline code, and links. It must be no more than one line of text.
"key" is an arbitrary string used to uniquely identify this tool. You may update the status of your tool later by providing the same key in a new PUT request.
OAuth scope: patches:write
List of email resources making up the set of patches included in this patchset.
OAuth scope: patches:read
Equivalent to /api/user/:username/lists/:list-name/patchsets/:id/patches, implies the authenticated user.
OAuth scope: patches:read
List of subscription resources
OAuth scope: subs:read
Create a new subscription resource
OAuth scope: subs:write
Request body
{
"list": "~owner/list-name"
}
Response
The new subscription resource.
Retrieves a subscription resource.
OAuth scope: subs:read
Deletes this subscription resource.
OAuth scope: subs:write
Webhook for user events. Includes the standard webhook endpoints
Issued when lists.sr.ht receives an email from this user.
OAuth scope: emails:read
Request body
The new email resource.
Issued when the user creates a new mailing list.
OAuth scope: lists:read
Request body
The new mailing list resource.
Webhook for mailing list events. Includes the standard webhook endpoints
Issued when a complete patchset is received.
OAuth scope: patches:read
Request body
The new patchset resource.
Issued when a new email is posted to this list.
OAuth scope: lists:read
Request body
The new email resource.
Issued when the list details are updated.
OAuth scope: lists:read
Request body
The updated mailing list resource.
commit 23592fd3f703a0d04a7ab6cf5b00ccaf027bf577 Author: Gary Kim <gary@garykim.dev> Date: 2024-11-30T00:14:06-05:00 builds.sr.ht: fedora: remove EOL versions