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

> Update or archive a custom subtype. Requires agency or account admin role.

Update or archive a custom subtype. Requires agency or account admin role.

```http theme={null}
PUT https://services.leadconnectorhq.com/conversations/preferences/custom-subtypes/{id}
```

## 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="id" type="string" required default="ve9EPM428h8vShlRW1KT">
  Custom Subtype Id
</ParamField>

## Query parameters

<ParamField query="locationId" type="string" required default="ve9EPM428h8vShlRW1KT">
  Account Id
</ParamField>

## Body

<ParamField body="name" type="string" default="Newsletter Subscription">
  Name of the custom subtype (max 100 characters)
</ParamField>

<ParamField body="description" type="string" default="Updated weekly newsletter subscription preferences">
  Description of the custom subtype (max 100 characters)
</ParamField>

<ParamField body="archived" type="boolean" default="False">
  Whether the custom subtype is archived
</ParamField>

<ParamField body="resubscription_legal_form_id" type="string" default="form_123456">
  Resubscription legal form ID (optional when archiving)
</ParamField>

## Respuestas

<Accordion title="200 - Response" />

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

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

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT 'https://services.leadconnectorhq.com/conversations/preferences/custom-subtypes/YOUR_id' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28' \
    -H 'Content-Type: application/json' \
    -d '{
    "name": "Newsletter Subscription",
    "description": "Updated weekly newsletter subscription preferences",
    "archived": false,
    "resubscription_legal_form_id": "form_123456"
  }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/conversations/preferences/custom-subtypes/YOUR_id', {
    method: 'PUT',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({"name": "Newsletter Subscription", "description": "Updated weekly newsletter subscription preferences", "archived": false, "resubscription_legal_form_id": "form_123456"}),
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'PUT',
      'https://services.leadconnectorhq.com/conversations/preferences/custom-subtypes/YOUR_id',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
          'Content-Type': 'application/json',
      },
      json={"name": "Newsletter Subscription", "description": "Updated weekly newsletter subscription preferences", "archived": false, "resubscription_legal_form_id": "form_123456"},
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/conversations/preferences/custom-subtypes/YOUR_id');
  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': 'Newsletter Subscription', 'description': 'Updated weekly newsletter subscription preferences', 'archived': false, 'resubscription_legal_form_id': 'form_123456'}),
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
