> For the complete documentation index, see [llms.txt](https://docs.blynk.io/en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.blynk.io/en/blynk.cloud/platform-https-api/template-events.md).

# Template Events

Template event management

## Get template events

> Retrieve all events defined in a template.\
> \
> Required permissions, when user-scoped authentication is used: \`PRODUCT\_VIEW\`.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"Template Events","description":"Template event management"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"TemplateEvent":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Event ID"},"name":{"type":"string","description":"Event name"},"eventCode":{"type":"string","description":"Event code for triggering"},"type":{"type":"string","description":"Event type","enum":["ONLINE","OFFLINE","INFORMATION","WARNING","CRITICAL","CONTENT","INACTIVE","LIFECYCLE","NOTE"]},"color":{"type":"string","description":"Event color in HEX format"},"description":{"type":"string","description":"Event description"},"showInTimeline":{"type":"boolean","description":"Whether the event is displayed in the timeline widget"},"showInNotifications":{"type":"boolean","description":"Whether the event is listed in the notifications section of the app.\nIt does not send an email, push or SMS, see `notifications` for that.\n"},"notifications":{"$ref":"#/components/schemas/TemplateEventNotifications"},"eventCondition":{"$ref":"#/components/schemas/TemplateEventCondition"}},"required":["id","name","type"]},"TemplateEventNotifications":{"type":"object","description":"Who gets an email, push or SMS when the event is logged, and how often (the Notifications and\nLimits sections of the event in the Console). Recipients are IDs of template metafields: the\nDevice Owner metafield, or a Contact metafield with email enabled. Empty recipient lists are\nomitted from responses.\n","properties":{"enabled":{"type":"boolean","description":"Whether the event sends notifications to the recipients","default":false},"emailRecipients":{"type":"array","description":"Metafield IDs whose users receive an email","items":{"type":"integer","format":"int32"}},"pushRecipients":{"type":"array","description":"Metafield IDs whose users receive a push notification","items":{"type":"integer","format":"int32"}},"smsRecipients":{"type":"array","description":"Metafield IDs whose users receive an SMS","items":{"type":"integer","format":"int32"}},"managementEnabled":{"type":"boolean","description":"Whether end-users can change the notification settings of this event for their devices","default":false},"limitPeriod":{"type":"integer","format":"int64","minimum":0,"description":"Limit Period in milliseconds. At most one notification is sent per this period, 0 means no limit.","default":0},"eventCounter":{"type":"integer","format":"int32","minimum":1,"description":"Event Counter. A notification is sent only after this many events have been logged.","default":1}}},"TemplateEventCondition":{"type":"object","description":"Logs the event automatically each time the value reported to the datastream starts matching the condition.\n`LOCATION` datastreams can't be used, and only `STR_EQUAL` / `STR_NOT_EQUAL` apply to non-numeric datastreams.\n","properties":{"dataStreamId":{"type":"integer","format":"int32","description":"ID of the template datastream whose value is checked"},"condition":{"type":"object","properties":{"type":{"type":"string","description":"Numbers are compared in the unit of the datastream. `ANY` and `CHANGED` can be returned for\nconditions set elsewhere, but are rejected in requests.\n","enum":["GT","GTE","LT","LTE","EQ","NEQ","BETWEEN","NOT_BETWEEN","STR_EQUAL","STR_NOT_EQUAL","ANY","CHANGED"]},"value":{"description":"Compared value, a number for `GT`, `GTE`, `LT`, `LTE`, `EQ`, `NEQ` and a string for `STR_EQUAL`,\n`STR_NOT_EQUAL`. Can be omitted when `valueDataStreamId` is set.\n","oneOf":[{"type":"number"},{"type":"string"}]},"left":{"type":"number","description":"Lower bound for `BETWEEN` and `NOT_BETWEEN`, must not be greater than `right`.\nCan be omitted when `leftDataStreamId` is set.\n"},"right":{"type":"number","description":"Upper bound for `BETWEEN` and `NOT_BETWEEN`. Can be omitted when `rightDataStreamId` is set.\n"}},"required":["type"]},"valueDataStreamId":{"type":"integer","format":"int32","description":"Datastream whose current value is used instead of `condition.value`"},"leftDataStreamId":{"type":"integer","format":"int32","description":"Datastream whose current value is used instead of `condition.left`"},"rightDataStreamId":{"type":"integer","format":"int32","description":"Datastream whose current value is used instead of `condition.right`"}},"required":["dataStreamId","condition"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/template/events":{"get":{"tags":["Template Events"],"summary":"Get template events","description":"Retrieve all events defined in a template.\n\nRequired permissions, when user-scoped authentication is used: `PRODUCT_VIEW`.\n","operationId":"getTemplateEvents","parameters":[{"name":"templateId","in":"query","required":true,"schema":{"type":"integer","format":"int32"},"description":"Template ID"}],"responses":{"200":{"description":"List of events","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TemplateEvent"}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden"},"404":{"description":"Template not found or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Create template event

> Add a new event to a template.\
> \
> Only the original (root) template can be edited (the one with \`parentId = null\`).\
> Sub-organizations cannot modify templates that were created by a parent organization.\
> Event names and codes must be unique within the template.\
> \
> Required permissions, when user-scoped authentication is used: \`PRODUCT\_EDIT\`.\
> Also, when the user-scoped authentication is used, user should have developer mode enabled.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"Template Events","description":"Template event management"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"TemplateEventNotifications":{"type":"object","description":"Who gets an email, push or SMS when the event is logged, and how often (the Notifications and\nLimits sections of the event in the Console). Recipients are IDs of template metafields: the\nDevice Owner metafield, or a Contact metafield with email enabled. Empty recipient lists are\nomitted from responses.\n","properties":{"enabled":{"type":"boolean","description":"Whether the event sends notifications to the recipients","default":false},"emailRecipients":{"type":"array","description":"Metafield IDs whose users receive an email","items":{"type":"integer","format":"int32"}},"pushRecipients":{"type":"array","description":"Metafield IDs whose users receive a push notification","items":{"type":"integer","format":"int32"}},"smsRecipients":{"type":"array","description":"Metafield IDs whose users receive an SMS","items":{"type":"integer","format":"int32"}},"managementEnabled":{"type":"boolean","description":"Whether end-users can change the notification settings of this event for their devices","default":false},"limitPeriod":{"type":"integer","format":"int64","minimum":0,"description":"Limit Period in milliseconds. At most one notification is sent per this period, 0 means no limit.","default":0},"eventCounter":{"type":"integer","format":"int32","minimum":1,"description":"Event Counter. A notification is sent only after this many events have been logged.","default":1}}},"TemplateEventCondition":{"type":"object","description":"Logs the event automatically each time the value reported to the datastream starts matching the condition.\n`LOCATION` datastreams can't be used, and only `STR_EQUAL` / `STR_NOT_EQUAL` apply to non-numeric datastreams.\n","properties":{"dataStreamId":{"type":"integer","format":"int32","description":"ID of the template datastream whose value is checked"},"condition":{"type":"object","properties":{"type":{"type":"string","description":"Numbers are compared in the unit of the datastream. `ANY` and `CHANGED` can be returned for\nconditions set elsewhere, but are rejected in requests.\n","enum":["GT","GTE","LT","LTE","EQ","NEQ","BETWEEN","NOT_BETWEEN","STR_EQUAL","STR_NOT_EQUAL","ANY","CHANGED"]},"value":{"description":"Compared value, a number for `GT`, `GTE`, `LT`, `LTE`, `EQ`, `NEQ` and a string for `STR_EQUAL`,\n`STR_NOT_EQUAL`. Can be omitted when `valueDataStreamId` is set.\n","oneOf":[{"type":"number"},{"type":"string"}]},"left":{"type":"number","description":"Lower bound for `BETWEEN` and `NOT_BETWEEN`, must not be greater than `right`.\nCan be omitted when `leftDataStreamId` is set.\n"},"right":{"type":"number","description":"Upper bound for `BETWEEN` and `NOT_BETWEEN`. Can be omitted when `rightDataStreamId` is set.\n"}},"required":["type"]},"valueDataStreamId":{"type":"integer","format":"int32","description":"Datastream whose current value is used instead of `condition.value`"},"leftDataStreamId":{"type":"integer","format":"int32","description":"Datastream whose current value is used instead of `condition.left`"},"rightDataStreamId":{"type":"integer","format":"int32","description":"Datastream whose current value is used instead of `condition.right`"}},"required":["dataStreamId","condition"]},"TemplateEvent":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Event ID"},"name":{"type":"string","description":"Event name"},"eventCode":{"type":"string","description":"Event code for triggering"},"type":{"type":"string","description":"Event type","enum":["ONLINE","OFFLINE","INFORMATION","WARNING","CRITICAL","CONTENT","INACTIVE","LIFECYCLE","NOTE"]},"color":{"type":"string","description":"Event color in HEX format"},"description":{"type":"string","description":"Event description"},"showInTimeline":{"type":"boolean","description":"Whether the event is displayed in the timeline widget"},"showInNotifications":{"type":"boolean","description":"Whether the event is listed in the notifications section of the app.\nIt does not send an email, push or SMS, see `notifications` for that.\n"},"notifications":{"$ref":"#/components/schemas/TemplateEventNotifications"},"eventCondition":{"$ref":"#/components/schemas/TemplateEventCondition"}},"required":["id","name","type"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/template/event/create":{"post":{"tags":["Template Events"],"summary":"Create template event","description":"Add a new event to a template.\n\nOnly the original (root) template can be edited (the one with `parentId = null`).\nSub-organizations cannot modify templates that were created by a parent organization.\nEvent names and codes must be unique within the template.\n\nRequired permissions, when user-scoped authentication is used: `PRODUCT_EDIT`.\nAlso, when the user-scoped authentication is used, user should have developer mode enabled.\n","operationId":"createTemplateEvent","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"productId":{"type":"integer","format":"int32","description":"Template ID"},"type":{"type":"string","description":"Event type","enum":["INFORMATION","WARNING","CRITICAL","CONTENT","NOTE"]},"name":{"type":"string","description":"Event name. Can only contain letters, digits, spaces, underscores, backslashes and punctuations.","maxLength":200,"minLength":1},"code":{"type":"string","description":"Event code for triggering. Can only contain letters, digits, underscores and hyphens.","maxLength":200,"minLength":1},"color":{"type":"string","description":"Event color in HEX format (e.g.","minLength":1,"maxLength":200},"description":{"type":"string","description":"Event description.","maxLength":1024},"showInTimeline":{"type":"boolean","description":"Whether the event should be displayed in the timeline widget"},"showInNotifications":{"type":"boolean","description":"Whether the event is listed in the notifications section of the app. It does not send an email,\npush or SMS, see `notifications` for that.\n","default":true},"notifications":{"allOf":[{"$ref":"#/components/schemas/TemplateEventNotifications"}],"description":"Omit to create an event that sends no notifications."},"eventCondition":{"allOf":[{"$ref":"#/components/schemas/TemplateEventCondition"}],"description":"Omit to create an event that is logged only when the device sends it."}},"required":["productId","type","name","code","color"]}}}},"responses":{"201":{"description":"Event created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateEvent"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Template not found or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Update template event

> Update an event in a template.\
> \
> Only the original (root) template can be edited (the one with \`parentId = null\`).\
> Sub-organizations cannot modify templates that were created by a parent organization.\
> Event names and codes must be unique within the template.\
> The event's own current name and code can be sent again unchanged.\
> \
> Required permissions, when user-scoped authentication is used: \`PRODUCT\_EDIT\`.\
> Also, when the user-scoped authentication is used, user should have developer mode enabled.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"Template Events","description":"Template event management"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"TemplateEventNotifications":{"type":"object","description":"Who gets an email, push or SMS when the event is logged, and how often (the Notifications and\nLimits sections of the event in the Console). Recipients are IDs of template metafields: the\nDevice Owner metafield, or a Contact metafield with email enabled. Empty recipient lists are\nomitted from responses.\n","properties":{"enabled":{"type":"boolean","description":"Whether the event sends notifications to the recipients","default":false},"emailRecipients":{"type":"array","description":"Metafield IDs whose users receive an email","items":{"type":"integer","format":"int32"}},"pushRecipients":{"type":"array","description":"Metafield IDs whose users receive a push notification","items":{"type":"integer","format":"int32"}},"smsRecipients":{"type":"array","description":"Metafield IDs whose users receive an SMS","items":{"type":"integer","format":"int32"}},"managementEnabled":{"type":"boolean","description":"Whether end-users can change the notification settings of this event for their devices","default":false},"limitPeriod":{"type":"integer","format":"int64","minimum":0,"description":"Limit Period in milliseconds. At most one notification is sent per this period, 0 means no limit.","default":0},"eventCounter":{"type":"integer","format":"int32","minimum":1,"description":"Event Counter. A notification is sent only after this many events have been logged.","default":1}}},"TemplateEventCondition":{"type":"object","description":"Logs the event automatically each time the value reported to the datastream starts matching the condition.\n`LOCATION` datastreams can't be used, and only `STR_EQUAL` / `STR_NOT_EQUAL` apply to non-numeric datastreams.\n","properties":{"dataStreamId":{"type":"integer","format":"int32","description":"ID of the template datastream whose value is checked"},"condition":{"type":"object","properties":{"type":{"type":"string","description":"Numbers are compared in the unit of the datastream. `ANY` and `CHANGED` can be returned for\nconditions set elsewhere, but are rejected in requests.\n","enum":["GT","GTE","LT","LTE","EQ","NEQ","BETWEEN","NOT_BETWEEN","STR_EQUAL","STR_NOT_EQUAL","ANY","CHANGED"]},"value":{"description":"Compared value, a number for `GT`, `GTE`, `LT`, `LTE`, `EQ`, `NEQ` and a string for `STR_EQUAL`,\n`STR_NOT_EQUAL`. Can be omitted when `valueDataStreamId` is set.\n","oneOf":[{"type":"number"},{"type":"string"}]},"left":{"type":"number","description":"Lower bound for `BETWEEN` and `NOT_BETWEEN`, must not be greater than `right`.\nCan be omitted when `leftDataStreamId` is set.\n"},"right":{"type":"number","description":"Upper bound for `BETWEEN` and `NOT_BETWEEN`. Can be omitted when `rightDataStreamId` is set.\n"}},"required":["type"]},"valueDataStreamId":{"type":"integer","format":"int32","description":"Datastream whose current value is used instead of `condition.value`"},"leftDataStreamId":{"type":"integer","format":"int32","description":"Datastream whose current value is used instead of `condition.left`"},"rightDataStreamId":{"type":"integer","format":"int32","description":"Datastream whose current value is used instead of `condition.right`"}},"required":["dataStreamId","condition"]},"TemplateEvent":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Event ID"},"name":{"type":"string","description":"Event name"},"eventCode":{"type":"string","description":"Event code for triggering"},"type":{"type":"string","description":"Event type","enum":["ONLINE","OFFLINE","INFORMATION","WARNING","CRITICAL","CONTENT","INACTIVE","LIFECYCLE","NOTE"]},"color":{"type":"string","description":"Event color in HEX format"},"description":{"type":"string","description":"Event description"},"showInTimeline":{"type":"boolean","description":"Whether the event is displayed in the timeline widget"},"showInNotifications":{"type":"boolean","description":"Whether the event is listed in the notifications section of the app.\nIt does not send an email, push or SMS, see `notifications` for that.\n"},"notifications":{"$ref":"#/components/schemas/TemplateEventNotifications"},"eventCondition":{"$ref":"#/components/schemas/TemplateEventCondition"}},"required":["id","name","type"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/template/event":{"put":{"tags":["Template Events"],"summary":"Update template event","description":"Update an event in a template.\n\nOnly the original (root) template can be edited (the one with `parentId = null`).\nSub-organizations cannot modify templates that were created by a parent organization.\nEvent names and codes must be unique within the template.\nThe event's own current name and code can be sent again unchanged.\n\nRequired permissions, when user-scoped authentication is used: `PRODUCT_EDIT`.\nAlso, when the user-scoped authentication is used, user should have developer mode enabled.\n","operationId":"updateTemplateEvent","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"productId":{"type":"integer","format":"int32","description":"Template ID"},"id":{"type":"integer","format":"int32","description":"Event ID, that should be updated"},"type":{"type":"string","description":"Event type","enum":["INFORMATION","WARNING","CRITICAL","CONTENT","NOTE"]},"name":{"type":"string","description":"Event name. Can only contain letters, digits, spaces, underscores, backslashes and punctuations.","maxLength":200,"minLength":1},"code":{"type":"string","description":"Event code for triggering. Can only contain letters, digits, underscores and hyphens.","maxLength":200,"minLength":1},"color":{"type":"string","description":"Event color in HEX format (e.g.","minLength":1,"maxLength":200},"description":{"type":"string","description":"Event description.","maxLength":1024},"showInTimeline":{"type":"boolean","description":"Whether the event should be displayed in the timeline widget"},"showInNotifications":{"type":"boolean","description":"Whether the event is listed in the notifications section of the app. It does not send an email,\npush or SMS, see `notifications` for that. Omit to keep the current value.\n"},"notifications":{"allOf":[{"$ref":"#/components/schemas/TemplateEventNotifications"}],"description":"Replaces the notification settings of the event. Omit to keep the current ones."},"eventCondition":{"allOf":[{"$ref":"#/components/schemas/TemplateEventCondition"}],"nullable":true,"description":"Replaces the condition of the event. Omit to keep the current one, set to `null` to remove it."}},"required":["productId","id","type","name","code","color"]}}}},"responses":{"200":{"description":"Event updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateEvent"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Template/event not found or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Delete template event

> Remove an event from a template.\
> \
> Only the original (root) template can be edited (the one with \`parentId = null\`).\
> Sub-organizations cannot modify templates that were created by a parent organization.\
> \
> Required permissions, when user-scoped authentication is used: \`PRODUCT\_EDIT\`.\
> Also, when the user-scoped authentication is used, user should have developer mode enabled.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"Template Events","description":"Template event management"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/template/event":{"delete":{"tags":["Template Events"],"summary":"Delete template event","description":"Remove an event from a template.\n\nOnly the original (root) template can be edited (the one with `parentId = null`).\nSub-organizations cannot modify templates that were created by a parent organization.\n\nRequired permissions, when user-scoped authentication is used: `PRODUCT_EDIT`.\nAlso, when the user-scoped authentication is used, user should have developer mode enabled.\n","operationId":"deleteTemplateEvent","parameters":[{"name":"templateId","in":"query","required":true,"schema":{"type":"integer","format":"int32"},"description":"Template ID"},{"name":"eventId","in":"query","required":true,"schema":{"type":"integer","format":"int32"},"description":"Event ID"}],"responses":{"204":{"description":"Event deleted successfully"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Template/event not found or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.blynk.io/en/blynk.cloud/platform-https-api/template-events.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
