Skip to Content
OpenPerf

API

Overview

Authentication, error format and HTTP conventions for the OpenPerf API.

The OpenPerf HTTP API powers the dashboard, the openperf CLI and CI automation. Every endpoint below is generated directly from the API's OpenAPI specification.

Authentication

Endpoints declare their accepted authentication schemes on each page:

  • API token (bearer): Create a token under Settings → API, as described in API tokens. Send it in the Authorization header:
curl https://api.example.com/api/v1/projects \
  -H "Authorization: Bearer $OPENPERF_AUTH_TOKEN"

Replace api.example.com with the host of your OpenPerf API. A token works for one organization, so requests never name it. Endpoints that change data require a write-scoped token; a read-only token receives 403.

  • Session cookie (cookie): Dashboard endpoints authenticate with the better-auth.session_token cookie (__Secure-better-auth.session_token in production) and an active organization context. Calling a session-only endpoint with an API token returns 403 with API_TOKEN_NOT_ALLOWED.
  • Public: Health endpoints (/health/live, /health/ready) require no authentication.

Errors

A failed request returns a JSON body with a stable code, a message for people, details, which is always null, and the requestId of the request:

{
  "code": "API_TOKEN_INVALID",
  "message": "…",
  "details": null,
  "requestId": "…"
}
StatusMeaning
400The request body or a parameter is not valid. The code is VALIDATION_ERROR.
401The session or token is missing, mistyped, revoked or expired.
403The caller may not access this endpoint or may not change data.
404The requested resource does not exist in this organization.
409The resource already exists or conflicts with the current state.
429Too many requests. Wait before you retry.

On this page