Skip to content

Authentication ​

NukeVideo uses Laravel Sanctum for API authentication. The admin panel authenticates with a session cookie; everything else sends a Bearer token — a personal API token or a project API key.

There is no self-registration endpoint: accounts are created by an administrator through POST /api/users. The one exception is the first account, created through setup while the instance has no user at all.

Login ​

Authenticate and receive a session cookie. This is the panel's flow: fetch the CSRF cookie first (GET /api/csrf-cookie), then send the X-XSRF-TOKEN header with the login request.

POST /api/login

Request Body:

json
{
  "email": "john@example.com",
  "password": "your_password"
}

Responds { "message": "Login successful" }. Wrong credentials respond 422 with the error on email. Login is rate limited to 10 attempts per minute per IP address (429 beyond that) — the only rate limit in the API, shared with setup.

First-run Setup ​

A fresh instance has no user, so nobody could sign in. Until one exists, the panel creates the administrator through these two endpoints, which need no authentication. Setup closes for good as soon as any user exists, however it was created.

GET /api/setup

Response:

json
{
  "data": {
    "required": true
  }
}

required is true only while the instance has no user.

POST /api/setup

Request Body:

json
{
  "name": "Admin",
  "email": "admin@example.com",
  "password": "your_password"
}

Responds 201 with { "message": "Setup complete" } and creates the user as an administrator, with a project named Default Project. A request from the panel is also signed in; any other caller only gets the account, and signs in like everyone else. Once any user exists it responds 403 and creates nothing. name takes up to 255 characters, email must be a valid address and password needs at least 8 characters (422 otherwise).

Until that first account exists, whoever reaches the panel first becomes its administrator, so run setup right after the first start.

Logout ​

Invalidate the current session.

POST /api/logout

API Tokens ​

For programmatic access, create API tokens from the dashboard or via the API.

Personal tokens act as you, across all of your projects, and never expire — revoke one you no longer need.

List Tokens ​

GET /api/tokens

Returns { "data": [ ... ] } with the token objects shown below, newest first, without the plain-text token.

Create Token ​

POST /api/tokens

Request Body:

json
{
  "name": "My API Token"
}

name is required, up to 255 characters.

Response (201):

json
{
  "data": {
    "id": 1,
    "name": "My API Token",
    "abilities": ["*"],
    "lastUsedAt": null,
    "createdAt": "2026-07-13T00:00:00.000000Z",
    "expiresAt": null,
    "token": "1|abc123..."
  },
  "message": "API token created successfully."
}

The plain-text token is only returned here, once.

Delete Token ​

DELETE /api/tokens/{id}

Revokes one of your own tokens by its numeric id. Another user's token, or one that does not exist, responds 404.

Using Tokens ​

Include the token in the Authorization header:

Authorization: Bearer 1|abc123...

Every endpoint that works on project data — videos, templates, streams, external users, storage, activity log — resolves inside one project, and refuses the request (400) without one. A user token names the project with the X-Project-Ulid header on each request (a project that is not yours responds 404). The upload endpoints are the exception: they take the project from the upload's metadata instead.

Authorization: Bearer 1|abc123...
X-Project-Ulid: 01HX...

Project API Keys ​

A project API key is the project, the way a service account is its own identity: it does not act on behalf of you, it acts as the project. So it needs no X-Project-Ulid header, and it cannot leave its project — a key of project A cannot read, update or delete a video of project B, nor upload into it, even though you own both.

What it can reach: videos, templates, streams, uploads, external users, storage and the project's activity log, plus the read-only analytics endpoints (all but the admin-only per-node report) and /usage — because reading those numbers back is what an integrating backend holds a key for. Most analytics reads narrow to the key's project, but not all of them: the queue counts and the encoding figures are instance-wide, and the batch by tracking id read and /usage resolve to the account that owns the project, so they can show more than the calling project's own traffic. Keep the key server-side.

What it cannot reach: anything that manages the account or the instance — /me, /profile, /projects, /tokens and every admin endpoint answer 403, even when the project's owner is an admin. Those stay for the dashboard and for user tokens.

Generate or rotate it from the dashboard (Projects → ⋮ → Regenerate API key) or via the API:

POST /api/projects/{ulid}/api-key

Regenerating revokes the project's previous key. The plain-text key is only returned once, in data.apiKey.token:

json
{
  "data": {
    "ulid": "01HX...",
    "name": "My project",
    "settings": null,
    "apiKey": {
      "id": 7,
      "name": "My project API key",
      "abilities": ["*"],
      "lastUsedAt": null,
      "createdAt": "2026-07-13T00:00:00.000000Z",
      "expiresAt": null,
      "token": "7|abc123..."
    },
    "createdAt": "2026-07-01T00:00:00+00:00",
    "updatedAt": "2026-07-01T00:00:00+00:00"
  },
  "message": "API key regenerated successfully"
}

Sending X-Project-Ulid for a different project than the key's returns 403.

Projects ​

Your projects, managed with a session or a personal token — account-wide, so a project API key gets 403 here. Every account has at least one: the first is created with the account.

GET    /api/projects
GET    /api/projects/{ulid}
POST   /api/projects
PUT    /api/projects/{ulid}
DELETE /api/projects/{ulid}

GET /api/projects lists the projects you own, newest first, in the shape shown under Project API Keys (with apiKey as metadata only, never the plain-text key). A project that is not yours responds 404.

Request Body (create and update; PATCH works too):

json
{
  "name": "My project",
  "settings": {
    "webhookUrl": "https://example.com/webhook",
    "webhookSecret": "a-long-random-string"
  }
}
FieldTypeNotes
namestringRequired on create, optional on update. Up to 255 characters, unique among your projects.
settings.webhookUrlstring | nullWhere the outbound webhooks go. A URL, up to 2048 characters; null sends nothing.
settings.webhookSecretstring | nullSent as a bearer token with each delivery. Up to 255 characters.

settings is optional. When sent, both of its fields are written — one you leave out is cleared — so send both back on an update. settings comes back on every read, the secret included.

Create responds with the new project under data; update with it under data plus a message. Delete removes the project with its videos (and their files in storage), templates and API key. It responds 409 when it is your only project, or while any of its videos is still processing.

Current User ​

Get the authenticated user's information:

GET /api/me

Response:

json
{
  "data": {
    "id": 1,
    "name": "John Doe",
    "email": "john@example.com",
    "isAdmin": false,
    "projects": [{ "ulid": "01HX...", "name": "My project", "settings": null, "apiKey": null, "createdAt": "...", "updatedAt": "..." }]
  }
}

projects lists every project you own, each with its API key's metadata (never the plain-text key).

Profile ​

Update Profile ​

PUT /api/profile

Request Body:

json
{
  "name": "John Updated",
  "email": "john.new@example.com"
}

Both fields are required: name up to 255 characters, email a valid address no other user has. Responds with the updated user in data.

Update Password ​

PUT /api/profile/password

Request Body:

json
{
  "currentPassword": "old_password",
  "password": "new_password",
  "passwordConfirmation": "new_password"
}

The new password needs at least 8 characters and must match passwordConfirmation. A wrong currentPassword responds 422.

Authorization ​

Some endpoints require admin privileges. These are marked with Admin in the API reference. Non-admin users will receive a 403 Forbidden response.

Admin covers what operates the instance: nodes and their operations, the SSH key, the node environment, the Cloudflare and Tailscale credentials, CDN domains and the CDN's delivery settings, user management, the version check and the per-node delivery report. The other metrics endpoints — /analytics and its batch reads, /metrics and /usage — are not admin, and are readable with any authenticated token, including a project API key.

Released under the MIT License.