Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/juescoryisus/QualityDocD/llms.txt

Use this file to discover all available pages before exploring further.

The Node.js API is multi-tenant — every user, document, and search result is scoped to a company. Companies are the root tenant entity: you must create a company before you can create users or documents under it. The slug you choose at creation time becomes the permanent identifier used in every subsequent login request to target that tenant.
This endpoint has no authentication requirement in the current implementation. It is intended for initial tenant provisioning — see the warning below before exposing it in a production environment.

POST /companies

Creates a new company tenant. On success, the API inserts the record and returns the full company object with its generated id and createdAt timestamp.

Request body

name
string
required
Human-readable display name for the company (e.g. "Acme Corp"). Stored as-is and shown in UI contexts.
slug
string
required
URL-safe identifier for the company (e.g. "acme-corp"). Must be unique across all tenants. The slug is passed as companySlug in POST /auth/login to identify the tenant during authentication — choose it carefully and treat it as immutable after users are provisioned.

Response — 201 Created

id
number
Auto-generated primary key for the company record.
name
string
The human-readable name as provided in the request.
slug
string
The URL-safe tenant identifier as provided in the request.
createdAt
string
ISO 8601 timestamp of when the company record was created.

Error responses

StatusMeaning
400 Bad RequestThe request body failed Zod validation — name or slug is missing or empty.
500 Internal Server ErrorA database error occurred (e.g. slug uniqueness constraint violation).

Example

curl -X POST http://localhost:5000/companies \
  -H "Content-Type: application/json" \
  -d '{"name":"Acme Corp","slug":"acme-corp"}'

Slug stability

The slug field is used as companySlug in POST /auth/login to route login requests to the correct tenant:
{
  "email": "user@acme.com",
  "password": "••••••••",
  "companySlug": "acme-corp"
}
Use the slug consistently — once real users have been created under a company, changing the slug will break all existing tokens and login flows for that tenant. The database enforces uniqueness at the column level, so duplicate slugs will be rejected with a constraint error.
This endpoint has no authentication protection. Any caller who can reach the API can create a new company tenant. In production, restrict access to POST /companies via network-level controls (firewall rules, VPC policy, a reverse-proxy allowlist) or add your own authentication middleware before this route. Do not expose it on a public interface without a guard.

Build docs developers (and LLMs) love