# Story routes: update, delete

URL: /code/api/story/records-update · Id: `page:code/api/story/records-update`

> The Story Verbs update, delete as api.sb routes, with inputs, result, refusals and an example.

Reference for [Story](/business/nouns/story), one group of [Story routes](/code/api/story).

### Story.update
Changes the given properties of a Story. [Verb page](/business/nouns/story/update?interface=api).

```text
PATCH /{namespace}/stories/{id}
```

Path: `id`. Body, as JSON: the other inputs. Emits `Story.updated`.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Story. |
| `icp` | [ICP](/business/nouns/icp) | No | The ICP it speaks to: one Story per ICP. |
| `hero` | `text` | No | Who the customer is and what they want. |
| `problem` | [Problem](/business/nouns/problem) | No | The Problem: external, internal, and the villain behind it. |
| `guide` | `text` | No | The Startup’s empathy and authority, the authority read from Metrics and Evidence. |
| `plan` | `text` | No | Three steps, each naming a declared Event. |
| `success` | `text` | No | What the customer gains. |
| `failure` | `text` | No | What the customer risks without it. |
| `oneLiner` | `string` | No | The Story in one sentence. |
| `direct` | [Offer](/business/nouns/offer) | No | The direct call to action: an Offer that makes a Customer. |
| `transitional` | [Funnel](/business/nouns/funnel) | No | The transitional call to action: a Funnel opt-in that makes a Lead. |
| `from` | `string` | No | Lineage: the slot it compiles from, as `Hypothesis#<slot>@v<version>`. |
| `stance` | `string` | No | The positioning the Positioning tournament chose, graded Behavior; every compiled asset recompiles when it changes. |
| `category` | `string` | No | The market category name the Story claims, as answer engines repeat it. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `story` | [Story](/business/nouns/story) | Yes | The Story. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```bash
curl -X PATCH https://api.sb/leaseline.app/stories/story_ujkz1xjvrp \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"icp":"icp_EwhsJU4AOW"}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "story": {
    "$id": "https://api.sb/leaseline.app/stories/story_ujkz1xjvrp",
    "$type": "Story",
    "icp": "icp_EwhsJU4AOW",
    "hero": "Example hero",
    "problem": "problem_UzvXXfKsJB",
    "from": "Hypothesis#approach@v1"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Story.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

### Story.delete
Deletes a Story: a soft delete that keeps its history, undone by `Thing.restore`. [Verb page](/business/nouns/story/delete?interface=api).

```text
DELETE /{namespace}/stories/{id}
```

Path: `id`. Emits `Story.deleted`.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Story. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `story` | [Story](/business/nouns/story) | Yes | The Story. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```bash
curl -X DELETE https://api.sb/leaseline.app/stories/story_ujkz1xjvrp \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "story": {
    "$id": "https://api.sb/leaseline.app/stories/story_ujkz1xjvrp",
    "$type": "Story",
    "icp": "icp_EwhsJU4AOW",
    "hero": "Example hero",
    "problem": "problem_UzvXXfKsJB",
    "from": "Hypothesis#approach@v1"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Story.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```