# Create Log

<mark style="color:green;">`POST`</mark> `/api/v1/log/create`

The most important endpoint is the create log.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

| Name                | Type   | Description                                                                                                                  |
| ------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------- |
| `channel_id`        | string | The ID of the channel you'll like a log assigned to. This can be found in the URL of the channel.                            |
| `reference`         | string | Log reference e.g. your users ID or session ID.                                                                              |
| `label`             | string | Label text.                                                                                                                  |
| `body`              | string | Body text.                                                                                                                   |
| `type`              | string | page\_view, action, success, error, information                                                                              |
| `alert`             | bool   | Send alert?                                                                                                                  |
| `tags`              | string | Comma delimited list of tags.                                                                                                |
| `custom_references` | array  | A `key => value` array of customer references for this log. Key is the name and value is the value of that custom reference. |

**Response**

We'll return a HTTP 202 response.

{% tabs %}
{% tab title="202" %}

```json
{}
```

{% 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://logwire.gitbook.io/logwire/log/create-log.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.
