# Screens

Standalone library screens for the Screen Builder and Screen Player embeddables. Two ways to create a screen with a layout: omit `screenId` on `POST /embed/screen` (`action: edit`) so our picker opens — or list layouts here and `POST /screen` with a `layoutId`, then embed the returned id. See [Screen Builder](/embeddables/screen-builder) for the tradeoff.

<a id="get-layouts"></a>

## List layouts

Returns picker-visible catalog layouts: `id`, `name`, `category`, and `screenType` only — there are no thumbnails. Use `id` as `layoutId` on `POST /screen`.

GET `/v1/headless/layouts`

#### Examples

**cURL request**

```bash
curl --request GET \
  --url "https://api.coassemble.com/api/v1/headless/layouts" \
  --header "Authorization: COASSEMBLE:YOUR_WORKSPACE_ID:YOUR_API_KEY"
```

#### Response

**JSON response**

```json
[
  {
    "id": "example",
    "name": "example",
    "category": "example",
    "screenType": "example"
  }
]
```

<a id="create-screen"></a>

## Create screen

Creates a library screen. Pass `layoutId` to apply catalog structure, geometry, and English placeholder copy (quiz layouts create a cover + question + results group). A host wanting prompts in their own voice can overwrite the seeded heading and paragraph after mint. Without a layout, pass `type` (for example `blocks` or `blocksQuiz`). Then open the builder with `POST /embed/screen`, `action: edit`, and the returned id.

POST `/v1/headless/screen`

#### Body parameters

| Field | Type | Required | Desc | Options |
| --- | --- | --- | --- | --- |
| `layoutId` | `string` | No | Catalog layout id from GET /layouts | — |
| `type` | `string` | No | Screen type name (e.g. blocks, blocksQuiz) when layoutId is omitted | — |
| `typeId` | `number` | No | Screen type id when layoutId is omitted | — |
| `title` | `string \| null` | No | Screen title | — |
| `identifier` | `string` | No | Your stable user identifier | — |
| `clientIdentifier` | `string` | No | The client this user belongs to | — |

#### Examples

**cURL request**

```bash
curl --request POST \
  --url "https://api.coassemble.com/api/v1/headless/screen" \
  --header "Authorization: COASSEMBLE:YOUR_WORKSPACE_ID:YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "layoutId": 1234,
    "type": "example",
    "typeId": 1234,
    "title": "Workplace Safety"
}'
```

#### Response

**JSON response**

```json
{
  "quizAttemptId": 1234,
  "id": 1234,
  "uid": "example",
  "sequence": 1,
  "title": "Workplace Safety",
  "description": "example",
  "asset": "example",
  "assetAltText": "example",
  "assetSource": 1,
  "typeId": 1234,
  "background": null,
  "courseId": 1234,
  "clientId": 1234,
  "sourceId": 1234,
  "scored": false,
  "passingGrade": 1,
  "created": "2026-01-01T00:00:00.000Z",
  "updated": "2026-01-01T00:00:00.000Z",
  "updatedText": "2026-01-01T00:00:00.000Z",
  "narrationsGenerated": "2026-01-01T00:00:00.000Z",
  "aiGenerated": "2026-01-01T00:00:00.000Z",
  "deleted": "2026-01-01T00:00:00.000Z",
  "identifier": "user_123",
  "clientIdentifier": "client_123",
  "quizGroupUid": "example",
  "type": {
    "id": 1234,
    "name": "example",
    "title": "Workplace Safety",
    "icon": "example",
    "sequence": 1,
    "completable": false,
    "created": "2026-01-01T00:00:00.000Z",
    "updated": "2026-01-01T00:00:00.000Z"
  },
  "questions": [
    {
      "id": 1234,
      "screenId": 1234,
      "sequence": 1,
      "text": "example",
      "typeId": 1234,
      "sourceId": 1234,
      "caseSensitive": false,
      "serverGraded": false,
      "correct": false,
      "completed": false,
      "matchOptions": [
        "example"
      ],
      "narrationAudioPath": "example",
      "aiGenerated": "2026-01-01T00:00:00.000Z",
      "created": "2026-01-01T00:00:00.000Z",
      "updated": "2026-01-01T00:00:00.000Z",
      "questionType": {
        "id": 1234,
        "title": "Workplace Safety",
        "klass": "example",
        "template": "example",
        "created": "2026-01-01T00:00:00.000Z",
        "updated": "2026-01-01T00:00:00.000Z"
      }
    }
  ],
  "blocks": [
    {
      "id": 1234,
      "screenId": 1234,
      "uid": "example",
      "type": "example",
      "content": "example",
      "column": 1,
      "row": 1,
      "columnSpan": 1,
      "rowSpan": 1,
      "sequence": 1,
      "revision": 1,
      "questionId": 1234,
      "aiGenerated": "2026-01-01T00:00:00.000Z",
      "created": "2026-01-01T00:00:00.000Z",
      "updated": "2026-01-01T00:00:00.000Z",
      "question": {
        "id": 1234,
        "screenId": 1234,
        "sequence": 1,
        "text": "example",
        "typeId": 1234,
        "sourceId": 1234,
        "caseSensitive": false,
        "serverGraded": false,
        "correct": false,
        "completed": false,
        "matchOptions": [
          "example"
        ],
        "narrationAudioPath": "example",
        "aiGenerated": "2026-01-01T00:00:00.000Z",
        "created": "2026-01-01T00:00:00.000Z",
        "updated": "2026-01-01T00:00:00.000Z",
        "questionType": {
          "id": 1234,
          "title": "Workplace Safety",
          "klass": "example",
          "template": "example",
          "created": "2026-01-01T00:00:00.000Z",
          "updated": "2026-01-01T00:00:00.000Z"
        }
      }
    }
  ]
}
```
