API-HUB uses two separate authentication mechanisms depending on who is calling the API. The admin interface (browser and Next.js frontend) authenticates with a JWT stored in anDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/VisualGraphxLLC/API-HUB/llms.txt
Use this file to discover all available pages before exploring further.
httponly cookie. Internal machine-to-machine calls from n8n workflows authenticate with a shared secret header instead, keeping credentials out of request bodies entirely.
Roles
| Role | Access |
|---|---|
vg_admin | Full access to all endpoints and all customers |
customer_admin | Scoped to a specific customer_id; cannot access other customers’ data or admin endpoints |
First-time setup
Before any user exists, call the setup endpoint to create the firstvg_admin account. This endpoint returns 409 Conflict the moment any user record exists in the database — it is intentionally a one-shot operation.
Email address for the first admin account. Normalized to lowercase.
Minimum 12 characters, maximum 256 characters.
201 Created
Unique identifier for the created user.
Normalized email address.
Always
vg_admin for the setup endpoint.null for vg_admin accounts.true for newly created users.| Status | Detail |
|---|---|
409 Conflict | "Admin already configured" — at least one user already exists |
409 Conflict | "Email already registered" — race condition on concurrent requests |
Login
Exchange email and password for anhttponly session cookie. The cookie is automatically set on the response and sent back by the browser on every subsequent request.
Registered email address. Case-insensitive.
Account password.
200 OK
Returns the UserRead object and sets the auth_token cookie.
| Status | Detail |
|---|---|
401 Unauthorized | "Invalid credentials" — wrong email, wrong password, or inactive account |
The cookie name is
auth_token. It is httponly, samesite=lax, and secure in production. You cannot read it from JavaScript.Logout
Clears theauth_token cookie. After this call the session is invalid.
204 No Content
No body. The Set-Cookie header instructs the browser to delete auth_token.
Current user
Returns the user associated with the current session cookie. Useful for bootstrapping the UI or checking which role is active.200 OK
| Status | Detail |
|---|---|
401 Unauthorized | Missing or invalid auth_token cookie |
User management
vg_admin users can create and manage other accounts. All user-management endpoints require a valid vg_admin session cookie.
Create a user
Email address for the new user. Must be unique.
Minimum 12 characters, maximum 256 characters.
Either
"vg_admin" or "customer_admin". Defaults to "customer_admin".Required when
role is "customer_admin". Must be null for "vg_admin".201 Created — returns the UserRead object.
Error responses
| Status | Detail |
|---|---|
401 Unauthorized | Not authenticated |
409 Conflict | "Email already registered" |
422 Unprocessable Entity | customer_admin without customer_id, or vg_admin with customer_id |
List users
UserRead objects ordered by created_at descending.
Delete a user
| Status | Detail |
|---|---|
400 Bad Request | "Cannot delete your own account" |
404 Not Found | User not found |
Internal API authentication (n8n → FastAPI)
n8n workflows that call internal FastAPI endpoints do not use cookies. Instead, they pass the shared secret configured in your.env file as an HTTP header.
X-Ingest-Secret are:
| Endpoint | Purpose |
|---|---|
POST /api/customers/{id}/pricing/quote | Marked-up price with storefront overrides |
GET /api/push/{customer_id}/product/{product_id}/payload | OPS-ready push payload |
GET /api/push/{customer_id}/product/{product_id}/ops-variants | Size/price bundle for OPS push loop |
GET /api/push/{customer_id}/product/{product_id}/ops-options | Product options for OPS push |
Never expose
X-Ingest-Secret-gated endpoints on a public storefront or to end-user clients. They return pricing rules and markup percentages that are internal business data.Error reference
| Status | When it occurs |
|---|---|
401 Unauthorized | No auth_token cookie, expired cookie, or invalid X-Ingest-Secret |
400 Bad Request | Attempting to delete your own account |
409 Conflict | Duplicate email, or setup called after users exist |
422 Unprocessable Entity | Invalid request body (role/customer_id mismatch, password too short) |