# Update plugin source status

`PATCH /api/plugins/{pluginId}/versions/{versionId}/sources/{sourceId}/status`

Updates a plugin source status, including restoring deleted sources.

Authentication: no security requirement declared for this operation.

Parameters:

- `sourceId` (path, string, uuid, required) - UUID of the plugin source to update
  Type: string, uuid

- `versionId` (path, string, uuid, required) - UUID of the plugin source's version
  Type: string, uuid

- `pluginId` (path, string, uuid, required) - UUID of the plugin to which the source's version belongs
  Type: string, uuid

Request body: application/json (required)

Status update data

Type: object

- `status` (required)
  Type: string
  
  The new status for the plugin source
  
  enum: ["active","inactive","deleted","restored"]

Responses:

- 200: Plugin source status updated successfully.

- 401: Unauthorized access.

- 403: User does not have permission to update this plugin source.

- 404: Plugin source record not found.

## Examples

### cURL

```bash
curl -X PATCH 'http://localhost:3000/api/plugins/550e8400-e29b-41d4-a716-446655440000/versions/550e8400-e29b-41d4-a716-446655440000/sources/550e8400-e29b-41d4-a716-446655440000/status' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "status": "active"
}'
```

### JavaScript

```javascript
const body = `{
  "status": "active"
}`;

const response = await fetch('http://localhost:3000/api/plugins/550e8400-e29b-41d4-a716-446655440000/versions/550e8400-e29b-41d4-a716-446655440000/sources/550e8400-e29b-41d4-a716-446655440000/status', {
  method: 'PATCH',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "status": "active"
}'''

response = requests.patch(
    'http://localhost:3000/api/plugins/550e8400-e29b-41d4-a716-446655440000/versions/550e8400-e29b-41d4-a716-446655440000/sources/550e8400-e29b-41d4-a716-446655440000/status',
    data=body.encode('utf-8'),
    headers={
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
