> ## Documentation Index
> Fetch the complete documentation index at: https://developers.leadwaycrm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a new FAQ inside knowledge base

```http theme={null}
POST https://services.leadconnectorhq.com/knowledge-bases/faqs
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Body

<ParamField body="locationId" type="string" required default="HqDZpF8GH3qvgJTmKCoL">
  account ID as string
</ParamField>

<ParamField body="question" type="string" required default="What is the capital of France?">
  faq question as a string
</ParamField>

<ParamField body="answer" type="string" required default="The capital of France is Paris.">
  faq answer as a string
</ParamField>

<ParamField body="knowledgeBaseId" type="string" required default="710KoEzy793Fxubft0bc">
  knowledge base ID as string
</ParamField>

## Respuestas

<Accordion title="201 - FAQ created successfully">
  <ResponseField name="success" type="boolean" required default="True">
    Success status of the operation
  </ResponseField>

  <ResponseField name="faq" type="object" required>
    Created FAQ details
  </ResponseField>

  ```json theme={null}
  {
    "success": true
  }
  ```
</Accordion>

<Accordion title="400 - Bad Request">
  <ResponseField name="statusCode" type="number" default="400" />

  <ResponseField name="message" type="string" default="Bad Request" />

  ```json theme={null}
  {
    "statusCode": 400,
    "message": "Bad Request"
  }
  ```
</Accordion>

<Accordion title="401 - Unauthorized">
  <ResponseField name="statusCode" type="number" default="401" />

  <ResponseField name="message" type="string" default="Invalid token: access token is invalid" />

  <ResponseField name="error" type="string" default="Unauthorized" />

  ```json theme={null}
  {
    "statusCode": 401,
    "message": "Invalid token: access token is invalid",
    "error": "Unauthorized"
  }
  ```
</Accordion>

<Accordion title="422 - Unprocessable Entity">
  <ResponseField name="statusCode" type="number" default="422" />

  <ResponseField name="message" type="string[]" />

  <ResponseField name="error" type="string" default="Unprocessable Entity" />

  ```json theme={null}
  {
    "statusCode": 422,
    "message": [
      "Unprocessable Entity"
    ],
    "error": "Unprocessable Entity"
  }
  ```
</Accordion>

<Accordion title="500 - Internal Server Error">
  <ResponseField name="statusCode" type="number" default="500" />

  <ResponseField name="message" type="string" default="Internal Server Error" />

  ```json theme={null}
  {
    "statusCode": 500,
    "message": "Internal Server Error"
  }
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST 'https://services.leadconnectorhq.com/knowledge-bases/faqs' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28' \
    -H 'Content-Type: application/json' \
    -d '{
    "locationId": "HqDZpF8GH3qvgJTmKCoL",
    "question": "What is the capital of France?",
    "answer": "The capital of France is Paris.",
    "knowledgeBaseId": "710KoEzy793Fxubft0bc"
  }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/knowledge-bases/faqs', {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({"locationId": "HqDZpF8GH3qvgJTmKCoL", "question": "What is the capital of France?", "answer": "The capital of France is Paris.", "knowledgeBaseId": "710KoEzy793Fxubft0bc"}),
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'POST',
      'https://services.leadconnectorhq.com/knowledge-bases/faqs',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
          'Content-Type': 'application/json',
      },
      json={"locationId": "HqDZpF8GH3qvgJTmKCoL", "question": "What is the capital of France?", "answer": "The capital of France is Paris.", "knowledgeBaseId": "710KoEzy793Fxubft0bc"},
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/knowledge-bases/faqs');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'POST',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
          'Content-Type: application/json',
      ],
      CURLOPT_POSTFIELDS => json_encode({'locationId': 'HqDZpF8GH3qvgJTmKCoL', 'question': 'What is the capital of France?', 'answer': 'The capital of France is Paris.', 'knowledgeBaseId': '710KoEzy793Fxubft0bc'}),
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
