> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appsignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# HTTP-JSON Configuration

<Warning>
  🔐 Do not send <strong>Personal Identifiable Information (PII)</strong> to AppSignal. Filter PII (e.g., names, emails) from logs and use an ID, hash, or pseudonymized identifier instead. <br /> <br /> For **HIPAA-covered entities**, more information about signing a Business Associate Agreement (BAA) can be found in our [Business Add-Ons documentation](/support/business-add-ons).
</Warning>

## Endpoint

You can `POST` logs to AppSignal. Your logs must be formatted in [`NDJSON`](#ndjson) and sent to the following endpoint:

<CodeGroup>
  ```shell Shell theme={null}
  https://appsignal-endpoint.net/logs/json?api_key=YOUR_LOG_SOURCE_API_KEY
  ```
</CodeGroup>

## NDJSON

Our HTTP-JSON endpoint expects the logs to be sent in an `NDJSON` format to our endpoint.
`NDJSON` stands for Newline Delimited JSON, which means that each log line is its own JSON object, for example:

<CodeGroup>
  ```shell Shell theme={null}
  {"timestamp": "2022-06-02T04:17:25.783Z", "message": "foo", [...]}
  {"timestamp": "2022-06-02T04:17:26.000Z", "message": "bar", [...]}
  ```
</CodeGroup>

### Required Data

Below is an example of a (prettified) `NDJSON` message. You can read more about the data AppSignal requires in the [Required Fields](#required-fields) section.

#### Example message

<Warning>
  **Warning:** This is formatted using newlines for readability. Your client
  **must** send the log line as a single line, without newlines.
</Warning>

<CodeGroup>
  ```json JSON theme={null}
  {
    "timestamp": "2022-06-02T04:17:25.783Z",
    "group": "organisations",
    "severity": "warn",
    "message": "This is a test message",
    "hostname": "frontend1",
    "attributes": {
      "org": "appsignal",
      "step": 1,
      "seen_terms": true,
      "entries": 10.01
    }
  }
  ```
</CodeGroup>

#### Required Fields

<Warning>
  AppSignal will silently drop any message that does not contain the required
  fields below or any incorrect values.
</Warning>

The `NDJSON` payload you send to AppSignal must contain the following fields:

#### timestamp

A `RFC 3339` formatted timestamp with a 3-digit nanosecond precision.

```yaml YAML theme={null}
YYYY-MM-DDThh:mm:ss.sss
2022-01-12T07:20:50.520Z
```

#### group

One-word string that allows the user to separate log lines by a certain context (e.g., logs for a specific part of your application, group could be "admin", "payments", "database", or "background").

#### severity

The severity field accepts the following values: `unknown`, `trace`, `debug`, `info`, `notice`, `warn`, `error`, `critical`, `alert` and `fatal`.

#### message

`Plaintext` message.

#### hostname

Hostname of the server sending the message.

#### Optional fields

The following fields are optional but recommended for richer log data:

#### attributes

Attributes that can be used to filter or search the message, with the following rules:

* Attributes cannot be nested or contain arrays
* The maximum key size is `50` characters
* The maximum amount of attributes is `100`
* The following primitives are accepted as values:
  * String: ideally used as "tags," e.g. one-word values, with a maximum of `100` characters
  * Integer: `10`
  * Double: `0.01`
  * Boolean: `true`/`false`

#### format

Overrides the log source's configured format when parsing the `message`. Accepts `plaintext`, `logfmt`, `json` or `autodetect`; unknown values are ignored.
