NexosNexos

API Reference

Everything you can do in the dashboard you can do with the API. Create projects, trigger deploys, manage nodes, rotate secrets — all with a single bearer token. Use it to build CI bots, Slack integrations, or whatever else fits your workflow.

All endpoints accept and return JSON. The base URL for the hosted service is https://api.nexos.dev/api.

Authentication

Nexos supports two authentication methods:

JWT Cookies

The web dashboard authenticates via GitHub OAuth and receives a JWT stored in an HTTP-only cookie. This is handled automatically when using the dashboard.

API Keys

For programmatic access, create an API key from Settings > API Keys in the dashboard. API keys are prefixed with nxs_ and sent via the Authorization header:

curl https://api.nexos.dev/api/projects \
  -H "Authorization: Bearer nxs_your_api_key_here"

API keys are hashed with bcrypt before storage. The plaintext key is shown only once at creation time. If you lose it, you must generate a new one.

Endpoints

Authentication

MethodPathDescription
GET/auth/githubRedirect to GitHub OAuth flow
GET/auth/github/callbackHandle GitHub OAuth callback
GET/auth/meGet current authenticated user
POST/auth/api-keysCreate a new API key
GET/auth/api-keysList API keys (masked)
DELETE/auth/api-keys/:idRevoke an API key

Projects

MethodPathDescription
GET/projectsList all projects
POST/projectsCreate a new project
GET/projects/:idGet project details
PATCH/projects/:idUpdate project settings
DELETE/projects/:idDelete a project and all environments

Deployments & Environments

MethodPathDescription
GET/projects/:id/environmentsList environments for a project
GET/environments/:idGet environment details
POST/environments/:id/rebuildRebuild environment from the latest commit (alias: /restart)
POST/environments/:id/pauseStop every container; also stops shared Postgres/Redis when this is the last active environment
POST/environments/:id/resumeStart previously-paused containers (no rebuild)
POST/environments/:id/resetReset the environment's database to an empty state
POST/environments/:id/destroyDestroy environment
GET/deployments/:idGet deployment details
GET/deployments/:id/logsGet build logs

Environment Variables

MethodPathDescription
GET/projects/:id/env-varsList environment variables (masked values)
PUT/projects/:id/env-varsCreate or update an environment variable
DELETE/projects/:id/env-vars/:varIdDelete an environment variable

Nodes

MethodPathDescription
GET/nodesList registered nodes
POST/nodes/join-tokenGenerate a node join token
GET/nodes/:idGet node details and status
DELETE/nodes/:idRemove a node from the network

Quotas

MethodPathDescription
GET/quotaGet current resource usage and quota limits

Webhooks

MethodPathDescription
POST/webhooks/githubGitHub webhook receiver (push and delete events)

Request and Response Examples

Create a Project

POST /api/projects
Content-Type: application/json
Authorization: Bearer nxs_your_api_key

{
  "name": "my-app",
  "github_repo": "octocat/my-app",
  "dockerfile": "Dockerfile",
  "build_context": ".",
  "services": {
    "postgres": true,
    "redis": true,
    "s3": false
  }
}

Response:

{
  "id": "proj_abc123",
  "name": "my-app",
  "slug": "my-app",
  "github_repo": "octocat/my-app",
  "dockerfile": "Dockerfile",
  "build_context": ".",
  "services": {
    "postgres": true,
    "redis": true,
    "s3": false
  },
  "created_at": "2026-04-10T12:00:00Z"
}

Get Quota Usage

GET /api/quota
Authorization: Bearer nxs_your_api_key

Response:

{
  "plan": "pro",
  "usage": {
    "projects": 12,
    "total_cpu": 14.5,
    "total_memory_mb": 29696,
    "build_minutes_used": 2340
  },
  "limits": {
    "max_projects": 25,
    "max_cpu": 64,
    "max_memory_mb": 131072,
    "build_minutes": 5000
  }
}