How to
Create a Company
Use the Companies API to register a tenant before adding agents.
Create a Company
Companies are persisted in PostgreSQL via the /api/companies route (packages/server/src/routes/companies.route.ts). Each agent row references a companyId, so creating a company is the first onboarding step.
Prerequisites
- Server running on
http://localhost:3001(or your deployed base URL). - A bearer token generated via
pnpm api-keyand configured in theAPI_KEYSenv variable. - Postman or
curlwith theAuthorization: Bearer <token>header.
Endpoint
- Method:
POST /api/companies - Authentication: Required (
validateApiKey) - Body schema:
nameis required,descriptionand metadata fields follow the Drizzle schema.
Example request
curl -X POST http://localhost:3001/api/companies \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TELLYO_API_KEY" \
-d '{
"name": "OneNine Innovations",
"description": "AI-first consultancy focused on automation rollouts"
}'Successful responses return the full company row (UUID, timestamps). Validation errors originate from createCompanySchema, which is derived from packages/server/src/db/schema/companies.schema.ts.
Verification and follow-up actions
GET /api/companies– confirm your company exists.GET /api/companies/{companyId}– fetch full details.GET /api/companies/{companyId}/agents– initially empty, but useful for sanity checks after agent creation.
You can now create an agent that references this companyId. Continue with Create an Agent.