Skip to main content

API Basics

This page covers everything you need before writing your first API call — environments, authentication, error handling, pagination, and translation support.

Environments

Mozrest provides two environments. Use Sandbox during development and testing, and Production when you're ready to go live.

EnvironmentBase URLPurpose
Sandboxhttps://api-sandbox.mozrest.com/Development and integration testing
Productionhttps://api.mozrest.com/Live operations

All examples in this documentation use the Sandbox base URL. Replace it with the Production URL when going live.

Authentication

All requests must be authenticated with a Bearer token sent in the Authorization header. Your API key will be provided by the Mozrest team during onboarding.

  • Only HTTPS requests are accepted.
  • No password is required — the API key is the sole credential.
curl "https://api-sandbox.mozrest.com/v1/rms" \
-H "Authorization: Bearer {api_key}"

Keep your API key secret. Do not expose it in client-side code or public repositories.

Errors

Mozrest uses standard HTTP response codes to indicate request success or failure.

CodeStateDescription
200OKEverything worked as expected
400Bad RequestMissing or invalid required parameter
401UnauthorizedAPI key is missing or not valid
402Request FailedParameters were valid but the request could not be processed
403ForbiddenAccess forbidden for this resource
404Not FoundThe requested resource does not exist
5xxServer ErrorSomething went wrong on Mozrest's server

Versioning

The current API version is v1, included in the URL path (/v1/rms/...). Mozrest releases new versions only when introducing breaking changes. Non-breaking additions (new fields, new endpoints) are added to the current version without a version bump.

Forward Compatibility

Mozrest may add new fields to request and response payloads at any time. These additions are not considered breaking changes.

Your integration must:

  • Ignore unknown fields — do not reject or fail when receiving properties that are not in your current implementation.
  • Use lenient deserialization — avoid strict schema validation that would break on new fields.

Mozrest will never make backward-incompatible changes (removing fields, changing types, or altering semantics of existing fields) without prior notice and a migration plan.

Pagination

Mozrest uses offset-based pagination. Include offset and limit as query parameters to control the result window.

ParameterConstraintsDefaultDescription
offset0 or greater0Index of the first element to return
limit1 to 5010Number of elements to return
curl "https://api-sandbox.mozrest.com/v1/rms/venues?offset=20&limit=10" \
-H "Authorization: Bearer {api_key}"

Translations

Mozrest supports translations for certain entities (venues, areas, etc.). Translations are provided alongside the default-locale value using a translations array.

Default locale

The default locale can be configured at two levels:

  • Partner level — applies to all venues unless overridden.
  • Venue level — overrides the partner default for a specific venue.

Providing translations

When creating or updating an entity, include a translations property with the following structure:

KeyTypeDescription
localeStringTarget locale in ISO 639-1 format (e.g. de, es)
data[].fieldStringThe field to translate (e.g. name, description)
data[].contentStringThe translated value
{
"name": "English name (default locale)",
"translations": [
{
"locale": "de",
"data": [
{ "field": "name", "content": "German translation" }
]
},
{
"locale": "es",
"data": [
{ "field": "name", "content": "Spanish translation" }
]
}
]
}

Retrieving localised data

To get data in a specific locale, include the x-locale header in your request (ISO 639-1 format). If omitted, data is returned in the default locale.

curl "https://api-sandbox.mozrest.com/v1/rms/venues/{venueId}" \
-H "Authorization: Bearer {api_key}" \
-H "x-locale: es"