Base URL & Request Format
Production Environment
| Service | URL |
|---|---|
| API Endpoint | https://api.itms.solutions |
| Web Application | https://itms.solutions |
| tRPC Base | https://api.itms.solutions/trpc |
Request Headers
Required Headers
http
Content-Type: application/jsonAuthentication Header
For protected endpoints:
http
Authorization: Bearer <jwt-token>Optional Headers
http
x-trpc-source: webtRPC Request Format
Query (Read Operations)
Queries use HTTP GET with URL-encoded input:
bash
# Simple query without input
GET /trpc/auth.me
# Query with input parameters
GET /trpc/sensors.getSensorById?input={"json":{"id":"sensor-001"}}Mutation (Write Operations)
Mutations use HTTP POST with JSON body:
bash
POST /trpc/auth.login
Content-Type: application/json
{
"json": {
"email": "user@example.com",
"password": "password123"
}
}Batch Requests
Multiple procedures can be batched into a single HTTP request:
bash
# Batch query
GET /trpc/system.getLicense,system.timezone.getTimezoneSettings?batch=1&input={}
# Response contains array of results
{
"0": { "result": { "data": { "json": { ... } } } },
"1": { "result": { "data": { "json": { ... } } } }
}superjson Serialization
The API uses superjson for serialization, which supports:
Dateobjects (serialized as ISO strings with metadata)BigIntvaluesMapandSetcollectionsundefinedvalues- Regular expressions
Example Date Handling
json
// Request with Date
{
"json": {
"startDate": "2024-01-01T00:00:00.000Z"
},
"meta": {
"values": {
"startDate": ["Date"]
}
}
}CORS Configuration
The API supports cross-origin requests from:
https://itms.solutionshttps://www.itms.solutionshttps://*.pages.dev(Cloudflare Pages previews)http://localhost:3000(development)
Allowed Methods
GET, POST, PUT, DELETE, OPTIONSAllowed Headers
Content-Type, Authorization, x-trpc-sourceRate Limiting
Currently, no rate limiting is applied. This may change in future versions.
Timeouts
- Request timeout: 30 seconds
- Keep-alive: Enabled
- Maximum request body: 10MB