Skip to content

5.3 Shared Types

Every API refers to the same shared types, so that a period, a coded value or an error has one shape everywhere. They live in one contract, common/v1/schemas.yaml:

  • The value types of the data model, such as Period, EventTime and CodedValue (see Shared Types in Data).
  • Errors, in the Problem Details format (RFC 9457), with the standard responses BadRequest, Unauthorized, Forbidden, NotFound and Conflict, and the catalog of problem types (ProblemType, urn:moonitoring:problem:<slug>) by which an app words each error, such as the 403s reauthentication-required, self-action, role-outranks-you, role-capabilities-not-held and administrators-only-by-job.
  • Paging and retries: the cursor and limit parameters and the Idempotency-Key header.
  • Authentication: the short-lived bearer token signed by the platform.

A change to this contract reaches every API that uses it, so a shared type only gains fields within a version.