All Webhood API endpoints — bothDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/webhood-io/webhood/llms.txt
Use this file to discover all available pages before exploring further.
/api/v1/ and the legacy /api/beta/ — require a valid Bearer token passed in the Authorization header. Requests that omit the header, or supply an invalid or expired token, receive a 401 Unauthorized response. There are two ways to obtain a token: a short-lived session token via the PocketBase auth endpoint, or a long-lived API token created in the Webhood UI for programmatic access.
Step 1 — Obtain a Session Token
You can authenticate as a Webhood user and receive a session token by calling the PocketBaseauth-with-password endpoint directly:
token field:
token value and use it as your Bearer token in subsequent requests. Session tokens are shorter-lived than API tokens and are better suited for interactive or one-off use.
Step 2 — Create a Long-Lived API Token (Recommended)
For automation and programmatic access, create a dedicated API token through the Webhood UI:- Log in to the Webhood web interface.
- Navigate to Settings → Accounts.
- Create a new API token and copy the generated value.
api_tokens PocketBase collection with the scanner role.
API tokens are stored in the
api_tokens PocketBase collection. Each token record includes an expires field (ISO 8601) and a role field. Tokens created through the Webhood UI carry the scanner role, which is required to authenticate against all /api/v1/ endpoints. Tokens generated specifically for scanner instances (internal scanner agents) also carry the scanner role, but are linked to a scanner configuration record rather than being free-standing.Step 3 — Use the Token in Requests
Pass your token (session or API) as a Bearer token in theAuthorization header on every request:
Authorization: Bearer <token> header is required on all /api/v1/ and /api/beta/ endpoints. There is no cookie-based or query-parameter authentication for the REST API.
Required Header
Bearer token for authentication. Format:
Bearer <your-token>. Required on every /api/v1/ and /api/beta/ request.Scanner Tokens
The Webhood scanner agent uses a token type with thescanner role. These tokens are generated via the admin route:
admin role. It creates a 1-year JWT signed with the api_tokens record’s token key. Scanner tokens are intended for internal use by the scanner process, though they carry the same scanner role required to call all /api/v1/ endpoints.
The
/api/v1/ endpoints require RequireRecordAuth("users", "api_tokens") combined with RequireCustomRoleAuth("scanner"). This means the caller must be authenticated as either a users or api_tokens collection record, and that record’s role field must equal scanner. PocketBase admins bypass the role check entirely. Regular users records with role admin or user can access the /api/ui/ internal routes but not /api/v1/ directly unless their role is scanner.Full Example — Submit a Scan
The following example shows a complete authenticated request to submit a URL for scanning using an API token:202 Accepted with the new scan record in the response body:
GET /api/v1/scans/:id with the same Authorization header until the response status changes from 202 Accepted (scan in progress) to 200 OK (scan complete).