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

# Update Link

> Update Link

Update Link

```http theme={null}
PUT https://services.leadconnectorhq.com/links/{linkId}
```

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

## Path parameters

<ParamField path="linkId" type="string" required>
  Link Id
</ParamField>

## Body

<ParamField body="name" type="string" required default="first tag" />

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

## Respuestas

<Accordion title="201 - Successful response">
  <ResponseField name="link" type="object">
    <Expandable title="propiedades">
      <ResponseField name="id" type="string" default="n4AriwEnFrGh3tu08W0U" />

      <ResponseField name="name" type="string" default="first tag" />

      <ResponseField name="redirectTo" type="string" default="https://www.google.com/" />

      <ResponseField name="fieldKey" type="string" default="{{trigger_link.n4AriwEnFrGh3tu08W0U}}" />

      <ResponseField name="locationId" type="string" default="ve9EPM428h8vShlRW1KT" />
    </Expandable>
  </ResponseField>

  ```json theme={null}
  {
    "link": {
      "id": "n4AriwEnFrGh3tu08W0U",
      "name": "first tag",
      "redirectTo": "https://www.google.com/",
      "fieldKey": "{{trigger_link.n4AriwEnFrGh3tu08W0U}}",
      "locationId": "ve9EPM428h8vShlRW1KT"
    }
  }
  ```
</Accordion>

<Accordion title="400 - Bad Request">
  ```json theme={null}
  {}
  ```
</Accordion>

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

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

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT 'https://services.leadconnectorhq.com/links/YOUR_linkId' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28' \
    -H 'Content-Type: application/json' \
    -d '{
    "name": "first tag",
    "redirectTo": "https://www.google.com/"
  }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/links/YOUR_linkId', {
    method: 'PUT',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({"name": "first tag", "redirectTo": "https://www.google.com/"}),
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'PUT',
      'https://services.leadconnectorhq.com/links/YOUR_linkId',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
          'Content-Type': 'application/json',
      },
      json={"name": "first tag", "redirectTo": "https://www.google.com/"},
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/links/YOUR_linkId');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'PUT',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
          'Content-Type: application/json',
      ],
      CURLOPT_POSTFIELDS => json_encode({'name': 'first tag', 'redirectTo': 'https://www.google.com/'}),
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
