# Add Question to FAQ — Aidbase

> Add a new question to a FAQ in Airbase. See the documentation

- Key: `aidbase-add-question-to-faq`
- Type: Action (Write)
- Version: 0.0.2
- App: Aidbase (`aidbase`) — https://pipedream.com/apps/aidbase.md
- This page (HTML): https://pipedream.com/apps/aidbase/actions/add-question-to-faq
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/aidbase/actions/add-question-to-faq/add-question-to-faq.mjs

## Description

Add a new question to a FAQ in Airbase. [See the documentation](https://docs.aidbase.ai/apis/knowledge-api/reference/#post-knowledgeidfaq-item)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `faqId` | `string` | Yes | The ID of the FAQ to add a question to Options are loaded from the connected account. |
| `question` | `string` | Yes | The question of the FAQ item |
| `answer` | `string` | Yes | The answer of the FAQ item |
| `sourceUrl` | `string` | No | The source URL of the FAQ item |
| `categories` | `string[]` | No | A list of category names for the FAQ. If the category does not exist, it will be created. |

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

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: "aidbase-add-question-to-faq",
  arguments: {
    faqId: "FAQ ID",
    question: "Question",
  },
})
```

**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: "aidbase-add-question-to-faq",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    aidbase: { authProvisionId: "apn_xxxxxxx" },
    faqId: "FAQ ID",
    question: "Question",
  },
})

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": "aidbase-add-question-to-faq",
    "configured_props": {
      "aidbase": { "authProvisionId": "apn_xxxxxxx" },
      "faqId": "FAQ ID",
      "question": "Question"
    }
  }'
```

---

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