Skip to main content
The Shipyard REST API lets you manage projects, trigger and inspect builds, fetch deployments, and interact with the CI/CD pipeline programmatically. All API endpoints are mounted under the /api prefix, with the exception of the /health route.

Base URL

http://localhost:8080
Replace localhost:8080 with your server’s address when deploying to a VPS or using a tunnel. All REST endpoints follow the pattern http://<your-server>/api/<resource>.

Authentication

Most endpoints require a JSON Web Token (JWT) issued after completing the GitHub OAuth flow. Pass the token as a Bearer credential in the Authorization header:
Authorization: Bearer <token>
The token is validated on every request by the isAuth middleware. If the header is missing, malformed, or the token is expired, the server responds with 401.
Two endpoint groups do not require a JWT: the /api/auth routes (which are part of the OAuth flow itself) and the /health and /api utility routes. The webhook endpoint uses HMAC-SHA256 signature verification instead of JWT — see the Webhook page for details.

Endpoints

All endpoints return JSON. The tables below list every route, whether it requires authentication, and a short description.

Auth

MethodEndpointAuthDescription
GET/api/auth/githubNoRedirects the browser to GitHub’s OAuth authorization page
GET/api/auth/github/callbackNoHandles the OAuth callback, exchanges the code for a token, and redirects to the frontend with a JWT

Repos

MethodEndpointAuthDescription
GET/api/repo/orgsJWTFetches the authenticated user’s GitHub organizations plus their personal account
GET/api/repo/reposJWTLists repositories for a given organization or personal account

Projects

MethodEndpointAuthDescription
POST/api/projectJWTCreates a project and registers a GitHub webhook on the target repo
GET/api/project/projectsJWTReturns all projects belonging to the authenticated user, including their builds and deployments
PUT/api/project/projects/:projectIdJWTUpdates project settings (branch, build command, install command, etc.)
DELETE/api/project/projects/:projectIdJWTDeletes a project and removes the associated GitHub webhook
DELETE/api/project/secret/:secretIdJWTDeletes a single encrypted secret by ID

Builds

MethodEndpointAuthDescription
POST/api/build/rebuild/:buildIdJWTRe-runs the build from the commit associated with an existing build record
GET/api/build/:buildIdJWTFetches a single build record including its logs and status

Deployments

MethodEndpointAuthDescription
GET/api/deploy/deployments/:deploymentIdJWTFetches a single deployment record
PUT/api/deploy/rollbackJWTRolls back to a previous deployment by re-running its build

Webhook

MethodEndpointAuthDescription
POST/api/webhookHMAC-SHA256Receives GitHub push events and triggers a build

Health

MethodEndpointAuthDescription
GET/healthNoReturns { "message": "OK" } — use for uptime monitoring
GET/apiNoReturns a welcome message confirming the API is reachable

Error responses

All error responses follow a consistent JSON shape:
{
  "message": "A human-readable error description",
  "data": [...]
}
The data field is optional and typically contains validation errors from express-validator when a request body fails validation. Common HTTP status codes:
CodeMeaning
400Bad request — missing or invalid fields
401Unauthorized — JWT is missing, expired, or invalid
500Internal server error — unexpected failure

Explore by resource

Auth

GitHub OAuth flow and JWT issuance

Repos

Browse GitHub organizations and repositories

Projects

Create, update, and delete connected projects

Builds

Trigger rebuilds and inspect build records

Deployments

Fetch deployments and roll back to earlier versions

Webhook

GitHub push event signature verification and build triggering

Build docs developers (and LLMs) love