# Retrieve a custom code block

`GET https://api.cademi.com.br/api/v3/settings/custom-code/{custom_code_id}`

Operation ID: `custom_code.get` · API v3

Retrieves a custom code block by its public ID, including blocks in the trash.

The block metadata is always returned. The `content` object (`header`, `body`, `sw_js`, and `manifest_json`) is included only when the credentials also have the `custom_code.read_content` permission, because code content often contains third-party tokens.

The response includes an `ETag` representing the current revision. Send this value in the `If-Match` header when updating the block to avoid overwriting a newer version.

Required permissions: `custom_code.read`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `custom_code_id` | path | string | yes |  |

## Responses

### 200

Returns the requested custom code block.

Body: `data`: CustomCode.

Fields of CustomCode:

| Field | Type | Required | Description |
|---|---|---|---|
| `content` | object or null | no | Code content. Returned only when retrieving a single custom code block with a credential that has the customcode.readcontent permission. |
| `created_at` | string (date-time) | yes |  |
| `deleted` | boolean | yes |  |
| `id` | string | yes |  |
| `name` | string | yes |  |
| `object` | string, one of `custom_code` | yes |  |
| `position` | string, one of `head`, `body` | yes |  |
| `revision` | string | yes |  |
| `status` | string, one of `active`, `inactive` | yes |  |
| `type` | string, one of `active-campaign`, `custom`, `facebook-pixel`, `analytics`, `tagmanager`, `pushalertco`, `whats` | yes |  |
| `updated_at` | string (date-time) | yes |  |

### 401

The credential is missing, malformed, expired, or revoked.

Body: Error.

### 403

The current credentials do not have the permission required by this operation.

Body: Error.

### 404

The custom code block was not found or is not accessible with the current credentials.

Body: Error.

Full schema: https://cademi.dev/openapi/v3.json
