> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flowla.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sections

> Sections are the top-level chapters within a room. Each supports an access level that controls buyer visibility.

## Endpoints

| Method   | Path                                | Description                    |
| -------- | ----------------------------------- | ------------------------------ |
| `GET`    | `/api/v2/sections?roomId={room_id}` | List sections in a room        |
| `POST`   | `/api/v2/sections`                  | Create sections                |
| `PATCH`  | `/api/v2/sections/{section_id}`     | Update a section               |
| `DELETE` | `/api/v2/sections/{section_id}`     | Delete a section and its pages |

## Access levels

| Value        | Behaviour                    |
| ------------ | ---------------------------- |
| `visible`    | Shown to everyone            |
| `restricted` | Requires password or sign-in |
| `locked`     | Visible but not accessible   |
| `hidden`     | Not shown to the buyer       |

***

## List sections

`GET /api/v2/sections?roomId={room_id}`

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.flowla.com/api/v2/sections?roomId=<room_id>" \
    -H "x-flowla-api-key: YOUR_API_KEY"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.flowla.com/api/v2/sections",
      headers={"x-flowla-api-key": "YOUR_API_KEY"},
      params={"roomId": "<room_id>"},
  )
  ```

  ```js JavaScript theme={null}
  const res = await fetch(
    "https://api.flowla.com/api/v2/sections?roomId=<room_id>",
    { headers: { "x-flowla-api-key": "YOUR_API_KEY" } }
  );
  ```
</CodeGroup>

***

## Create sections

`POST /api/v2/sections`

Create one or more sections in a single request.

<ParamField body="roomId" type="string" required>
  The room to add sections to.
</ParamField>

<ParamField body="sections" type="array" required>
  Array of section objects.

  <Expandable title="Section object fields">
    <ParamField body="title" type="string" required>
      Display title of the section.
    </ParamField>

    <ParamField body="access" type="&#x22;visible&#x22; | &#x22;restricted&#x22; | &#x22;locked&#x22; | &#x22;hidden&#x22;">
      Visibility setting. Defaults to `visible`.
    </ParamField>
  </Expandable>
</ParamField>

```json Example theme={null}
{
  "roomId": "<room_id>",
  "sections": [
    { "title": "Introduction", "access": "visible" },
    { "title": "Pricing", "access": "visible" },
    { "title": "Internal Notes", "access": "hidden" }
  ]
}
```

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.flowla.com/api/v2/sections \
    -H "x-flowla-api-key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "roomId": "<room_id>",
      "sections": [
        { "title": "Introduction", "access": "visible" },
        { "title": "Pricing", "access": "visible" }
      ]
    }'
  ```

  ```python Python theme={null}
  requests.post(
      "https://api.flowla.com/api/v2/sections",
      headers={"x-flowla-api-key": "YOUR_API_KEY"},
      json={
          "roomId": "<room_id>",
          "sections": [
              {"title": "Introduction", "access": "visible"},
              {"title": "Pricing", "access": "visible"},
          ],
      },
  )
  ```

  ```js JavaScript theme={null}
  await fetch("https://api.flowla.com/api/v2/sections", {
    method: "POST",
    headers: {
      "x-flowla-api-key": "YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      roomId: "<room_id>",
      sections: [
        { title: "Introduction", access: "visible" },
        { title: "Pricing", access: "visible" },
      ],
    }),
  });
  ```
</CodeGroup>

***

## Update a section

`PATCH /api/v2/sections/{section_id}`

<ParamField body="title" type="string">
  New display title.
</ParamField>

<ParamField body="access" type="&#x22;visible&#x22; | &#x22;restricted&#x22; | &#x22;locked&#x22; | &#x22;hidden&#x22;">
  New access level.
</ParamField>

```json Example theme={null}
{ "title": "New Title", "access": "visible" }
```

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PATCH https://api.flowla.com/api/v2/sections/<section_id> \
    -H "x-flowla-api-key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"title": "New Title", "access": "visible"}'
  ```

  ```python Python theme={null}
  requests.patch(
      "https://api.flowla.com/api/v2/sections/<section_id>",
      headers={"x-flowla-api-key": "YOUR_API_KEY"},
      json={"title": "New Title", "access": "visible"},
  )
  ```
</CodeGroup>

***

## Delete a section

`DELETE /api/v2/sections/{section_id}`

<Warning>
  Deletes the section and all its pages, groups, and blocks permanently.
</Warning>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE https://api.flowla.com/api/v2/sections/<section_id> \
    -H "x-flowla-api-key: YOUR_API_KEY"
  ```

  ```python Python theme={null}
  requests.delete(
      "https://api.flowla.com/api/v2/sections/<section_id>",
      headers={"x-flowla-api-key": "YOUR_API_KEY"},
  )
  ```
</CodeGroup>
