headless lms

Create an organization and its first API key

POST /api/platform/organizations. Create an organization and its first API key. Headless LMS Platform API reference.

POST
/api/platform/organizations

Requires the platform key as Authorization: Bearer <platform key>. Creates the organization, owned by the platform account, with its metadata, and an API key for the platform account with the Owner role and no expiry. The key is returned once. 409 when the slug is in use.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/platform/organizations" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "slug": "string"  }'
{  "organization": {    "id": "string",    "name": "string",    "slug": "string",    "createdAt": "string",    "hosts": {      "courses": "string",      "community": "string"    },    "metadata": {      "property1": "string",      "property2": "string"    }  },  "apiKey": {    "id": "string",    "name": "string",    "start": "string",    "role": {      "key": "string",      "name": "string"    },    "createdAt": "2019-08-24T14:15:22Z",    "lastUsedAt": "2019-08-24T14:15:22Z",    "expiresAt": "2019-08-24T14:15:22Z",    "key": "string"  }}
{  "error": "string",  "message": "string",  "requestId": "string",  "issues": [    {      "path": "string",      "message": "string"    }  ]}
{  "error": "string",  "message": "string",  "requestId": "string"}
{  "error": "string",  "message": "string",  "requestId": "string"}
{  "error": "string",  "message": "string",  "requestId": "string"}