The MarbleCMS API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes and verbs.

Base URL

All API access is over HTTPS and is accessed from the api.marblecms.com domain. All data is sent and received as JSON. The structure of a request is: https://api.marblecms.com/v1/:workspaceId/:resource

Trying it out

Throughout this documentation, we use an example workspace ID: cm6ytuq9x0000i803v0isidst. You can use this ID to make live API requests and see real responses without needing an account. For example, to get all posts from the example workspace:
$ curl https://api.marblecms.com/v1/cm6ytuq9x0000i803v0isidst/posts
The example workspace (cm6ytuq9x0000i803v0isidst) does not require authentication. When you are ready to use your own workspace, you will need to use API key authentication.
All timestamps are in UTC ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

Authentication

To authorize, use this code:
# With shell, you can just pass the correct header with each request
curl "https://api.marblecms.com/v1/YOUR_WORKSPACE_ID/posts" \
  -H "Authorization: Bearer YOUR_API_KEY"
Make sure to replace YOUR_WORKSPACE_ID and YOUR_API_KEY with your credentials.
When you’re ready to use your own workspace, MarbleCMS authenticates your API requests using your account’s API keys. If you do not include your key when making an API request, or use one that is incorrect or outdated, MarbleCMS returns an error. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.