> 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.console/templates/events/custom-events/events--how-to-log-events.md).

# How to Send/Log Events

## Send events using Firmware API

If you need to log an Event when the sensor detects temperature over a certain threshold:

1. Create a new Event named `High temperature` with code `high_temp`
2. Use the `Blynk.logEvent(event_code)` firmware API command to trigger new event

```cpp
if (temperature > 35)
{
   Blynk.logEvent("high_temp");
}
```

When this code worked, an Event will be logged and the system will act accordingly to the Event setup (render on timeline, send notifications, etc.)

### Custom Event Description

You can change the description of the event when it's rendered on the timeline in Blynk.Console and in Blynk.Apps.

```cpp
if (temperature > 35)
{
  Blynk.logEvent("event_code", String("High TemperatureDetected! Tº: ") + temp);
}
```

{% hint style="warning" %}
Make sure you enabled [Timeline recording](https://docs.blynk.io/en/blynk.console/templates/events/custom-events/events-general-setting.md#show-event-on-the-timeline) in the Event Settings to see the result in the apps
{% endhint %}

## Send events using HTTPS API

To log an event use this request

```
`/external/api/logEvent?token={AuthToken}&code={event_code}
```

```
`/external/api/logEvent?token={token}&code={event_code}&description={event_description}
```

```
/external/api/logEvent?token={device_token}&code={event_code}&description={event_desciption}
```

`description` is an optional parameter where you can attach additional information to be rendered on the Timeline along with the event.

For example:

```
https://my.server.com/external/api/logEvent?token=Q9qdlGahPuFuCfncrT35QutT7s3HjYFy&code=high_temp
```


---

# 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.console/templates/events/custom-events/events--how-to-log-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.
