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

# Detailed Report

> This endpoint creates a filtered message report.

## Query

<ParamField query="start_date" type="string" required>
  Start date of the report query. Format `YYYY-MM-DD` for example: `2023-01-30`
</ParamField>

<ParamField query="end_date" type="string" required>
  End date of the report query. Format `YYYY-MM-DD` for example: `2023-01-30`
</ParamField>

<ParamField query="metadata_key" type="string">
  Filter for messages containing a given metadata key.
</ParamField>

<RequestExample>
  ```bash Example Request theme={null}
  curl --location 'https://api.sbmg.app/v1/reporting/detail?start_date=2023-06-12&end_date=2023-06-14&metadata_key=myMetdataKey' \
  --header 'x-api-key: YOUR_API_KEY'
  ```
</RequestExample>

## Response

<ResponseField name="data" type="array">
  An array of message log entries containing the following fields

  <Expandable title="Toggle object">
    <ResponseField name="account_id" type="number">
      The account ID associated with the message.
    </ResponseField>

    <ResponseField name="destination_address" type="string">
      The phone number of the message recipient.
    </ResponseField>

    <ResponseField name="direction" type="string">
      The direction of the message (e.g. "OUTBOUND").
    </ResponseField>

    <ResponseField name="content" type="string">
      The content of the message.
    </ResponseField>

    <ResponseField name="date" type="string">
      The timestamp of the message in ISO 8601 format.
    </ResponseField>

    <ResponseField name="user_metadata" type="object">
      Additional metadata associated with the message.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Response theme={null}
  {
    "data": [
      {
        "account_id": "f123bf12-f23b-345d-bddc-5e6789abb0c",
        "destination_address": "6422999888",
        "direction": "OUTBOUND",
        "content": "Hello world",
        "date": "2023-06-14T09:06:46Z",
        "user_metadata": {
          "myMetdataKey": "value 3"
        }
      },
      {
        "account_id": "f123bf12-f23b-345d-bddc-5e6789abb0c",
        "source_address": "6422999888",
        "direction": "INBOUND",
        "content": "Boom! Hello!",
        "date": "2023-06-14T09:10:56Z",
        "user_metadata": {
          "myMetdataKey": "value 1"
        }
      },
    ]
  }
  ```
</ResponseExample>
