Skip to main content

Base URL

All API requests should be made to:
https://api.trusec.io/v1

Authentication

Authenticate API requests by including your API key in the Authorization header:
Authorization: Bearer trusec_sk_your_api_key
Keep your secret API key secure. Never expose it in client-side code or public repositories.

Request Format

The API accepts JSON-encoded request bodies and returns JSON-encoded responses.
Content-Type: application/json

Response Format

All responses follow a consistent structure:

Success Response

{
  "data": {
    "id": "user_123",
    "email": "[email protected]"
  },
  "meta": {
    "requestId": "req_abc123"
  }
}

Error Response

{
  "error": {
    "code": "invalid_request",
    "message": "The request body is invalid",
    "details": [
      {
        "field": "email",
        "message": "Invalid email format"
      }
    ]
  },
  "meta": {
    "requestId": "req_abc123"
  }
}

HTTP Status Codes

CodeDescription
200Request succeeded
201Resource created
204Request succeeded (no content)
400Bad request
401Unauthorized
403Forbidden
404Not found
429Rate limit exceeded
500Internal server error

Rate Limiting

API requests are rate limited to ensure fair usage:
PlanLimit
Free100 requests/minute
Pro1,000 requests/minute
EnterpriseCustom
Rate limit headers are included in every response:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1704067200

Pagination

List endpoints support cursor-based pagination:
GET /v1/users?limit=20&cursor=cur_abc123
Response includes pagination info:
{
  "data": [...],
  "pagination": {
    "hasMore": true,
    "nextCursor": "cur_def456"
  }
}

Versioning

The API version is included in the URL path (/v1/). We maintain backwards compatibility within major versions.
Subscribe to our changelog to stay updated on API changes.

SDKs

We provide official SDKs for popular languages: