---
title: "Create or update a custom block"
method: POST
path: "/blocks"
tags: ["Block"]
---

# Create or update a custom block

`POST /blocks`

## Request

- Base URL: `https://api.recordedfuture.com/fusion/v3`
- URL: `https://api.recordedfuture.com/fusion/v3/blocks`
- Auth: one of:
  - API key in header `X-RFToken`
  - OAuth 2
    - Authorization code: `https://id.recordedfuture.com/authorize`
    - Token URL: `https://id.recordedfuture.com/token`

Creates or updates a custom block, restricted to internal Recorded Future users with special privileges.

## Request body

- CustomBlock: Custom block used for running Python code. Requires special privileges to use.
  - `id` string: Id of the custom block, used to chain this block to another. Must match regex [a-z0-9_]+
  - `description` string, required
  - `script` string, required: Stringified Python code
  - `params` object[]
    - `name` string
    - `required` boolean
    - `default_value` string: The default value of the parameter, can be anything
  - `inputs` object[]
    - `name` string
    - `required` boolean
    - `singleton` boolean: Flag to indicate if this is the only input

## Response `200`

The added custom block

- CustomBlock: Custom block used for running Python code. Requires special privileges to use.
  - `id` string: Id of the custom block, used to chain this block to another. Must match regex [a-z0-9_]+
  - `description` string, required
  - `script` string, required: Stringified Python code
  - `params` object[]
    - `name` string
    - `required` boolean
    - `default_value` string: The default value of the parameter, can be anything
  - `inputs` object[]
    - `name` string
    - `required` boolean
    - `singleton` boolean: Flag to indicate if this is the only input

---

[API](https://skmtc.dev/recordedfuture/apis/fusion-api.md) - [All operations](https://skmtc.dev/recordedfuture/apis/fusion-api/llms.txt) - [OpenAPI document](https://skmtc.dev/recordedfuture/apis/fusion-api/revisions/15e440739cf0?raw)
