# Delete Recipient — Thanks.io

> Delete a recipient from a mailing list. See the docs here

- Key: `thanks_io-delete-recipient`
- Type: Action (Write)
- Version: 0.0.2
- App: Thanks.io (`thanks_io`) — https://pipedream.com/apps/thanks-io.md
- This page (HTML): https://pipedream.com/apps/thanks-io/actions/delete-recipient
- Hints: destructive · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/thanks_io/actions/delete-recipient/delete-recipient.mjs

## Description

Delete a recipient from a mailing list. [See the docs here](https://api-docs.thanks.io/#0d1ccb0e-c3a7-4096-a7e6-4eafafc64127)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `subAccount` | `string` | No | ID of subaccount to use Options are loaded from the connected account. |
| `mailingList` | `string` | Yes | The mailing list to delete recipient from Options are loaded from the connected account. |
| `recipient` | `string` | Yes | Recipient to delete 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": "thanks_io",
      },
    },
  },
)

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: "thanks_io-delete-recipient",
  arguments: {
    subAccount: "Sub Account",
    mailingList: "Mailing List",
  },
})
```

**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: "thanks_io-delete-recipient",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    thanks_io: { authProvisionId: "apn_xxxxxxx" },
    subAccount: "Sub Account",
    mailingList: "Mailing List",
  },
})

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": "thanks_io-delete-recipient",
    "configured_props": {
      "thanks_io": { "authProvisionId": "apn_xxxxxxx" },
      "subAccount": "Sub Account",
      "mailingList": "Mailing List"
    }
  }'
```

---

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