API Reference

Complete reference for all TruCustom REST API endpoints.

Base URL

https://trucustom.net/api/v1

Request Format

All requests should include these headers:

Authorization: Bearer pc_your_api_key
Content-Type: application/json
Accept: application/json

Response Format

All responses return JSON with this structure:

Single Resource

{
  "data": {
    "id": "uuid",
    "name": "Resource Name",
    ...
  }
}

Collection (Paginated)

{
  "data": [
    { "id": "uuid", ... },
    { "id": "uuid", ... }
  ],
  "meta": {
    "page": 1,
    "per_page": 20,
    "total": 150,
    "total_pages": 8
  }
}

Error

{
  "error": "Error Type",
  "message": "Human-readable error message",
  "errors": { ... }  // Validation errors (optional)
}

Pagination

Collection endpoints support pagination with these query parameters:

  • page - Page number (default: 1)
  • per_page - Items per page (default: 20, max: 100)

Resources

HTTP Status Codes

Code Meaning
200 Success
201 Created - Resource successfully created
204 No Content - Resource deleted successfully
400 Bad Request - Invalid request body
401 Unauthorized - Invalid or missing API key
403 Forbidden - Insufficient permissions
404 Not Found - Resource doesn't exist
422 Unprocessable Entity - Validation errors
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error