Skip to content

API Conventions

All smplkit APIs follow the JSON:API specification. Every request and response uses the JSON:API envelope format.

Request and Response Format

Creating a resource:

json
{
  "data": {
    "type": "resource-type",
    "attributes": {
      "name": "value"
    }
  }
}

Resource in a response:

json
{
  "data": {
    "id": "uuid",
    "type": "resource-type",
    "attributes": {
      "name": "value",
      "created_at": "2026-03-17T22:19:12Z",
      "updated_at": "2026-03-17T22:19:12Z"
    }
  }
}

List response:

json
{
  "data": [
    { "id": "uuid", "type": "resource-type", "attributes": { "..." : "..." } },
    { "id": "uuid", "type": "resource-type", "attributes": { "..." : "..." } }
  ]
}

HTTP Methods

MethodUsage
GETRetrieve one or many resources
POSTCreate a resource
PUTReplace a resource entirely (full replacement, not partial update)
DELETEDelete a resource

Status Codes

CodeMeaning
200Success
201Resource created
204Resource deleted (no response body)
400Validation error or malformed request
401Missing or invalid authentication
403Authenticated but not authorized
404Resource not found
409Conflict (e.g., duplicate key)

Error Responses

Errors follow JSON:API format and may include multiple errors:

json
{
  "errors": [
    {
      "status": "400",
      "title": "Validation Error",
      "detail": "Field required",
      "source": { "pointer": "/data/attributes/name" }
    }
  ]
}