# Toggle redirect active state

**Publié le** : 2026-05-08
**Catégorie** : SEO & Analytics

## `POST /redirects/:id/toggle`

**Toggle redirect active state**

Enables or disables a redirect without deleting it.

Required permissions: `redirects.update`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes | Unique identifier |


### Responses

| Status | Description |
| --- | --- |
| `200` | Successful response |
| `401` | Unauthorized — invalid or missing API token |
| `403` | Forbidden — insufficient permissions |
| `404` | Not found |
| `422` | Validation error |


### Examples

```bash
curl -X POST https://api.lynkow.com/v1/redirects/1/toggle \
  -H "Authorization: Bearer $API_TOKEN"
```

### Response Example

```json
{
  "data": {
    "id": 1,
    "sourcePath": "/old-blog",
    "targetUrl": "/blog",
    "statusCode": 301,
    "isRegex": false,
    "isActive": false,
    "preserveQueryString": true,
    "hitCount": 237,
    "lastHitAt": "2025-04-05T18:22:00.000Z",
    "createdAt": "2025-02-01T10:00:00.000Z",
    "updatedAt": "2025-04-06T12:00:00.000Z"
  }
}
```

---