Skip to content

Export Project

Exports the project’s full content as a single gzip-compressed JSON document.

This endpoint powers snapshot mode: export a project once and serve every read method from the local snapshot, with no API round-trips at request time.

Endpoint

shell
curl https://api.contentisland.net/api/1.0/project/export --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' --output content-island-snapshot.json.gz

Response

A successful response returns a gzip-compressed JSON body. The headers are:

HeaderValue
Content-Typeapplication/json
Content-Encodinggzip

Once decompressed, the body is a ContentSnapshot object with the following structure:

interface ContentSnapshot {
meta: {
schemaVersion: number; // current snapshot schema version (SNAPSHOT_SCHEMA_VERSION = 1)
exportedAt: string; // ISO-8601 timestamp when the snapshot was generated
projectId: string;
view: 'published' | 'preview';
};
project: Project; // same shape as GET /project
contents: Content[]; // every matching content, all languages, no pagination
}
  • meta.schemaVersion: The snapshot schema version. The current supported value is 1 (SNAPSHOT_SCHEMA_VERSION).
  • meta.exportedAt: An ISO-8601 timestamp marking when the snapshot was generated.
  • meta.projectId: The ID of the exported project.
  • meta.view: 'published' or 'preview', depending on the token used (see below).
  • project: The project object, with the same shape returned by GET /project.
  • contents: Every matching content for the token, across all languages, with no pagination.

The contents array uses the existing API Content shape at related-content depth 0: related fields stay as raw id strings, enum values are flattened to strings, and media is referenced by CDN URLs (only the URLs travel — the media itself stays on the CDN). The serialized contents are byte-equivalent to what GET /contents returns for the same token with no query.

Token-driven view

The exported view is determined by the token, not by any parameter:

  • A normal token exports the published view.
  • A PREVIEW_-prefixed token exports the preview (draft) view.

There is no view query parameter — switch tokens to switch views.

Rate Limit

This endpoint is rate-limited to a maximum of 5 export requests per project per 60 seconds, keyed by projectId (not by IP or token). The limit is overridable server-side via the EXPORT_RATE_LIMIT_MAX environment variable.

The limiter is per server instance — an abuse backstop, not a cluster-wide SLA. After the 60-second window elapses the counter resets, so there is no permanent lockout.

Exceeding the limit returns HTTP 429 with a Retry-After header (seconds remaining in the window) and the following body:

{
"error": {
"code": "RATE_LIMITED",
"message": "Too many export requests for this project. Try again later.",
"requestId": "req_abc123"
}
}

Status Codes

CodeDescription
200The request was successfully processed and the gzip-compressed JSON snapshot was returned.
401Unauthorized. The access token is missing, invalid, or has expired.
429Too many requests. The per-project rate limit was exceeded; includes a Retry-After header.
500Internal server error. An error occurred while processing the request.

Error responses follow the uniform contract documented in Errors{ "error": { "code", "message", "requestId", "details?" } }.