# Logs

## API Endpoint

URL: [https://api.fivemerr.com/v1/logs](< https://api.fivemerr.com/v1/logs>)

## Authorization

You can access the API using one of the following methods:

* Include the `Authorization` header with your API key.
* Include the `apiKey` as a query parameter in the URL.

## Body

The request body should be a JSON object containing the following keys:

* **level** (required): A string. Recommended values include:
  * `info`
  * `warn`
  * `error`
  * `fatal`
  * `debug`
* **message** (required): A string.
* **resource** (optional): A string.
* **metadata** (optional): A JSON object of any shape.

### **Example**

```json5
{
    "level": "fatal",
    "message": "Something went wrong in the server",
    "resource": "core",
    "metadata": {
        "server": "Primary",
        "team": "unknown"
    }
}
```

## Example with Node.js (with Axios)

```javascript
const axios = require('axios');

const data = {
    "level": "fatal",
    "message": "Something went wrong in the server",
    "resource": "core", // optional
    "metadata": { // optional
        "server": "Primary",
        "team": "unknown"
    }
}

const config = {
  method: 'post',
  url: 'https://api.fivemerr.com/v1/logs',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': '••••••'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(response.data);
})
.catch((error) => {
  console.log(error);
});

```


---

# 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://docs.fivemerr.com/api/logs.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.
