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

# Delete

> Delete a tag by name. Tag must not be in use by any graphs or dataslices.

## Query Parameters

| Parameter  | Type  | Description                          |
|------------|-------|--------------------------------------|
| `tag_name` | `str` | Name of the tag to delete.           |

## Response

- **200**: Tag deleted successfully  
    - Returns: `{ "tag_name": str }`
- **500**: Internal Server Error (e.g., tag still in use)

## Example

```
DELETE /tags/delete?tag_name=category
```



## OpenAPI

````yaml /deasy-openapi-stainless.yml delete /tags/delete
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: /rest/unstructured
security: []
paths:
  /tags/delete:
    delete:
      tags:
        - Tags
      summary: Delete
      description: >-
        Delete a tag by name. Tag must not be in use by any graphs or
        dataslices.


        ## Query Parameters


        | Parameter  | Type  | Description                          |

        |------------|-------|--------------------------------------|

        | `tag_name` | `str` | Name of the tag to delete.           |


        ## Response


        - **200**: Tag deleted successfully  
            - Returns: `{ "tag_name": str }`
        - **500**: Internal Server Error (e.g., tag still in use)


        ## Example


        ```

        DELETE /tags/delete?tag_name=category

        ```
      operationId: delete_tag_route_tags_delete_delete
      parameters:
        - name: tag_name
          in: query
          required: true
          schema:
            type: string
            title: Tag Name
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TagResponse'
        '403':
          description: Missing token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred while processing
            the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
      security:
        - BasicAuth: []
        - BearerAuth: []
          UserIdAuth: []
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from unstructured import UnstructuredClient

            client = UnstructuredClient(
                username=os.environ.get("UNSTRUCTURED_USERNAME"),  # This is the default and can be omitted
                password=os.environ.get("UNSTRUCTURED_PASSWORD"),  # This is the default and can be omitted
            )
            tag_response = client.tags.delete(
                tag_name="tag_name",
            )
            print(tag_response.tag_name)
        - lang: JavaScript
          source: >-
            import UnstructuredClient from 'unstructured-sdk';


            const client = new UnstructuredClient({
              authMethod: 'My Auth Method',
              username: process.env['UNSTRUCTURED_USERNAME'], // This is the default and can be omitted
              password: process.env['UNSTRUCTURED_PASSWORD'], // This is the default and can be omitted
            });


            const tagResponse = await client.tags.delete({ tag_name: 'tag_name'
            });


            console.log(tagResponse.tag_name);
components:
  schemas:
    TagResponse:
      properties:
        tag_name:
          type: string
          title: Tag Name
      type: object
      required:
        - tag_name
      title: TagResponse
    HTTPError:
      properties:
        detail:
          type: string
          title: Detail
      type: object
      required:
        - detail
      title: HTTPError
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
    BearerAuth:
      type: http
      scheme: bearer
    UserIdAuth:
      type: apiKey
      in: header
      name: X-User-ID

````