# Create status page report

Returns the newly created status page report.

[endpoint]
base_url = "https://uptime.betterstack.com"
path = "/api/v2/status-pages/{status_page_id}/status-reports"
method = "POST"

[[path_param]]
name = "status_page_id"
description = "The ID of your status page"
required = true
type = "string"

[[body_param]]
name = "title"
description = "The title of your new status page report."
required = false
type = "string"

[[body_param]]
name = "message"
description = "The first status update message for this report."
required = false
type = "string"

[[body_param]]
name = "report_type"
description = "The type of the report to be created. Expects either `manual` or `maintenance`. Default: `manual`"
required = false
type = "string"

[[body_param]]
name = "notify_subscribers"
description = "Whether or not to send a notification email to subscribers of the status page. Default: false"
required = false
type = "boolean"

[[body_param]]
name = "affected_resources"
description = "An array of objects, where each object contains `status_page_resource_id` and `status` attributes. `status_page_resource_id` - The ID of the status page resource which you want to affect. `status` - Has to be `maintenance` if `report_type` is set to `maintenance`. Otherwise has to be one of `resolved`, `degraded` or `downtime`."
required = false
type = "array of objects"

[[body_param]]
name = "published_at"
description = "The time that will show as the time that the first status update was published at (formatted in ISO-8601). Default: current time"
required = false
type = "string"

[[body_param]]
name = "starts_at"
description = "The time when the report comes into effect (formatted in ISO-8601). Default: current time"
required = false
type = "string"

[[body_param]]
name = "ends_at"
description = "The time when the report ends (formatted in ISO-8601). Only required when `report_type` is set to `maintenance`."
required = false
type = "string"

[[header]]
name = "Authorization"
description = "Bearer `$TOKEN`"
required = true
type = "string"

[[header]]
name = "Content_Type"
description = "application/json"
required = false
type = "string"
[/endpoint]

[responses]
[[response]]
status = 201
description = '''Returns a newly created status page report'''
body = '''{
  "data": {
    "id": "12345",
      "type": "status_report",
      "attributes": {
        "title": "Status report title",
        "report_type": "manual",
        "starts_at": "2021-12-17T11:00:00.000Z",
        "ends_at": null,
        "status_page_id": 123456,
        "affected_resources": [
        {
          "status_page_resource_id": "12345",
          "status": "downtime"
        }
      ],
        "aggregate_state": "downtime"
    },
    "relationships": {
      "status_updates": {
        "data": [
          {
            "id": "12345",
            "type": "status_update"
          }
        ]
      }
    }
  },
  "included": [
    {
      "id": "12345",
      "type": "status_update",
      "attributes": {
        "message": "Status update message",
        "published_at": "2021-12-17T11:00:00.000Z",
        "published_at_timezone": "UTC",
        "notify_subscribers": false,
        "status_report_id": 12345,
        "affected_resources": [
          {
            "status_page_resource_id": "12345",
            "status": "downtime"
          }
        ]
      }
    }
  ]
}'''
[/responses]

#### Example cURL 

[code-tabs]
```shell
[label Manual status report]
curl --request POST \
  --url https://uptime.betterstack.com/api/v2/status-pages/123456/status-reports \
  --header "Authorization: Bearer $TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
    "title": "Status report title",
    "message": "Status update message",
    "report_type": "manual",
    "affected_resources": [{"status_page_resource_id": "12345", "status": "downtime"}]
}'
```
```shell
[label Maintenance]
curl --request POST \
  --url https://uptime.betterstack.com/api/v2/status-pages/123456/status-reports \
  --header "Authorization: Bearer $TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
    "title": "Maintenance title",
    "message": "Maintenance message",
    "report_type": "maintenance",
    "affected_resources": [{"status_page_resource_id": "12345", "status": "maintenance"}]
}'
```
[/code-tabs]

[info]
#### Looking for the details of a specific parameter?
Explore [the list of all status page reports API parameters](https://betterstack.com/docs/uptime/api/status-page-reports-api-response-params/)
[/info]
