## Create Saved Report

`print_mail.reports.create(ReportCreateParams**kwargs)  -> Report`

**post** `/print-mail/v1/reports`

Create a new saved report definition. Saved reports are SQL queries that can be executed later to generate
full exports or samples.

If you just want to do ad-hoc queries, you should use the `/reports/samples` endpoint.

### Parameters

- `sql_query: str`

  The SQL query defining the report.

- `description: Optional[str]`

  An optional user-friendly description for the report.

- `metadata: Optional[Dict[str, str]]`

  Optional key-value metadata associated with the report.

### Returns

- `class Report: …`

  Represents a saved Report definition.

  - `id: str`

    Unique identifier for the report.

  - `created_at: datetime`

    Timestamp when the report was created.

  - `live: bool`

    Indicates if the report is associated with the live or test environment.

  - `object: Literal["report"]`

    Always `report`.

    - `"report"`

  - `sql_query: str`

    The SQL query defining the report.

  - `updated_at: datetime`

    Timestamp when the report was last updated.

  - `description: Optional[str]`

    An optional user-friendly description for the report.

  - `metadata: Optional[Dict[str, str]]`

    Optional key-value metadata associated with the report.

### Example

```python
import os
from postgrid import PostGrid

client = PostGrid(
    print_mail_api_key=os.environ.get("POSTGRID_PRINT_MAIL_API_KEY"),  # This is the default and can be omitted
)
report = client.print_mail.reports.create(
    sql_query="SELECT id, status FROM orders WHERE created_at > ?",
    description="Recent Orders",
    metadata={
        "team": "Sales"
    },
)
print(report.id)
```

#### Response

```json
{
  "id": "report_123",
  "object": "report",
  "live": false,
  "sqlQuery": "SELECT id, status FROM orders WHERE created_at > ?",
  "description": "Recent Orders",
  "metadata": {
    "team": "Sales"
  },
  "createdAt": "2023-10-27T10:00:00Z",
  "updatedAt": "2023-10-27T10:00:00Z"
}
```
