# Create Story — Shortcut

> Creates a new story in your Shortcut account. See Create Story in Shortcut Rest API, V3 reference for endpoint documentation.

- Key: `shortcut-create-story`
- Type: Action (Write)
- Version: 1.0.2
- App: Shortcut (`shortcut`) — https://pipedream.com/apps/shortcut.md
- This page (HTML): https://pipedream.com/apps/shortcut/actions/create-story
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/shortcut/actions/create-story/create-story.mjs

## Description

Creates a new story in your Shortcut account. See [Create Story](https://shortcut.com/api/rest/v3#Create-Story) in Shortcut Rest API, V3 reference for endpoint documentation.

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `workflowStateId` | `integer` | Yes | The ID of the workflow state the story will be in Options are loaded from the connected account. |
| `name` | `string` | Yes | The name of the story |
| `archived` | `boolean` | No | Controls the story's archived state |
| `comment` | `string` | No | A comment to attach to the story |
| `completedAtOverride` | `string` | No | A manual override for the time/date the Story was completed |
| `createdAt` | `string` | No | The time/date the Story was created |
| `dueDate` | `string` | No | The due date of the story |
| `description` | `string` | No | The description of the story |
| `epicId` | `integer` | No | The unique identifier of the epic the story belongs to Options are loaded from the connected account. |
| `estimate` | `integer` | No | The numeric point estimate of the story. Can also be null, which means unestimated |
| `externalId` | `string` | No | This field can be set to another unique ID. In the case that the Story has been imported from another tool, the ID in the other tool can be indicated here. |
| `externalLinks` | `string[]` | No | A string array of External Links associated with this story |
| `fileIds` | `integer[]` | No | An array of IDs of files attached to the story Options are loaded from the connected account. |
| `followerIds` | `string[]` | No | A string array of UUIDs of the followers of this story Options are loaded from the connected account. |
| `iterationId` | `integer` | No | The ID of the iteration the story belongs to Options are loaded from the connected account. |
| `label` | `object` | No | A label object attached to the story. Each label object must have the following structure: color which is an string with the hex color to be displayed with the Label i.e. "#ff0000", and a string name for the name of the Label. See CreateLabelParams for more info. |
| `linkedFileIds` | `integer[]` | No | An array of IDs of linked files attached to the story. Options are loaded from the connected account. |
| `ownerIds` | `string[]` | No | A string array of UUIDs of the owners of this story Options are loaded from the connected account. |
| `requestedById` | `string` | No | The ID of the member that requested the story Options are loaded from the connected account. |
| `startedAtOverride` | `string` | No | A manual override for the time/date the Story was started |
| `storyIds` | `integer[]` | No | The IDs of stories to link as related to the new story Options are loaded from the connected account. |
| `storyType` | `string` | No | The type of story (feature, bug, chore) |
| `tasks` | `string[]` | No | An array of task descriptions to add to the story |
| `updatedAt` | `string` | No | The time/date the story was updated |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "shortcut",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "shortcut-create-story",
  arguments: {
    workflowStateId: 10,
    name: "Name",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "shortcut-create-story",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    shortcut: { authProvisionId: "apn_xxxxxxx" },
    workflowStateId: 10,
    name: "Name",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "shortcut-create-story",
    "configured_props": {
      "shortcut": { "authProvisionId": "apn_xxxxxxx" },
      "workflowStateId": 10,
      "name": "Name"
    }
  }'
```

---

- App: https://pipedream.com/apps/shortcut.md · All apps: https://pipedream.com/apps
