---
title: "Create Block Type"
method: POST
path: "/api/block_types/"
tags: ["Block types"]
---

# Create Block Type

`POST /api/block_types/`

## Request

- The document declares no server URL.
- Auth: none declared

Create a new block type

## Headers

- `x-prefect-api-version` string

## Request body

- BlockTypeCreate: Data used by the Prefect REST API to create a block type.
  - `name` string, required: A block type's name
  - `slug` string, required: A block type's slug
  - `logo_url` string, uri: Web URL for the block type's logo
  - `documentation_url` string, uri: Web URL for the block type's documentation
  - `description` string: A short blurb about the corresponding block's intended use
  - `code_example` string: A code snippet demonstrating use of the corresponding block

## Response `201`

Successful Response

- BlockType: An ORM representation of a block type
  - `id` string, uuid
  - `created` string, date-time
  - `updated` string, date-time
  - `name` string, required: A block type's name
  - `slug` string, required: A block type's slug
  - `logo_url` string, uri: Web URL for the block type's logo
  - `documentation_url` string, uri: Web URL for the block type's documentation
  - `description` string: A short blurb about the corresponding block's intended use
  - `code_example` string: A code snippet demonstrating use of the corresponding block
  - `is_protected` boolean: Protected block types cannot be modified via API.

## Other responses

- `422`: Validation Error

## Changes

- **2024-04-03** `93ae2b3f2efd`: 2 breaking
  - the request property `name` became required
  - the request property `slug` became required

[Operation history](https://skmtc.dev/prefecthq/apis/prefect-unreleased-api/changes/api/block_types/post.md)

---

[API](https://skmtc.dev/prefecthq/apis/prefect-unreleased-api.md) - [All operations](https://skmtc.dev/prefecthq/apis/prefect-unreleased-api/llms.txt) - [OpenAPI document](https://skmtc.dev/prefecthq/apis/prefect-unreleased-api/revisions/29ba6c4f8837?raw)
