The meta.sr.ht API allows you to view and edit user information on meta.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 meta.sr.ht:
meta.sr.ht expands on the standard user resource.
{
"canonical_name": "~username",
"name": "username",
"email": "email",
"url": "url" or null,
"location": "location" or null,
"bio": "bio" or null,
"use_pgp_key": pgp key resource ID
}
GET /api/user/pgp-keys/:id
.{
"id": integer,
"ip": "IP address",
"action": "event type",
"details": "event details",
"created": "timestamp"
}
{
"id": integer,
"authorized": "timestamp",
"comment": "SSH key comment",
"fingerprint": "SSH key fingerprint",
"key": "SSH key (authorized_keys format)",
"owner": short-form user resource,
"last_used": "timestamp"
}
{
"id": integer,
"key": "armored PGP key",
"key_id": "PGP key fingerprint",
"email": "First email found in the PGP key",
"authorized": "timestamp",
"owner": short-form user resource
}
Returns the authenticated user's user resource.
OAuth scope: profile:read
Updates the authenticated user's profile.
OAuth scope: profile:write
Request body
{
"url": "url" or null, (optional)
"location": "location" or null, (optional)
"bio": "bio" or null, (optional)
"email": "email" (optional)
}
Response
Updated user resource.
Notes
List of audit log entry resources.
OAuth scope: audit-log:read
List of SSH key resources.
OAuth scope: keys:read
Creates a new SSH key resource.
OAuth scope: keys:write
Request body
{
"ssh-key": "SSH key (authorized_keys format)"
}
Response
The new SSH key resource.
Retrieves an SSH key resource.
OAuth scope: keys:read
Updates the "last_used" time of this SSH key resource.
OAuth scope: keys:read
Response
The updated SSH key resource.
Deletes this SSH key resource.
OAuth scope: keys:write
List of PGP key resources.
OAuth scope: keys:read
Creates a new PGP key resource.
OAuth scope: keys:write
Request body
{
"pgp-key": "armored PGP key"
}
Response
The new PGP key resource.
Retrieves a PGP key resource.
OAuth scope: keys:read
Deletes this PGP key resource.
OAuth scope: keys:write
Webhook for user events. Includes the standard webhook endpoints
Issued when the user's profile (bio, email, etc) is updated.
OAuth scope: profile:read
Request body
The updated user resource.
Issued when the user adds an SSH key to their account.
OAuth scope: keys:read
Request body
The new SSH key resource.
Issued when the user removes an SSH key from their account.
OAuth scope: keys:read
Request body
{
"id": integer ID of the affected SSH key resource
}
Issued when the user adds a PGP key to their account.
OAuth scope: keys:read
Request body
The new PGP key resource.
Issued when the user removes a PGP key from their account.
OAuth scope: keys:read
Request body
{
"id": integer ID of the affected PGP key 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)