Skip to content

Quests API

The Quests API allows you to interact with bounties and their associated issues. This API is generated by PayloadCMS and uses cookie-based authentication.

Authentication

While reading quests is public, authentication is required for certain operations.

Endpoints

List Quests

http
GET /api/quests

Retrieve a list of all quests. This endpoint is publicly accessible.

Query Parameters

ParameterTypeDescription
pagenumberPage number for pagination
limitnumberNumber of items per page
whereobjectFilter criteria
sortstringSort field and direction

Example Request

http
GET /api/quests?where[issue.status][equals]=open&sort=-createdAt

Response

json
{
  "docs": [{
    "id": "quest_123",
    "organization": "org-name",
    "repository": "repo-name",
    "tags": [{
      "tag": {
        "id": "tag_123",
        "name": "bug"
      }
    }],
    "issue": {
      "number": 42,
      "title": "Fix Memory Leak",
      "status": "open",
      "creator": {
        "username": "user123",
        "avatarUrl": "https://github.com/..."
      }
    },
    "bounties": [{
      "paymentEvent": {
        "amount": 5000,
        "status": "completed"
      }
    }],
    "workingOn": [{
      "user": {
        "id": "user_123",
        "githubUsername": "contributor"
      },
      "status": "active",
      "statusLastUpdated": "2024-01-15T00:00:00Z"
    }]
  }],
  "totalDocs": 100,
  "page": 1,
  "totalPages": 10,
  "hasNextPage": true,
  "hasPrevPage": false
}

Get Quest

http
GET /api/quests/:id

Retrieve a specific quest by its ID. This endpoint is publicly accessible.

Response

Returns a single quest object with the same structure as in the list response.

Error Responses

json
{
  "errors": [{
    "message": "Quest not found"
  }]
}

Common error codes:

  • 404 - Quest not found
  • 400 - Invalid query parameters