> ## 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 Custom Menu Link

> Creates a new custom menu for a company. Requires authentication and proper permissions. For Icon Usage Details please refer to  https://doc.clickup.com/8631005/d/h/87cpx-243696/d60fa70db6b92b2

Creates a new custom menu for a company. Requires authentication and proper permissions. For Icon Usage Details please refer to  [https://doc.clickup.com/8631005/d/h/87cpx-243696/d60fa70db6b92b2](https://doc.clickup.com/8631005/d/h/87cpx-243696/d60fa70db6b92b2)

```http theme={null}
POST https://services.leadconnectorhq.com/custom-menus/
```

## 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="title" type="string" required default="Custom Menu">
  Title of the custom menu
</ParamField>

<ParamField body="url" type="string" required default="https://custom-menus.com/">
  URL of the custom menu
</ParamField>

<ParamField body="icon" type="object" required>
  Icon information for the custom menu
</ParamField>

<ParamField body="showOnCompany" type="boolean" required default="True">
  Whether the menu must be displayed on the agency's level
</ParamField>

<ParamField body="showOnLocation" type="boolean" required default="True">
  Whether the menu must be displayed for accounts level
</ParamField>

<ParamField body="showToAllLocations" type="boolean" required default="True">
  Whether the menu must be displayed to all accounts
</ParamField>

<ParamField body="openMode" type="string" required>
  Mode for opening the menu link Posibles valores: 'iframe', 'new\_tab', 'current\_tab'
</ParamField>

<ParamField body="locations" type="string[]">
  List of account IDs where the menu should be shown. This list is applicable only when showOnLocation is true and showToAllLocations is false
</ParamField>

<ParamField body="userRole" type="string" required>
  Which user-roles should the menu be accessible to? Posibles valores: 'all', 'admin', 'user'
</ParamField>

<ParamField body="allowCamera" type="boolean" default="False">
  Whether to allow camera access (only for iframe mode)
</ParamField>

<ParamField body="allowMicrophone" type="boolean" default="False">
  Whether to allow microphone access (only for iframe mode)
</ParamField>

## Respuestas

<Accordion title="201 - Custom menu successfully created">
  <ResponseField name="customMenu" type="object">
    Single Custom menu link object
  </ResponseField>

  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="400 - Bad Request - Invalid input" />

<Accordion title="401 - Unauthorized">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="403 - Forbidden - Insufficient permissions" />

<Accordion title="422 - Unprocessable Entity">
  ```json theme={null}
  {}
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST 'https://services.leadconnectorhq.com/custom-menus/' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28' \
    -H 'Content-Type: application/json' \
    -d '{
    "title": "Custom Menu",
    "url": "https://custom-menus.com/",
    "showOnCompany": true,
    "showOnLocation": true,
    "showToAllLocations": true,
    "openMode": "iframe",
    "locations": [
      "gfWreTIHL8pDbggBb7af",
      "67WreTIHL8pDbggBb7ty"
    ],
    "userRole": "all",
    "allowCamera": false,
    "allowMicrophone": false
  }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/custom-menus/', {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({"title": "Custom Menu", "url": "https://custom-menus.com/", "showOnCompany": true, "showOnLocation": true, "showToAllLocations": true, "openMode": "iframe", "locations": ["gfWreTIHL8pDbggBb7af", "67WreTIHL8pDbggBb7ty"], "userRole": "all", "allowCamera": false, "allowMicrophone": false}),
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'POST',
      'https://services.leadconnectorhq.com/custom-menus/',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
          'Content-Type': 'application/json',
      },
      json={"title": "Custom Menu", "url": "https://custom-menus.com/", "showOnCompany": true, "showOnLocation": true, "showToAllLocations": true, "openMode": "iframe", "locations": ["gfWreTIHL8pDbggBb7af", "67WreTIHL8pDbggBb7ty"], "userRole": "all", "allowCamera": false, "allowMicrophone": false},
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/custom-menus/');
  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({'title': 'Custom Menu', 'url': 'https://custom-menus.com/', 'showOnCompany': true, 'showOnLocation': true, 'showToAllLocations': true, 'openMode': 'iframe', 'locations': ['gfWreTIHL8pDbggBb7af', '67WreTIHL8pDbggBb7ty'], 'userRole': 'all', 'allowCamera': false, 'allowMicrophone': false}),
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
