API Design Guide

Version 1.0.0 · Published 2026 Feb 19

Purpose

Standards and best practices for REST API components within this project.

Guiding Principles

Requests

URIs/Paths

HTTP Verbs

MethodAction
GETRead
POSTCreate
PUTUpdate (full)
PATCHUpdate (partial)
DELETEDelete

Resource Identifiers

Use Sequential UUIDs (SQUUIDs). Never expose database row IDs.

Versioning

Two methods supported:

GET /images/4
Accept: application/vnd.hybrid-compute.v1+json

Or in URI:

GET /v1/images/4

Format: Major.Minor (x.y). Change Major for multiple breaking changes, Minor for 1+ breaking changes.

Pagination

Use offset and limit with HAL links:

{
  "_links": {
    "self": { "href": "/images?offset=543&limit=25" },
    "next": { "href": "/images?offset=768&limit=25" },
    "prev": { "href": "/images?offset=123&limit=25" }
  },
  "items": []
}

Security

Responses

HTTP Status Codes

CodeMeaning
200OK
201Created
400Bad Request
401Unauthorized
403Forbidden
404Not Found
500Internal Server Error

Error Format

{
  "errors": [
    {
      "code": "not_found",
      "title": "Image not found",
      "details": "No image found with ID: abc123"
    }
  ]
}

JSON Formatting

Performance

REST API Reference

Images

MethodEndpointDescription
POST/v1/imagesUpload image
GET/v1/imagesList images
GET/v1/images/:idGet image
POST/v1/images/:id/tilesSplit into tiles

Tiles

MethodEndpointDescription
GET/v1/tilesList tiles
POST/v1/tiles/:id/upscaleUpscale tile

Jobs

MethodEndpointDescription
POST/v1/stitchStitch tiles
GET/v1/jobs/:idJob status

Commit Standards

type(scope): short description (≤60 chars)
- optional bullet point

Types: feat, fix, docs, style, refactor, perf, test, chore, ci, build, revert