Skip to content

API Reference

The Oore server exposes a REST API for managing repositories, builds, and integrations.

Base URL

http://localhost:8080/api

In production, configure BASE_URL to your public domain.

Authentication

Protected endpoints require an admin token:

Authorization: Bearer YOUR_ADMIN_TOKEN

Health & Status

GET /api/health

Terminal window
curl http://localhost:8080/api/health
{"status": "ok"}

GET /api/version

{"name": "oored", "version": "0.1.0"}

GET /api/setup/status

Requires admin token.

{
"github": {
"configured": true,
"app_name": "my-oore-app",
"installations_count": 2
},
"gitlab": [{
"configured": true,
"instance_url": "https://gitlab.com",
"username": "myuser"
}],
"encryption_configured": true,
"admin_token_configured": true
}

Repositories

GET /api/repositories

List all repositories.

[{
"id": "01HNJX5Q9T3WP2V6Z8K4M7YRBF",
"name": "my-flutter-app",
"provider": "github",
"owner": "myorg",
"repo_name": "my-app",
"clone_url": "https://github.com/myorg/my-app.git",
"default_branch": "main",
"is_active": true,
"created_at": "2024-01-15T10:30:00Z"
}]

POST /api/repositories

Create a repository.

FieldTypeRequiredDescription
providerstringYesgithub or gitlab
ownerstringYesOwner name
repo_namestringYesRepository name
namestringNoDisplay name
default_branchstringNoDefault: main
webhook_secretstringNoGitLab only
github_repository_idnumberNoGitHub repository ID
github_installation_idnumberNoGitHub App installation ID
gitlab_project_idnumberNoGitLab project ID

GET /api/repositories/:id

Get a repository.

PUT /api/repositories/:id

Update a repository.

FieldTypeRequiredDescription
namestringNoDisplay name
default_branchstringNoDefault branch
is_activebooleanNoActive status
webhook_secretstringNoGitLab webhook secret (re-hashed)
github_installation_idnumberNoGitHub App installation ID
gitlab_project_idnumberNoGitLab project ID

DELETE /api/repositories/:id

Delete a repository.

GET /api/repositories/:id/webhook-url

Get webhook URL for provider configuration.

{
"webhook_url": "https://ci.example.com/api/webhooks/github",
"provider": "github"
}

POST /api/repositories/:id/trigger

Trigger a build.

{
"branch": "develop",
"commit_sha": "abc1234567890"
}

Both fields are optional.


Builds

GET /api/builds

List builds. Optional ?repo=<ID> filter.

[{
"id": "01HNJX9P2K4TM8Q6V5W3Y7ZRAD",
"repository_id": "01HNJX5Q9T3WP2V6Z8K4M7YRBF",
"commit_sha": "abc1234...",
"branch": "main",
"trigger_type": "webhook",
"status": "running",
"started_at": "2024-01-15T10:35:02Z",
"created_at": "2024-01-15T10:35:00Z"
}]

Statuses: pending, running, success, failed, cancelled

Triggers: webhook, manual

GET /api/builds/:id

Get a build.

POST /api/builds/:id/cancel

Cancel a running build.


Webhooks

POST /api/webhooks/github

Receive GitHub webhooks.

Headers:

  • X-Hub-Signature-256: HMAC-SHA256 signature
  • X-GitHub-Event: Event type
  • X-GitHub-Delivery: Delivery ID

POST /api/webhooks/gitlab/:repo_id

Receive GitLab webhooks.

Headers:

  • X-Gitlab-Token: Secret token
  • X-Gitlab-Event: Event type

GET /api/webhooks/events

List webhook events.

GET /api/webhooks/events/:id

Get webhook event with payload.


GitHub Integration

MethodPathAuthDescription
GET/api/github/manifestYesGet manifest and creation URL
POST/api/github/callbackYesExchange code for credentials
GET/api/github/appYesGet current App configuration
DELETE/api/github/appYesRemove App credentials (requires ?force=true)
GET/api/github/installationsYesList installations
POST/api/github/syncYesSync installations and repos from GitHub

GitLab Integration

MethodPathAuthDescription
POST/api/gitlab/connectYesInitiate OAuth flow
POST/api/gitlab/callbackYesExchange code for credentials
GET/api/gitlab/credentialsYesList all credentials
DELETE/api/gitlab/credentials/:idYesRemove credentials (requires ?force=true)
GET/api/gitlab/projectsYesList accessible projects
PUT/api/gitlab/projects/:id/enabledYesEnable CI for project
DELETE/api/gitlab/projects/:id/enabledYesDisable CI for project
POST/api/gitlab/refreshYesRefresh OAuth token
POST/api/gitlab/appsYesRegister OAuth app for self-hosted GitLab

Error Responses

{"error": "Repository not found"}
CodeDescription
400Invalid request
401Unauthorized
404Not found
500Server error

Webhook Security

GitHub

HMAC-SHA256 signature in X-Hub-Signature-256:

sha256=<hex-signature>

GitLab

Secret token in X-Gitlab-Token. Oore stores HMAC hash, not plaintext.