---
title: "Créer un template de bloc"
method: POST
path: "/api/blocks"
tags: ["Blocs"]
---

# Créer un template de bloc

`POST /api/blocks`

## Request

- Base URL: `https://lucidnest.test`
- URL: `https://lucidnest.test/api/blocks`
- Auth: HTTP bearer

Crée un nouveau template dans la bibliothèque de blocs.

## Request body

- object
  - `name` string, required: Le champ value ne peut pas dépasser 255 caractères.
  - `description` string, nullable: Le champ value ne peut pas dépasser 1000 caractères.
  - `category` string, required: Le champ value ne peut pas dépasser 50 caractères.
  - `icon` string, nullable: Le champ value ne peut pas dépasser 50 caractères.
  - `color` string, nullable: Le champ value ne peut pas dépasser 20 caractères.
  - `default_data` object, nullable
  - `default_style` object, nullable
  - `is_public` boolean
  - `type` 'block' | 'note_template', nullable
  - `content_html` string, nullable
  - `default_title` string, nullable: Le champ value ne peut pas dépasser 255 caractères.
  - `is_active` boolean
  - `metadata` object, nullable
    - `isTodo` boolean, nullable
    - `defaultPriority` 'urgent' | 'demain' | 'cette_semaine' | 'optionnel' | 'en_pause' | 'must' | 'should' | 'want' | 'high' | 'medium' | 'low', nullable
    - `defaultTags` string[]: Le champ value ne peut pas dépasser 50 caractères.

## Response `201`

- object
  - `uuid` string
  - `name` string
  - `category` string
  - `user_id` integer

---

[API](https://skmtc.dev/lucidnest/apis/lucidnest-api-documentation.md) · [All operations](https://skmtc.dev/lucidnest/apis/lucidnest-api-documentation/llms.txt) · [OpenAPI document](https://skmtc.dev/lucidnest/apis/lucidnest-api-documentation/revisions/38638944c947?raw)
