Base URL
All API access is over HTTPS and is accessed from theapi.marblecms.com domain. All data is sent and received as JSON.
:resource is the specific resource you want to interact with (e.g., posts, categories, tags, authors).
Authentication
Marble authenticates API requests using API keys. You can create and manage API keys from your workspace dashboard under Settings > API Keys. Include your API key in theAuthorization header of every request:
API key types and scopes
Every API key carries a set of scopes that determine which resources and operations it can access. The API checks the key’s scopes on every request and returns403 Forbidden if a required scope is missing.
There are two key types:
- Public keys (
mpk_…) can only hold read scopes. They are safe to use from environments where the key may be observed, such as build pipelines for static sites. - Private keys (
msk_…) can hold any scope, including write scopes andposts_read_drafts. Use them only from trusted server-side environments.
Reading drafts
By default,GET /v1/posts returns only published posts. To include drafts you must:
- Use a private API key, and
- Grant it the
posts_read_draftsscope, and - Pass
?status=draft(drafts only) or?status=all(drafts + published).
posts_read_drafts, return 403 Forbidden.
Response Format
All responses are returned as JSON. Successful responses include the requested data, while errors include anerror field with details.
All timestamps are in UTC ISO 8601 format:
YYYY-MM-DDTHH:MM:SSZError Handling
The API uses conventional HTTP response codes to indicate the success or failure of a request:
Example error response:
403 with a message naming the missing scope:
posts_read_drafts.