# Search Articles — Zendesk

> Searches Help Center articles. See the documentation.

- Key: `zendesk-search-articles`
- Type: Action (Read-only)
- Version: 0.0.9
- App: Zendesk (`zendesk`) — https://pipedream.com/apps/zendesk.md
- This page (HTML): https://pipedream.com/apps/zendesk/actions/search-articles
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/zendesk/actions/search-articles/search-articles.mjs

## Description

Searches Help Center articles. [See the documentation](https://developer.zendesk.com/api-reference/help_center/help-center-api/search/).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `query` | `string` | No | The search text to match (e.g. carrot potato). At least one of this, Category, Section, or Label Names must be provided. |
| `locale` | `string` | No | Search for articles in the specified locale (e.g. en-us). Use * to search across all valid locales. Defaults to the Help Center's default locale if omitted or invalid. Options are loaded from the connected account. |
| `articleCategoryId` | `string[]` | No | Limit results to articles in these categories. Accepts one or more category IDs. Options are loaded from the connected account. |
| `sectionId` | `string[]` | No | Limit results to articles in these sections. Accepts one or more section IDs. Options are loaded from the connected account. |
| `labelNames` | `string[]` | No | Filter articles by label names. An article must have at least one of the labels to match. Matching is case-insensitive. Only available on Professional and Enterprise plans. Options are loaded from the connected account. |
| `brandId` | `string` | No | Limit results to articles in the specified brand. If Multibrand is also set, results are still scoped to this brand. Options are loaded from the connected account. |
| `multibrand` | `boolean` | No | If true, search returns results from all brands. If Brand ID is also set, results are scoped to that brand regardless of this setting. |
| `sortBy` | `string` | No | Sort results by created_at or updated_at. Defaults to sorting by relevance. |
| `sortOrder` | `string` | No | Sort direction. Defaults to desc. |
| `createdBefore` | `string` | No | Limit results to articles created before this date (format YYYY-MM-DD). |
| `createdAfter` | `string` | No | Limit results to articles created after this date (format YYYY-MM-DD). |
| `createdAt` | `string` | No | Limit results to articles created on this date (format YYYY-MM-DD). |
| `updatedBefore` | `string` | No | Limit results to articles updated before this date (format YYYY-MM-DD). Note: only content-meaningful updates are re-indexed. |
| `updatedAfter` | `string` | No | Limit results to articles updated after this date (format YYYY-MM-DD). Note: only content-meaningful updates are re-indexed. |
| `updatedAt` | `string` | No | Limit results to articles updated on this date (format YYYY-MM-DD). |
| `limit` | `integer` | No | Number of results per page. Between 1 and 100. Default is 25. |
| `page` | `integer` | No | Page number to retrieve. Must be greater than 0. Default is 1. |
| `customSubdomain` | `string` | No | For Enterprise Zendesk accounts: optionally specify the subdomain to use. This will override the subdomain that was provided when connecting your Zendesk account to Pipedream. For example, if you Zendesk URL is https://examplehelp.zendesk.com, your subdomain is examplehelp |

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

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: "zendesk-search-articles",
  arguments: {
    query: "Search Query",
    locale: "Locale",
  },
})
```

**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: "zendesk-search-articles",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    zendesk: { authProvisionId: "apn_xxxxxxx" },
    query: "Search Query",
    locale: "Locale",
  },
})

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": "zendesk-search-articles",
    "configured_props": {
      "zendesk": { "authProvisionId": "apn_xxxxxxx" },
      "query": "Search Query",
      "locale": "Locale"
    }
  }'
```

---

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