---
updatedAt: 2026-01-27T17:50:39.000Z
---

Fetch the complete documentation index at: https://docs.blockdaemon.com/llms.txt. Use this file to discover all available pages before exploring further. Append .md to any documentation page URL to get its markdown version.

# Step 3. Create a Variable

Create a variable to monitor transactions for specific wallets or addresses.

> ❗️ Important Note
>
> Each call incurs a fixed CU charge, plus additional CUs for API operations. See the [Compute Units Usage](https://docs.blockdaemon.com/reference/compute-units-usage-events) page for details.

As outlined in the [Introduction page](https://docs.blockdaemon.com/docs/overview-events), event streaming supports two variable types:

* `address`, which will produce `confirmed_tx` and `confirmed_balance`.
* `event_type`, which will produce `block`.

Both variables return an `id` which is the unique identifier of the resource. We need this `id` for two reasons:

* To reference the variables used in a rule.
* To add values to a variable.

In this step, we'll create a variable of type `address`.

### Request Payload

```curl
curl --location 'https://svc.blockdaemon.com/streaming/v2/variables' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '   
		{
        "description": "Polkadot mainnet addresses",
        "name": "Polkadot mainnet addresses",
        "type": "string"
    }'
```

### Response Payload

A successful response will return a "201 - Created" status with the variable details.

```json 201 - Created
{
    "created_at": "2024-03-06T14:44:40.940488Z",
    "description": "Polkadot mainnet addresses",
    "id": "3c1c1483-d8e0-4ecb-95a0-1e18a5d03244",
    "name": "Polkadot mainnet addresses",
    "type": "string",
    "updated_at": "2024-03-06T14:44:40.940488Z"
}
```

<br />

***

## Managing Variable

### [Update a Variable](https://docs.blockdaemon.com/reference/update-variable)

Update an existing variable using its ID. All fields in the request body will replace the existing values.

**Example Payload**

```curl Request Payload
curl --request PUT \
     --url https://svc.blockdaemon.com/streaming/v2/variables/{VARIABLE ID HERE} \
     --header 'accept: application/json' \
     --header 'authorization: Bearer YOUR_API_KEY' \
     --header 'content-type: application/json' \
     --data '
{
  "name": "new name",
  "description": "new description",
  "type": "string | number | bool"
}
'
```
```json Response Payload
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "name": "new name",
  "description": "new description",
  "type": "string",
  "created_at": "2025-08-05T14:26:13.150Z",
  "updated_at": "2025-08-05T14:26:13.150Z"
}
```

***

### [Delete a Variable](https://docs.blockdaemon.com/reference/delete-variable)

Delete a variable by its ID. This action cannot be undone.

**Example Payload**

```curl Request Payload
curl --request DELETE \
     --url https://svc.blockdaemon.com/streaming/v2/variables/{VARIABLE ID HERE} \
     --header 'accept: application/json' \
     --header 'authorization: Bearer YOUR_API_KEY'
```
```Text Response Payload
A 204 response status indicates the variable was successfully deleted.
```

<br />

## 👋 Need Help?

Contact us through [email](mailto:support@blockdaemon.com) or our [support page](https://www.blockdaemon.com/support) for any issues, bugs, or assistance you may need.