hub.sr.ht API Documentation
This is the GraphQL API documentation for the SourceHut service hub.sr.ht. It was generated from the service's GraphQL Schema definition.
To get started, also check out SourceHut's general GraphQL API conventions or try hub.sr.ht's GraphQL playground.
Queries
mailingList
@access(scope:LISTS, kind:RO)Looks up a specific mailing list
Returns MailingList
Argumentsrid- ID!
Example Query
query mailingList($rid: ID!) {
mailingList(rid: $rid) {
rid
linked
updated
owner {
...Entity
}
name
description
visibility
projects {
...ProjectCursor
}
}
}
me
@access(scope:PROFILE, kind:RO)Returns the authenticated user
Returns User!
Example Query
query me {
me {
id
canonicalName
username
project {
...Project
}
projects {
...ProjectCursor
}
}
}
project
@access(scope:PROJECTS, kind:RO)Looks up a specific project
Returns Project
Argumentsrid- ID!
Example Query
query project($rid: ID!) {
project(rid: $rid) {
rid
created
updated
ownerId
owner {
...Entity
}
name
description
website
visibility
checklistComplete
summaryRepoId
tags
mailingLists {
...MailingListCursor
}
sources {
...SourceRepoCursor
}
trackers {
...TrackerCursor
}
readme {
...SourceRepo
}
resource {
...ProjectResource
}
mailingList {
...MailingList
}
source {
...SourceRepo
}
tracker {
...Tracker
}
}
}
projects
@access(scope:PROJECTS, kind:RO)List all public projects
Returns ProjectCursor!
Argumentscursor- Cursor
Example Query
query projects($cursor: Cursor) {
projects(cursor: $cursor) {
results {
...Project
}
cursor
}
}
resource
@access(scope:PROJECTS, kind:RO)Looks up a specific resource
Returns ProjectResource
Argumentsrid- ID!
Example Query
query resource($rid: ID!) {
resource(rid: $rid) {
rid
linked
updated
owner {
...Entity
}
name
description
visibility
projects {
...ProjectCursor
}
}
}
source
@access(scope:SOURCES, kind:RO)Looks up a specific source repository
Returns SourceRepo
Argumentsrid- ID!
Example Query
query source($rid: ID!) {
source(rid: $rid) {
rid
linked
updated
owner {
...Entity
}
name
description
repoType
visibility
projects {
...ProjectCursor
}
}
}
tracker
@access(scope:TRACKERS, kind:RO)Looks up a specific tracker
Returns Tracker
Argumentsrid- ID!
Example Query
query tracker($rid: ID!) {
tracker(rid: $rid) {
rid
linked
updated
owner {
...Entity
}
name
description
visibility
projects {
...ProjectCursor
}
}
}
user
@access(scope:PROFILE, kind:RO)Looks up a specific user
Returns User
Argumentsusername- String!
Example Query
query user($username: String!) {
user(username: $username) {
id
canonicalName
username
project {
...Project
}
projects {
...ProjectCursor
}
}
}
version
Returns API version information.
Returns Version!
Example Query
query version {
version {
major
minor
patch
buildVersion
buildDate
deprecationDate
features {
...Features
}
}
}
Mutations
createProject
@access(scope:PROJECTS, kind:RW)Creates a new project.
Returns Project
Argumentsname- String!visibility- Visibility!description- Stringtags- [String]
Example Query
mutation createProject($name: String!, $visibility: Visibility!, $description: String, $tags: [String!]) {
createProject(name: $name, visibility: $visibility, description: $description, tags: $tags) {
rid
created
updated
ownerId
owner {
...Entity
}
name
description
website
visibility
checklistComplete
summaryRepoId
tags
mailingLists {
...MailingListCursor
}
sources {
...SourceRepoCursor
}
trackers {
...TrackerCursor
}
readme {
...SourceRepo
}
resource {
...ProjectResource
}
mailingList {
...MailingList
}
source {
...SourceRepo
}
tracker {
...Tracker
}
}
}
deleteProject
@access(scope:PROJECTS, kind:RW)Deletes an existing project.
Returns Project
Argumentsrid- ID!
Example Query
mutation deleteProject($rid: ID!) {
deleteProject(rid: $rid) {
rid
created
updated
ownerId
owner {
...Entity
}
name
description
website
visibility
checklistComplete
summaryRepoId
tags
mailingLists {
...MailingListCursor
}
sources {
...SourceRepoCursor
}
trackers {
...TrackerCursor
}
readme {
...SourceRepo
}
resource {
...ProjectResource
}
mailingList {
...MailingList
}
source {
...SourceRepo
}
tracker {
...Tracker
}
}
}
deleteUser
Deletes the authenticated user's account. Internal use only.
Returns Int!
Example Query
mutation deleteUser {
deleteUser
}
linkMailingList
@access(scope:PROJECTS, kind:RW)Links an existing mailing list to a project.
Returns MailingList
ArgumentsExample Query
mutation linkMailingList($projectID: ID!, $listID: ID!) {
linkMailingList(projectID: $projectID, listID: $listID) {
rid
linked
updated
owner {
...Entity
}
name
description
visibility
projects {
...ProjectCursor
}
}
}
linkSource
@access(scope:PROJECTS, kind:RW)Links an existing source repository to a project.
Returns SourceRepo
ArgumentsExample Query
mutation linkSource($projectID: ID!, $sourceRepoID: ID!) {
linkSource(projectID: $projectID, sourceRepoID: $sourceRepoID) {
rid
linked
updated
owner {
...Entity
}
name
description
repoType
visibility
projects {
...ProjectCursor
}
}
}
linkTracker
@access(scope:PROJECTS, kind:RW)Links an existing tracker to a project.
Returns Tracker
ArgumentsExample Query
mutation linkTracker($projectID: ID!, $trackerID: ID!) {
linkTracker(projectID: $projectID, trackerID: $trackerID) {
rid
linked
updated
owner {
...Entity
}
name
description
visibility
projects {
...ProjectCursor
}
}
}
unlinkMailingList
@access(scope:PROJECTS, kind:RW)Unlinks an existing mailing list from a project.
Returns MailingList
ArgumentsExample Query
mutation unlinkMailingList($projectID: ID!, $listID: ID!) {
unlinkMailingList(projectID: $projectID, listID: $listID) {
rid
linked
updated
owner {
...Entity
}
name
description
visibility
projects {
...ProjectCursor
}
}
}
unlinkSource
@access(scope:PROJECTS, kind:RW)Unlinks an existing source repository from a project.
Returns SourceRepo
ArgumentsExample Query
mutation unlinkSource($projectID: ID!, $sourceRepoID: ID!) {
unlinkSource(projectID: $projectID, sourceRepoID: $sourceRepoID) {
rid
linked
updated
owner {
...Entity
}
name
description
repoType
visibility
projects {
...ProjectCursor
}
}
}
unlinkTracker
@access(scope:PROJECTS, kind:RW)Unlinks an existing tracker from a project.
Returns Tracker
ArgumentsExample Query
mutation unlinkTracker($projectID: ID!, $trackerID: ID!) {
unlinkTracker(projectID: $projectID, trackerID: $trackerID) {
rid
linked
updated
owner {
...Entity
}
name
description
visibility
projects {
...ProjectCursor
}
}
}
updateProject
@access(scope:PROJECTS, kind:RW)Updates an existing project.
Returns Project
Argumentsrid- ID!input- ProjectInput!
Example Query
mutation updateProject($rid: ID!, $input: ProjectInput!) {
updateProject(rid: $rid, input: $input) {
rid
created
updated
ownerId
owner {
...Entity
}
name
description
website
visibility
checklistComplete
summaryRepoId
tags
mailingLists {
...MailingListCursor
}
sources {
...SourceRepoCursor
}
trackers {
...TrackerCursor
}
readme {
...SourceRepo
}
resource {
...ProjectResource
}
mailingList {
...MailingList
}
source {
...SourceRepo
}
tracker {
...Tracker
}
}
}
Definitions
AccessKind
RORW
AccessScope
PROFILEPROJECTSLISTSSOURCESTRACKERS
Boolean
The Boolean scalar type represents true or false.
Cursor
Entity
canonicalName- String!
Features
Describes the status of optional features
FieldsFloat
The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.
ID
A unique identifier representing a resource available via the API, represented as an arbitrary, opaque string. These IDs are guaranteed to remain stable as a resource is renamed, moved between owners, etc. Often referred to as a "resource ID" or "rid".
Int
The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
MailingList
rid- ID!linked- Time!updated- Time!owner- Entity!@access(scope:PROFILE, kind:RO)
name- String!description- Stringvisibility- Visibility!projects(cursor: Cursor)- ProjectCursor!
MailingListCursor
results- [MailingList]!cursor- Cursor
Project
rid- ID!created- Time!updated- Time!ownerId- Int!owner- Entity!@access(scope:PROFILE, kind:RO)
name- String!description- Stringwebsite- Stringvisibility- Visibility!checklistComplete- Boolean!summaryRepoId- Inttags- [String]!mailingLists(cursor: Cursor)- MailingListCursor!@access(scope:LISTS, kind:RO)
sources(cursor: Cursor)- SourceRepoCursor!@access(scope:SOURCES, kind:RO)
trackers(cursor: Cursor)- TrackerCursor!@access(scope:TRACKERS, kind:RO)
readme- SourceRepo@access(scope:SOURCES, kind:RO)
resource(rid: ID!)- ProjectResource@access(scope:LISTS, kind:RO)
mailingList(name: String!)- MailingList@access(scope:LISTS, kind:RO)
source(name: String!)- SourceRepo@access(scope:SOURCES, kind:RO)
tracker(name: String!)- Tracker@access(scope:TRACKERS, kind:RO)
ProjectCursor
ProjectInput
ProjectResource
Fieldsrid- ID!linked- Time!updated- Time!owner- Entity!@access(scope:PROFILE, kind:RO)
name- String!description- Stringvisibility- Visibility!projects(cursor: Cursor)- ProjectCursor!
RepoType
GITHG
SourceRepo
SourceRepoCursor
results- [SourceRepo]!cursor- Cursor
String
The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
Time
String of the format %Y-%m-%dT%H:%M:%SZ
Tracker
rid- ID!linked- Time!updated- Time!owner- Entity!@access(scope:PROFILE, kind:RO)
name- String!description- Stringvisibility- Visibility!projects(cursor: Cursor)- ProjectCursor!
TrackerCursor
Upload
A file uploaded alongside the GraphQL request. This API is compatible with the multipart request specification for requests that include uploads:
https://github.com/jaydenseric/graphql-multipart-request-spec
User
Version
major- Int!minor- Int!patch- Int!buildVersion- String!buildDate- String!deprecationDate- Time- If this API version is scheduled for deprecation, this is the date on which it will stop working; or null if this API version is not scheduled for deprecation.
features- Features!- Optional features
Visibility
PUBLICUNLISTEDPRIVATE
Directives
@access
Decorates fields for which access requires a particular OAuth 2.0 scope with read or write access.
Argumentsscope- AccessScope!kind- AccessKind!
@defer
Directs the executor to defer this fragment when the if argument is true or undefined.
@deprecated
Marks an element of a GraphQL schema as no longer supported.
Argumentsreason- String- Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).
@include
Directs the executor to include this field or fragment only when the if argument is true.
if- Boolean!- Included when true.
@internal
This is used to decorate fields which are for internal use, and are not available to normal API users.
@oneOf
Indicates exactly one field must be supplied and this field must not be null.
@scopehelp
Used to provide a human-friendly description of an access scope
Argumentsdetails- String!
@skip
Directs the executor to skip this field or fragment when the if argument is true.
if- Boolean!- Skipped when true.
@specifiedBy
Exposes a URL that specifies the behavior of this scalar.
Argumentsurl- String!- The URL that specifies the behavior of this scalar.