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

# Toggle Link Status

> Enable or disable a short link without deleting it

## Request

### Headers

<ParamField header="Content-Type" type="string" required>
  Must be `application/json`
</ParamField>

### Path Parameters

<ParamField path="identifier" type="string" required>
  The link's slug (e.g., `my-link`) or system domain composite (e.g., `mybouncy.link__my-link`).

  Use the `slug` field returned by [GET /v1/links](/api-reference/links/list-links).
</ParamField>

### Body

<ParamField body="setActive" type="boolean" required>
  Set to `true` to activate the link, `false` to deactivate it

  **Example:** `false`
</ParamField>

<Note>
  Deactivated links will stop redirecting. The link is not deleted and can be re-activated at any time.
</Note>

## Response

<ResponseField name="success" type="boolean">
  Whether the operation succeeded
</ResponseField>

<ResponseField name="id" type="string">
  Link identifier
</ResponseField>

<ResponseField name="isActive" type="boolean">
  New active status
</ResponseField>

<ResponseField name="message" type="string">
  Success message
</ResponseField>

<RequestExample>
  ```bash cURL (Deactivate) theme={null}
  curl -X PATCH https://api.bouncy.ai/v1/links/my-link/status \
    -H "Authorization: Bearer bcy_live_pk_YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"setActive": false}'
  ```

  ```bash cURL (Activate) theme={null}
  curl -X PATCH https://api.bouncy.ai/v1/links/my-link/status \
    -H "Authorization: Bearer bcy_live_pk_YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"setActive": true}'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.bouncy.ai/v1/links/my-link/status',
    {
      method: 'PATCH',
      headers: {
        'Authorization': 'Bearer bcy_live_pk_YOUR_API_KEY',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({ setActive: false })
    }
  );

  const result = await response.json();
  console.log(result.message);
  ```

  ```python Python theme={null}
  import requests

  response = requests.patch(
      'https://api.bouncy.ai/v1/links/my-link/status',
      headers={
          'Authorization': 'Bearer bcy_live_pk_YOUR_API_KEY',
          'Content-Type': 'application/json'
      },
      json={'setActive': False}
  )

  result = response.json()
  print(result['message'])
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Deactivated theme={null}
  {
    "success": true,
    "id": "my-link",
    "isActive": false,
    "message": "Deeplink deactivated successfully"
  }
  ```

  ```json 200 Activated theme={null}
  {
    "success": true,
    "id": "my-link",
    "isActive": true,
    "message": "Deeplink activated successfully"
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "error": "Deeplink not found"
  }
  ```
</ResponseExample>
