---
title: "PUT /api/v1/layout"
method: PUT
path: "/api/v1/layout"
tags: ["PublicLayout"]
---

# PUT /api/v1/layout

`PUT /api/v1/layout`

## Request

- Base URL: `https://api.habitpocket.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.habitpocket.io/api/v1/layout`
- Auth: API key in header `X-API-KEY`

## Request body

- SetPublicLayoutRequest
  - `sections` SetPublicLayoutSection[], required: Every section, in the order you want them. Get the current one from GET /api/v1/layout.
    - `id` string, uuid, required: Section id.
    - `habitIds` string[], required: The habits in this section, in the order you want them. A habit listed here moves into this section.

## Response `200`

OK

- PublicLayoutModel
  - `sections` PublicLayoutSectionModel[], nullable
    - `id` string, uuid
    - `name` string, nullable
    - `order` integer
    - `habits` PublicLayoutHabitModel[], nullable
      - `id` string, uuid
      - `name` string, nullable
      - `order` integer

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `402`: Payment Required

---

[API](https://skmtc.dev/habitpocket/apis/metricspocket-public-api.md) - [All operations](https://skmtc.dev/habitpocket/apis/metricspocket-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/habitpocket/apis/metricspocket-public-api/revisions/28a2063c7bbe?raw)
