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/:workspaceKey/: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 your workspace key in the URL path.
All timestamps are in UTC ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

Authentication

To authorize, use this code:
# Simply include your workspace key in the URL path
curl "https://api.marblecms.com/v1/YOUR_WORKSPACE_KEY/posts"
Make sure to replace YOUR_WORKSPACE_KEY with your actual workspace key.
When you’re ready to use your own workspace, MarbleCMS authenticates your API requests using your workspace key in the URL path. If you do not include your workspace key in the URL, or use one that is incorrect or outdated, MarbleCMS returns an error. Your workspace key carries many privileges, so be sure to keep it secure! Do not share your workspace key in publicly accessible areas such as GitHub, client-side code, and so forth.