> ## 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 Redirect

> The "Create Redirect" API Allows adding a new url redirect to the system. Use this endpoint to create a url redirect with the specified details. Ensure that the required information is provided in the

The "Create Redirect" API Allows adding a new url redirect to the system. Use this endpoint to create a url redirect with the specified details. Ensure that the required information is provided in the request payload.

```http theme={null}
POST https://services.leadconnectorhq.com/funnels/lookup/redirect
```

## 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="6p2RxpgtMKQwO3E6IUaT" />

<ParamField body="domain" type="string" required default="example.com" />

<ParamField body="path" type="string" required default="/Hello" />

<ParamField body="target" type="string" required default="https://www.google.com" />

<ParamField body="action" type="string" required default="URL">
  Posibles valores: 'funnel', 'website', 'url', 'all'
</ParamField>

## Respuestas

<Accordion title="200 - Successful response">
  <ResponseField name="data" type="object" required>
    Data containing details of the created redirect
  </ResponseField>

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

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

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST 'https://services.leadconnectorhq.com/funnels/lookup/redirect' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28' \
    -H 'Content-Type: application/json' \
    -d '{
    "locationId": "6p2RxpgtMKQwO3E6IUaT",
    "domain": "example.com",
    "path": "/Hello",
    "target": "https://www.google.com",
    "action": "URL"
  }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/funnels/lookup/redirect', {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({"locationId": "6p2RxpgtMKQwO3E6IUaT", "domain": "example.com", "path": "/Hello", "target": "https://www.google.com", "action": "URL"}),
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'POST',
      'https://services.leadconnectorhq.com/funnels/lookup/redirect',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
          'Content-Type': 'application/json',
      },
      json={"locationId": "6p2RxpgtMKQwO3E6IUaT", "domain": "example.com", "path": "/Hello", "target": "https://www.google.com", "action": "URL"},
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/funnels/lookup/redirect');
  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': '6p2RxpgtMKQwO3E6IUaT', 'domain': 'example.com', 'path': '/Hello', 'target': 'https://www.google.com', 'action': 'URL'}),
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
