Skip to main content

Requests and access mode

Send JSON GraphQL requests to POST https://api.creatora.io/graphql. Put the named operation in query and its variable values in variables. The Queries, Mutations and Types sections of this API Reference define the supported public surface. The production SDL contains additional exposed implementation operations. The Administrator JWT is available in Admin Panel → Platform → API → Developer. See Authentication for its handling. Send it as:
Authentication identifies the account. Access mode selects the request context. Without X-CREATORA-ACCESS-MODE: administrator, the request uses Student mode even with an Administrator JWT. A valid JWT with the wrong mode can therefore return Student-context data or an authorization error. Check this header first when an Administrator operation appears to have insufficient access. Treat the copied JWT as a secret. Signing out of the browser does not revoke a copied token.

Values in variables

Lists and pagination

Pagination depends on the operation. courses accepts limit but no continuation cursor. students, customOffers and orders accept pagination with limit and beforeMillis. For the latter collections, beforeMillis filters records with a createdOn value strictly earlier than the supplied Unix-millisecond timestamp. Use limit to keep a request bounded. Do not treat repeated pages as a guaranteed complete export. Records sharing a timestamp can be skipped by a strict timestamp cursor, and Order sorting does not follow the createdOn cursor alone. The recipes below use bounded reads; they do not promise a lossless traversal of every record.

Errors and mutation retries

An executed GraphQL request can return HTTP 200 with partial data and an errors array. Check errors even when the HTTP request succeeded. Some authorization errors use errors[].extensions.name, including ENTITY_PERMISSION.UNAUTHORIZED; not every error has the same extension or a single Creatora error code. For example, a request that selected thisFieldDoesNotExist from me returned this GraphQL validation error:
This means the requested field is absent from the current schema. Check the field name in the SDL. The example does not indicate an authentication or access-mode failure; locations points to the invalid selection in that request. If an Administrator request returns an authorization error, check the Authorization value and X-CREATORA-ACCESS-MODE: administrator before changing the GraphQL operation. A timeout or partial response does not prove that a mutation was rolled back. Before repeating createCourse or a direct Course grant, inspect the current Course or Student access state as described in its recipe. Do not retry either mutation blindly.