Skip to main content

API Reference

The ProBeya API is built on tRPC and exposes type-safe procedures over HTTP. This page covers the conventions, request format, and error handling that apply across all endpoints.

Base URL​

https://acme.probeya.com/api/trpc

Replace acme.probeya.com with the application hostname for your tenant. The API is served by the Next.js application; there is no separate API origin in the supported self-hosted stack.

Request Format​

Queries (GET)​

tRPC queries map to HTTP GET requests. The input is encoded in the URL:

GET /api/trpc/workspace.list
GET /api/trpc/item.byId?input={"id":"itm_abc123"}

Mutations (POST)​

tRPC mutations map to HTTP POST requests. The input is sent as JSON in the request body:

POST /api/trpc/item.create
Content-Type: application/json

{
"title": "New task",
"boardId": "brd_xyz789",
"groupId": "grp_abc123"
}

Batch Requests​

You can batch multiple procedure calls in a single HTTP request:

GET /api/trpc/workspace.list,project.list?input={"1":{"workspaceId":"ws_abc123"}}

Response Format​

All responses follow the tRPC envelope format:

Success​

{
"result": {
"data": {
"id": "itm_abc123",
"title": "My task",
"status": "todo"
}
}
}

Error​

{
"error": {
"message": "Item not found",
"code": "NOT_FOUND",
"data": {
"httpStatus": 404,
"path": "item.byId"
}
}
}

Error Codes​

CodeHTTP StatusDescription
BAD_REQUEST400Invalid input or missing required fields
UNAUTHORIZED401Missing or invalid authentication
FORBIDDEN403Insufficient permissions
NOT_FOUND404Resource not found
CONFLICT409Resource already exists or state conflict
TOO_MANY_REQUESTS429Rate limit exceeded
INTERNAL_SERVER_ERROR500Unexpected server error

Pagination​

List endpoints support cursor-based pagination:

GET /api/trpc/item.list?input={"boardId":"brd_xyz789","cursor":"itm_abc123","limit":50}

Response includes a nextCursor field:

{
"result": {
"data": {
"items": [...],
"nextCursor": "itm_def456"
}
}
}

Pass nextCursor as the cursor parameter in the next request to fetch the next page. When nextCursor is null, there are no more results.

Filtering and Sorting​

List endpoints accept optional filter and sort parameters:

{
"boardId": "brd_xyz789",
"filter": {
"status": { "eq": "in_progress" },
"priority": { "in": ["high", "critical"] }
},
"sort": [{ "field": "createdAt", "direction": "desc" }],
"limit": 50
}

Available Routers​

RouterDescription
organizationOrganization endpoints
workspaceWorkspace endpoints
projectProject endpoints
boardBoard endpoints
itemItem endpoints
formForm endpoints
authAuthentication endpoints

See the individual API pages for detailed procedure documentation.