# Create an incident status draft — API reference

> Saves a draft of a status page post for the incident and returns the link where a person reviews and publishes it. A second draft for the same status page replaces the first. Nothing is published and no subscriber is notified.

Source: https://upfour.io/docs/api/incidents/create-an-incident-status-draft

[Developers](https://upfour.io/docs/api.md)/[Incidents](https://upfour.io/docs/api/incidents.md)

Saves a draft of a status page post for the incident and returns the link where a person reviews and publishes it. A second draft for the same status page replaces the first. Nothing is published and no subscriber is notified.

POST https://app.upfour.io/v1/incidents/{incidentID}/status-drafts

scope status_page.draft.write stable [Idempotency-Key supported](https://upfour.io/docs/api/idempotency.md) returns 201

## Parameters

| Field | Type | Description |
| --- | --- | --- |
| `incidentID` required | uuid | path parameter |

## Body

`application/json` optional 6 fields

bodystring (required)

The text of the post, up to 10000 characters.

statestring (required)

investigating, identified, monitoring or resolved.

status_page_iduuid (required)

The status page the draft is for: a page of the incident's Company and Client.

All other fields5 fields

component_idsuuid[]

Components (resources) of that page the post names; empty for the incident's own components.

originStatusDraftOrigin

Who wrote it. Through an API key the kind is always agent; the name labels the assistant or script.

Nested fields 2 fields

| Field | Type | Description |
| --- | --- | --- |
| `kind` optional | string | |
| `name` optional | string | |

titlestring

Optional; a person can set it when publishing. Without it upfour uses the automatic report's title.

## Returns

A successful request returns `201` with application/json.

Response fields 1 top-level fields

| Field | Type | Description |
| --- | --- | --- |
| `data` | StatusDraftCreatedResponse | |
| StatusDraftCreatedResponse · 18 fields FieldTypeDescription `body` string `component_ids` uuid[]  · nullable `component_names` string[]  · nullable `created_at` string (date-time) `id` uuid `incident_id` uuid `joins_existing_thread` boolean The incident already has a thread on this page; publishing adds a post to it instead of opening a new thread. `origin_kind` string agent (written through an API key) or member (written in the app). `origin_name` string `publish_url` string Link into the app that opens the incident with this draft ready to publish. Nothing is public until a person publishes it there. `state` string `status_page_id` uuid `status_page_name` string `title` string `updated_at` string (date-time) `client_id` uuid The client the status page belongs to; absent for a Company-level page. `replaced` boolean On create only: true when this call replaced an earlier open draft for the same incident and page. `status_page_update_id` uuid | | |

## Errors

Only the errors this operation can return. Every error uses the [same envelope](https://upfour.io/docs/api/responses.md).

| Status | Code | Meaning |
| --- | --- | --- |
| 400 | [bad_request](https://upfour.io/docs/api/errors#code-bad_request) | The request is malformed or fails validation. |
| 404 | [not_found](https://upfour.io/docs/api/errors#code-not_found) | The requested resource does not exist or is outside the caller's scope. |
| 403 | [permission_denied](https://upfour.io/docs/api/errors#code-permission_denied) | The credentials do not permit this action. |

Every call can also return `unauthorized` (401), `rate_limit_exceeded` (429) or `internal_error` (500 / 502). See [Responses and errors](https://upfour.io/docs/api/responses.md).

[PreviousList an incident's status drafts](https://upfour.io/docs/api/incidents/list-incident-status-drafts.md) [NextGet an incident group](https://upfour.io/docs/api/incidents/get-an-incident-group.md)

## Request

### cURL

```bash
curl -s -X POST "https://app.upfour.io/v1/incidents/00000000-0000-4000-8000-000000000001/status-drafts" \
  -H "Authorization: Bearer $UP4_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "body": "The payment provider reports a partial outage. Card payments may fail; we are watching the provider'\''s recovery.",
    "origin": {
      "kind": "agent",
      "name": "Claude"
    },
    "state": "identified",
    "status_page_id": "00000000-0000-4000-8000-000000000002",
    "title": "Payment provider outage"
  }'
```

### JavaScript

```javascript
const res = await fetch("https://app.upfour.io/v1/incidents/00000000-0000-4000-8000-000000000001/status-drafts", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.UP4_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    body: "The payment provider reports a partial outage. Card payments may fail; we are watching the provider's recovery.",
    origin: {
      kind: "agent",
      name: "Claude",
    },
    state: "identified",
    status_page_id: "00000000-0000-4000-8000-000000000002",
    title: "Payment provider outage",
  }),
});
console.log(res.status, await res.json());
```

### Python

```javascript
import os
import requests

res = requests.post(
    "https://app.upfour.io/v1/incidents/00000000-0000-4000-8000-000000000001/status-drafts",
    headers={"Authorization": f"Bearer {os.environ['UP4_API_KEY']}"},
    json={
        "body": "The payment provider reports a partial outage. Card payments may fail; we are watching the provider's recovery.",
        "origin": {
            "kind": "agent",
            "name": "Claude",
        },
        "state": "identified",
        "status_page_id": "00000000-0000-4000-8000-000000000002",
        "title": "Payment provider outage",
    },
)
print(res.status_code, res.json())
```

### Go

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
	"strings"
)

func main() {
	payload := strings.NewReader(`{
  "body": "The payment provider reports a partial outage. Card payments may fail; we are watching the provider's recovery.",
  "origin": {
    "kind": "agent",
    "name": "Claude"
  },
  "state": "identified",
  "status_page_id": "00000000-0000-4000-8000-000000000002",
  "title": "Payment provider outage"
}`)
	req, _ := http.NewRequest("POST", "https://app.upfour.io/v1/incidents/00000000-0000-4000-8000-000000000001/status-drafts", payload)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("UP4_API_KEY"))
	req.Header.Set("Content-Type", "application/json")
	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	out, _ := io.ReadAll(res.Body)
	fmt.Println(res.StatusCode, string(out))
}
```

### PHP

```php
<?php
$payload = <<<'JSON'
{
  "body": "The payment provider reports a partial outage. Card payments may fail; we are watching the provider's recovery.",
  "origin": {
    "kind": "agent",
    "name": "Claude"
  },
  "state": "identified",
  "status_page_id": "00000000-0000-4000-8000-000000000002",
  "title": "Payment provider outage"
}
JSON;

$ch = curl_init("https://app.upfour.io/v1/incidents/00000000-0000-4000-8000-000000000001/status-drafts");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("UP4_API_KEY"),
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), " ", $response, "\n";
curl_close($ch);
```

## Response

### 201

```json
{
  "data": {
    "body": "The payment provider reports a partial outage. Card payments may fail; we are watching the provider's recovery.",
    "component_ids": [],
    "component_names": [],
    "created_at": "2026-10-27T09:00:00Z",
    "id": "00000000-0000-4000-8000-000000000003",
    "incident_id": "00000000-0000-4000-8000-000000000001",
    "joins_existing_thread": false,
    "origin_kind": "agent",
    "origin_name": "Claude",
    "publish_url": "http://example.com/incidents/00000000-0000-4000-8000-000000000001?status_draft=00000000-0000-4000-8000-000000000003",
    "state": "identified",
    "status_page_id": "00000000-0000-4000-8000-000000000002",
    "status_page_name": "Acme GmbH",
    "title": "Payment provider outage",
    "updated_at": "2026-10-27T09:00:00Z"
  }
}
```

### 400

```json
{
  "error": {
    "code": "bad_request",
    "message": "The request is malformed or fails validation.",
    "request_id": "req_…"
  }
}
```

### 403

```json
{
  "error": {
    "code": "permission_denied",
    "message": "The credentials do not permit this action.",
    "request_id": "req_…"
  }
}
```

### 404

```json
{
  "error": {
    "code": "not_found",
    "message": "The requested resource does not exist or is outside the caller's scope.",
    "request_id": "req_…"
  }
}
```
