# Replace all tags for a plugin

`PUT /api/plugins/{pluginId}/tags`

Remove all existing tags from a plugin and associate it with a new set of tags.

Authentication: no security requirement declared for this operation.

Parameters:

- `pluginId` (path, string, uuid, required) - Plugin ID
  Type: string, uuid

Request body: application/json (required)

Type: object

Schema: [ReplacePluginTagsDTO](https://sourcey-gauzy.pages.dev/api-reference/models/replaceplugintagsdto/index.md)

- `tenant` (optional)
  Type: object

- `tenantId` (optional)
  Type: string

- `organization` (optional)
  Type: object

- `organizationId` (optional)
  Type: string

- `sentTo` (optional)
  Type: string

- `tagIds` (required)
  Type: array
  
  New array of tag IDs to associate with the plugin (replaces all existing tags)
  
  Example:
  
  ```json
  [
    "tag123-456-789",
    "tag987-654-321"
  ]
  ```
  
  Items:
    Type: string

Responses:

- 200: Successfully replaced plugin tags

Content type: application/json

Type: array

Items:
  Reference: [PluginTag](https://sourcey-gauzy.pages.dev/api-reference/models/plugintag/index.md); Type: object

## Examples

### cURL

```bash
curl -X PUT 'http://localhost:3000/api/plugins/550e8400-e29b-41d4-a716-446655440000/tags' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "tagIds": [
    "tag123-456-789",
    "tag987-654-321"
  ]
}'
```

### JavaScript

```javascript
const body = `{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "tagIds": [
    "tag123-456-789",
    "tag987-654-321"
  ]
}`;

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

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

### Python

```python
import requests

body = '''{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "tagIds": [
    "tag123-456-789",
    "tag987-654-321"
  ]
}'''

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