# Create Action For Project — Hive

> Create an action for given project See the documentation

- Key: `hive-create-action-for-project`
- Type: Action (Write)
- Version: 0.0.2
- App: Hive (`hive`) — https://pipedream.com/apps/hive.md
- This page (HTML): https://pipedream.com/apps/hive/actions/create-action-for-project
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/hive/actions/create-action-for-project/create-action-for-project.mjs

## Description

Create an action for given project [See the documentation](https://developers.hive.com/v1.0/reference/actionscreate-1)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `workspaceId` | `string` | Yes | ID of the workspace Options are loaded from the connected account. |
| `projectId` | `string` | Yes | Assign action to a specific project. Options are loaded from the connected account. |
| `title` | `string` | Yes | Title of the action. |
| `description` | `string` | No | Description of the action. |
| `assignees` | `string[]` | No | User Ids of action assignees; if value isn't passed the action will be assigned to the user Id of the request. Options are loaded from the connected account. |
| `labels` | `string[]` | No | Set Labels (Label IDs) for the Action. Options are loaded from the connected account. |
| `deadline` | `string` | No | Date string to set the deadline (date format: yyyy/mm/dd). |
| `scheduledDate` | `string` | No | Date string to set the deadline (date format: yyyy/mm/dd). |
| `customFields` | `object` | No | Add custom fields to the action: Each object must contain label (string) and value (string). |
| `parentId` | `string` | No | ID of an Action to set as the parent for your new Action. Options are loaded from the connected account. |
| `phaseId` | `string` | No | ID of a project phase which will be assigned to the created action. If both phaseId and phaseName are sent than phaseId will be used. Options are loaded from the connected account. |
| `phaseName` | `string` | No | Name of a project phase which will be assigned to the created action. If both phaseId and phaseName are sent than phaseId will be used. Options are loaded from the connected account. |

## 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": "hive",
      },
    },
  },
)

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: "hive-create-action-for-project",
  arguments: {
    workspaceId: "Workspace Id",
    projectId: "Project Id",
  },
})
```

**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: "hive-create-action-for-project",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    hive: { authProvisionId: "apn_xxxxxxx" },
    workspaceId: "Workspace Id",
    projectId: "Project Id",
  },
})

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": "hive-create-action-for-project",
    "configured_props": {
      "hive": { "authProvisionId": "apn_xxxxxxx" },
      "workspaceId": "Workspace Id",
      "projectId": "Project Id"
    }
  }'
```

---

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