MATIH Platform is in active MVP development. Documentation reflects current implementation status.
2. Architecture
API Design
REST Conventions

REST Conventions

All MATIH Platform APIs follow a consistent set of REST conventions. These conventions ensure that developers interacting with any service encounter the same URL patterns, HTTP method semantics, query parameter formats, and pagination behavior.


URL Structure

All API URLs follow this pattern:

/api/v1/:resource[/:id][/:sub-resource]
ComponentDescriptionExample
/apiAPI namespace prefixAlways present
/v1API versionMajor version only
/:resourcePlural resource name/dashboards, /users, /tenants
/:idResource identifier/dashboards/dash-123
/:sub-resourceNested resource/dashboards/dash-123/widgets

HTTP Methods

MethodSemanticsIdempotentResponse Code
GETRetrieve resource(s)Yes200 OK
POSTCreate a new resourceNo201 Created
PUTFull replacement of a resourceYes200 OK
PATCHPartial update of a resourceNo200 OK
DELETERemove a resourceYes204 No Content

Query Parameters

Filtering

Filters use field-based query parameters:

GET /api/v1/dashboards?status=published&created_by=user-123

Sorting

Sort by field name with optional direction:

GET /api/v1/dashboards?sort=created_at&direction=desc
ParameterValuesDefault
sortAny sortable field namecreated_at
directionasc, descdesc

Pagination

All list endpoints support cursor-based or offset-based pagination:

GET /api/v1/dashboards?page=0&size=20
ParameterDescriptionDefaultMaximum
pageZero-based page number0--
sizeItems per page20100

Paginated Response

{
  "success": true,
  "data": [ ],
  "metadata": {
    "timestamp": "2026-02-12T10:30:00Z",
    "requestId": "abc-123",
    "version": "v1"
  },
  "pagination": {
    "page": 0,
    "size": 20,
    "totalElements": 142,
    "totalPages": 8,
    "hasNext": true
  }
}

Request Headers

HeaderRequiredDescription
AuthorizationYes (except public endpoints)Bearer <access_token>
Content-TypeYes (for POST/PUT/PATCH)application/json
AcceptNoapplication/json (default)
X-Correlation-IDNoClient-provided correlation ID for tracing
X-Request-IDNo (set by gateway)Unique request identifier

Response Headers

HeaderDescription
X-Request-IDUnique identifier for this request
X-Correlation-IDCorrelation ID (echoed from request or generated)
X-RateLimit-LimitMaximum requests per window
X-RateLimit-RemainingRemaining requests in current window
X-RateLimit-ResetUnix timestamp when the window resets

Naming Conventions

ConventionExample
Resource names are plural/dashboards, /users, /tenants
URL path segments use kebab-case/api-keys, /data-sources
Query parameters use snake_casecreated_by, sort_order
JSON fields use camelCasetenantId, createdAt, dashboardName

Versioning Strategy

API versioning uses URL-path versioning with major versions only:

VersionURLNotes
v1/api/v1/resourceCurrent stable version
v2/api/v2/resourceFuture version (when breaking changes are needed)

Minor and patch-level changes (adding optional fields, new endpoints) are made within the current version. Breaking changes (removing fields, changing semantics) require a new major version.


Related Pages