API v1 · Stable

T-Code API Reference

A REST API for converting GPS coordinates into short, memorable T-Codes. Power logistics, delivery, and emergency services across Tunisia.

Base URL

https://api.t-code.tn/api/v1

Authentication

Protected endpoints require a Bearer token in the Authorization header. Obtain tokens via the or endpoints.

Request header
Authorization: Bearer <API-KEY>

Rate Limiting

Each External API key has two limits (configurable by plan): 30 req/min and 5 000 req/day by default. Every response includes rate limit headers.

Response headers
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 27
429 response
{
  "success": false,
  "message": "Rate limit exceeded: max 30 req/min",
  "statusCode": 429
}

Response Envelope

Every endpoint returns the same JSON envelope. On success, data holds the result. On failure, message describes the error.

application/json
{
  "success": true,
  "statusCode": 200,
  "message": "T-Code created successfully",
  "data": { ... }
}

Endpoints