# Create a log

_Observability / Logs_

`POST /logs/{bucketId}`

## Parameters

- `timeStamp` (number, required) — Error's Unix time
- `level` (string, required) — The level of the Error
- `message` (string, required) — The Error message
- `machineName` (string, optional) — Host name where error occured
- `eventId` (number, optional)
- `appName` (string, required) — Service name
- `env` (string, optional) — Environment
- `appVersion` (string, optional)
- `runtimeVersion` (string, optional)
- `runtime` (number, optional)

## Responses

### `201` — Log created successfully

Type: `GenericResultResponse<bool>`



## Code Examples

### curl

```curl
curl --request POST \
  --url https://apis-spb.konso.io/logs/{bucketId} \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: {your-api-key}' \
  --data '{
    "name": "My Category",
    "slug": "my-category",
    "section": 1,
    "imageUrl": "https://example.com/image.jpg"
  }'
```

### javascript

```js
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': '{your-api-key}'
  },
  body: JSON.stringify({
    name: 'My Category',
    slug: 'my-category',
    section: 1,
    imageUrl: 'https://example.com/image.jpg'
  })
};

fetch('https://apis-spb.konso.io/logs/{bucketId}', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
```

### Request Body Example

```json
{
  "timeStamp": 1786438146541,
  "level": "error",
  "message": "Example message",
  "machineName": "Example Name",
  "eventId": 12345,
  "appName": "Example Name",
  "env": "production",
  "appVersion": "1.0.0",
  "runtimeVersion": "1.0.0",
  "runtime": 42
}
```

### Response Example (201)

```json
{
  "result": true
}
```
