---
title: "Create a report"
---

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

# Create a report

Path: WhyViral API › Reports

`POST /reports`

URL: `https://whyviral.ai/api/v1/reports`

Freezes a report of a project as it stands now and answers it with its link, `url`. Anyone who has the link can open the page with no account. Free; an account can create 100 a day, whichever of its keys asks.

## Authentication

Requires one of the following:

- `bearer`, http bearer, header `Authorization`
- `apiKeyHeader`, apiKey, in header, header `x-api-key`

## Request body

_Required._

- `kind` (`createReport.kind`; string, required) — `mentions`: the brand’s mentions and ranking. `creators`: saved creators side by side. `campaign`: one campaign’s results.
  - one of `"mentions"`, `"creators"`, `"campaign"`
- `project` (`createReport.project`; string, optional) — A project’s id or exact name; case is ignored. Leave it out for the project active in the app.
- `days` (`createReport.days`; integer, optional) — A `mentions` report’s period.
  - one of `7`, `30` · default: `7`
- `creator_check` (`createReport.creator_check`; string, optional) — A `mentions` report can add one saved creator’s check: the creator’s id.
- `creators` (`createReport.creators`; array of string, optional) — A `creators` report’s saved creators, by id, in the order to show them.
- `campaign` (`createReport.campaign`; string, optional) — A `campaign` report’s campaign id.
- `title` (`createReport.title`; string, optional) — The page’s title; one is made when you leave it out.
  - maxLength: `80`
- `prepared_by` (`createReport.prepared_by`; string, optional) — The name the page shows as “Prepared by”.
  - maxLength: `60`

## Example request

```json
{
  "kind": "mentions",
  "days": 7,
  "prepared_by": "Northlight Social"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://whyviral.ai/api/v1/reports \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "kind": "mentions",
  "days": 7,
  "prepared_by": "Northlight Social"
}
'
```

### TypeScript

```typescript
const url = 'https://whyviral.ai/api/v1/reports';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({kind: 'mentions', days: 7, prepared_by: 'Northlight Social'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://whyviral.ai/api/v1/reports"

payload = {
    "kind": "mentions",
    "days": 7,
    "prepared_by": "Northlight Social"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 201

The report, with its link.

#### Example

```json
{
  "id": "sh7d3k9x2v8q1m4n6b0c5w7h2r9t3y8a",
  "object": "report",
  "kind": "mentions",
  "title": "Crumbsheet · Mentions report",
  "prepared_by": "Northlight Social",
  "url": "https://whyviral.ai/r/3q9XkT0cV5mB8nR2yW7uJ4hL6dZ1aP0sE9fG3iK5oMx",
  "period_from": "2026-11-10T10:00:00.000Z",
  "period_to": "2026-11-17T10:00:00.000Z",
  "hidden": [],
  "created_at": "2026-11-17T10:00:12.000Z",
  "revoked_at": null,
  "expires_at": null
}
```

- `id` (`createReport.response.201.id`; string, required) — The report’s id.
- `object` (`createReport.response.201.object`; string, required) — `"report"`.
- `kind` (`createReport.response.201.kind`; string, required) — `mentions`, `creators` or `campaign`.
  - one of `"mentions"`, `"creators"`, `"campaign"`
- `title` (`createReport.response.201.title`; string, required) — The page’s title.
- `prepared_by` (`createReport.response.201.prepared_by`; string, required) — The name the page shows as “Prepared by”; empty for none.
- `url` (`createReport.response.201.url`; any of, required) — The page’s link. Anyone who has it can open it with no account; null once revoked or expired.
  - any of the following: `string`, `null`
- `period_from` (`createReport.response.201.period_from`; any of, required) — The start of what the report covers.
  - any of the following: `string`, `null`
- `period_to` (`createReport.response.201.period_to`; any of, required) — The end of what it covers.
  - any of the following: `string`, `null`
- `hidden` (`createReport.response.201.hidden`; array of string, required) — Sections its owner hid on the page.
- `created_at` (`createReport.response.201.created_at`; any of, required) — When it was made.
  - any of the following: `string`, `null`
- `revoked_at` (`createReport.response.201.revoked_at`; any of, required) — When its link was revoked, else null.
  - any of the following: `string`, `null`
- `expires_at` (`createReport.response.201.expires_at`; any of, required) — When its link stops opening; null while it has no end.
  - any of the following: `string`, `null`

### 400

`INVALID_REQUEST`: The body isn’t JSON, its `url` is missing or too long, or a parameter has a value it doesn’t take. `INVALID_PERIOD`: `days` isn’t a period this endpoint takes; `days` in the answer lists the ones it does. `AMBIGUOUS_PROJECT`: Several of your projects share the name you sent; pass the project’s `id`. `INVALID_REPORT`: The report can’t be made as asked, for example with no creator or too many. `CREATOR_NOT_SAVED`: A creator you named isn’t among the project’s saved creators. `TOO_MANY_REPORTS`: The project holds as many reports as it can; delete one in the app.

#### Example

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "The body isn’t JSON, its url is missing or too long, or a parameter has a value it doesn’t take."
  }
}
```

- `error` (`createReport.response.400.error`; object, required) — Some codes add details, such as `cap`, `required` or `balance`.
  - `code` (`createReport.response.400.error.code`; string, required)
    - one of `"INVALID_REQUEST"`, `"UNSUPPORTED_LINK"`, `"INVALID_PERIOD"`, `"AMBIGUOUS_PROJECT"`, `"INVALID_REPORT"`, `"CREATOR_NOT_SAVED"`, `"TOO_MANY_REPORTS"`, `"INVALID_API_KEY"`, `"INSUFFICIENT_CREDITS"`, `"ACCOUNT_DISABLED"`, `"NOT_FOUND"`, `"TRACKER_NOT_FOUND"`, `"MONTHLY_LIMIT"`, `"RATE_LIMITED"`, `"INTERNAL"`, `"SEARCH_UNAVAILABLE"`
  - `message` (`createReport.response.400.error.message`; string, required) — What went wrong, in words.

### 401

`INVALID_API_KEY`: The key is missing, mistyped or revoked.

#### Example

```json
{
  "error": {
    "code": "INVALID_API_KEY",
    "message": "The key is missing, mistyped or revoked."
  }
}
```

- `error` (`createReport.response.401.error`; object, required) — Some codes add details, such as `cap`, `required` or `balance`.
  - `code` (`createReport.response.401.error.code`; string, required)
    - one of `"INVALID_REQUEST"`, `"UNSUPPORTED_LINK"`, `"INVALID_PERIOD"`, `"AMBIGUOUS_PROJECT"`, `"INVALID_REPORT"`, `"CREATOR_NOT_SAVED"`, `"TOO_MANY_REPORTS"`, `"INVALID_API_KEY"`, `"INSUFFICIENT_CREDITS"`, `"ACCOUNT_DISABLED"`, `"NOT_FOUND"`, `"TRACKER_NOT_FOUND"`, `"MONTHLY_LIMIT"`, `"RATE_LIMITED"`, `"INTERNAL"`, `"SEARCH_UNAVAILABLE"`
  - `message` (`createReport.response.401.error.message`; string, required) — What went wrong, in words.

### 403

`ACCOUNT_DISABLED`: The key’s account is disabled.

#### Example

```json
{
  "error": {
    "code": "ACCOUNT_DISABLED",
    "message": "The key’s account is disabled."
  }
}
```

- `error` (`createReport.response.403.error`; object, required) — Some codes add details, such as `cap`, `required` or `balance`.
  - `code` (`createReport.response.403.error.code`; string, required)
    - one of `"INVALID_REQUEST"`, `"UNSUPPORTED_LINK"`, `"INVALID_PERIOD"`, `"AMBIGUOUS_PROJECT"`, `"INVALID_REPORT"`, `"CREATOR_NOT_SAVED"`, `"TOO_MANY_REPORTS"`, `"INVALID_API_KEY"`, `"INSUFFICIENT_CREDITS"`, `"ACCOUNT_DISABLED"`, `"NOT_FOUND"`, `"TRACKER_NOT_FOUND"`, `"MONTHLY_LIMIT"`, `"RATE_LIMITED"`, `"INTERNAL"`, `"SEARCH_UNAVAILABLE"`
  - `message` (`createReport.response.403.error.message`; string, required) — What went wrong, in words.

### 404

`NOT_FOUND`: No read, project, creator, campaign or report like this on your account.

#### Example

```json
{
  "error": {
    "code": "NOT_FOUND",
    "message": "No read, project, creator, campaign or report like this on your account."
  }
}
```

- `error` (`createReport.response.404.error`; object, required) — Some codes add details, such as `cap`, `required` or `balance`.
  - `code` (`createReport.response.404.error.code`; string, required)
    - one of `"INVALID_REQUEST"`, `"UNSUPPORTED_LINK"`, `"INVALID_PERIOD"`, `"AMBIGUOUS_PROJECT"`, `"INVALID_REPORT"`, `"CREATOR_NOT_SAVED"`, `"TOO_MANY_REPORTS"`, `"INVALID_API_KEY"`, `"INSUFFICIENT_CREDITS"`, `"ACCOUNT_DISABLED"`, `"NOT_FOUND"`, `"TRACKER_NOT_FOUND"`, `"MONTHLY_LIMIT"`, `"RATE_LIMITED"`, `"INTERNAL"`, `"SEARCH_UNAVAILABLE"`
  - `message` (`createReport.response.404.error.message`; string, required) — What went wrong, in words.

### 429

`RATE_LIMITED`: Too many new reads, data requests, searches or report links; wait the `Retry-After` header’s seconds.

#### Example

```json
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "Too many new reads, data requests, searches or report links; wait the Retry-After header’s seconds."
  }
}
```

- `error` (`createReport.response.429.error`; object, required) — Some codes add details, such as `cap`, `required` or `balance`.
  - `code` (`createReport.response.429.error.code`; string, required)
    - one of `"INVALID_REQUEST"`, `"UNSUPPORTED_LINK"`, `"INVALID_PERIOD"`, `"AMBIGUOUS_PROJECT"`, `"INVALID_REPORT"`, `"CREATOR_NOT_SAVED"`, `"TOO_MANY_REPORTS"`, `"INVALID_API_KEY"`, `"INSUFFICIENT_CREDITS"`, `"ACCOUNT_DISABLED"`, `"NOT_FOUND"`, `"TRACKER_NOT_FOUND"`, `"MONTHLY_LIMIT"`, `"RATE_LIMITED"`, `"INTERNAL"`, `"SEARCH_UNAVAILABLE"`
  - `message` (`createReport.response.429.error.message`; string, required) — What went wrong, in words.

### 500

`INTERNAL`: Something broke on our side; try again.

#### Example

```json
{
  "error": {
    "code": "INTERNAL",
    "message": "Something broke on our side; try again."
  }
}
```

- `error` (`createReport.response.500.error`; object, required) — Some codes add details, such as `cap`, `required` or `balance`.
  - `code` (`createReport.response.500.error.code`; string, required)
    - one of `"INVALID_REQUEST"`, `"UNSUPPORTED_LINK"`, `"INVALID_PERIOD"`, `"AMBIGUOUS_PROJECT"`, `"INVALID_REPORT"`, `"CREATOR_NOT_SAVED"`, `"TOO_MANY_REPORTS"`, `"INVALID_API_KEY"`, `"INSUFFICIENT_CREDITS"`, `"ACCOUNT_DISABLED"`, `"NOT_FOUND"`, `"TRACKER_NOT_FOUND"`, `"MONTHLY_LIMIT"`, `"RATE_LIMITED"`, `"INTERNAL"`, `"SEARCH_UNAVAILABLE"`
  - `message` (`createReport.response.500.error.message`; string, required) — What went wrong, in words.


Source: https://api.whyviral.ai/api/reports/create/index.md
