# Batch delete plugin-tag relationships

`DELETE /api/plugin-tags/batch`

Remove multiple plugin-tag relationships based on various criteria such as plugin ID, tag ID, or specific relationship IDs.

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

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

- `tenant` (optional)
  Type: object

- `tenantId` (optional)
  Type: string

- `organization` (optional)
  Type: object

- `organizationId` (optional)
  Type: string

- `sentTo` (optional)
  Type: string

- `pluginId` (optional)
  Type: string, uuid
  
  Plugin ID to remove tags from

- `tagId` (optional)
  Type: string, uuid
  
  Tag ID to remove from plugins

- `ids` (optional)
  Type: array
  
  Specific plugin-tag relationship IDs to delete
  
  Example:
  
  ```json
  [
    "rel123-456-789",
    "rel987-654-321"
  ]
  ```
  
  Items:
    Type: string

- `tagIds` (optional)
  Type: array
  
  Tag IDs to disassociate from a plugin
  
  Example:
  
  ```json
  [
    "tag123-456-789",
    "tag987-654-321"
  ]
  ```
  
  Items:
    Type: string

Responses:

- 200: Successfully deleted plugin-tag relationships

Content type: application/json

Type: object

- `deleted` (optional)
  Type: number
  
  Number of relationships deleted

## Examples

### cURL

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

### JavaScript

```javascript
const body = `{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "pluginId": "550e8400-e29b-41d4-a716-446655440000",
  "tagId": "550e8400-e29b-41d4-a716-446655440000",
  "ids": [
    "rel123-456-789",
    "rel987-654-321"
  ],
  "tagIds": [
    "tag123-456-789",
    "tag987-654-321"
  ]
}`;

const response = await fetch('http://localhost:3000/api/plugin-tags/batch', {
  method: 'DELETE',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

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

### Python

```python
import requests

body = '''{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "pluginId": "550e8400-e29b-41d4-a716-446655440000",
  "tagId": "550e8400-e29b-41d4-a716-446655440000",
  "ids": [
    "rel123-456-789",
    "rel987-654-321"
  ],
  "tagIds": [
    "tag123-456-789",
    "tag987-654-321"
  ]
}'''

response = requests.delete(
    'http://localhost:3000/api/plugin-tags/batch',
    data=body.encode('utf-8'),
    headers={
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
