# 创建事件级变量

> 创建事件级变量，目前仅支持创建，不支持修改，如需修改，请到 GrowingIO 平台管理界面修改。

## URL

`https://www.growingio.com/v1/api/projects/{project_uid}/vars/events`

## 请求类型

POST

## 请求头参数

公共头部请参考[公共请求头参数](https://growingio.gitbook.io/v3/developer-manual/api-reference/authenticate)。

## 参数说明与示例

{% tabs %}
{% tab title="请求参数" %}

| 路径参数         | 类型     | 是否必传 | 说明     |
| ------------ | ------ | ---- | ------ |
| project\_uid | string | 是    | 项目UID。 |

| body参数 | 类型 | 是否必传 | 说明 |
| ------ | -- | ---- | -- |

| name | string | 是 | 变量名称，最大长度为30 |
| ---- | ------ | - | ------------ |

| key | string | 是 | 变量标识符，只允许以字母获下划线开头，包含下划线、字码、数字的字符串，最大长度为30 |
| --- | ------ | - | ------------------------------------------ |

| type | string | 否 | <p>变量类型。</p><ul><li>string</li><li>int</li><li>double</li></ul><p>默认为string。</p> |
| ---- | ------ | - | -------------------------------------------------------------------------------- |

| description  | string | 否 | 变量描述，最大长度150。 |
| ------------ | ------ | - | ------------- |
| {% endtab %} |        |   |               |

{% tab title="返回示例" %}
200: OK
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://growingio.gitbook.io/v3/developer-manual/api-reference/project-manage/create-cstm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
