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

# Delete By Metadata

> Delete traces/sessions across all projects in the organization by metadata filters.

This endpoint allows organization administrators to delete traces or sessions
that match specific metadata key-value pairs across all projects in their
organization.



## OpenAPI

````yaml https://api.galileo.ai/public/v2/openapi.json post /v2/org-jobs/delete-by-metadata
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.galileo.ai
    description: Galileo Public APIs - galileo-v2
security: []
paths:
  /v2/org-jobs/delete-by-metadata:
    post:
      tags:
        - Organization Jobs
      summary: Delete By Metadata
      description: >-
        Delete traces/sessions across all projects in the organization by
        metadata filters.


        This endpoint allows organization administrators to delete traces or
        sessions

        that match specific metadata key-value pairs across all projects in
        their

        organization.
      operationId: delete_by_metadata_v2_org_jobs_delete_by_metadata_post
      parameters:
        - name: immediate
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Immediate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrgMetadataDeleteRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgMetadataDeleteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - OAuth2PasswordBearer: []
        - HTTPBasic: []
components:
  schemas:
    OrgMetadataDeleteRequest:
      properties:
        metadata_key:
          type: string
          maxLength: 256
          minLength: 1
          title: Metadata Key
        metadata_value:
          type: string
          title: Metadata Value
      type: object
      required:
        - metadata_key
        - metadata_value
      title: OrgMetadataDeleteRequest
      description: Request body for organization-wide metadata-based deletion.
    OrgMetadataDeleteResponse:
      properties:
        job_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Job Id
        message:
          type: string
          title: Message
      type: object
      required:
        - job_id
        - message
      title: OrgMetadataDeleteResponse
      description: Response for organization-wide metadata-based deletion.
    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:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Galileo-API-Key
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: https://api.galileo.ai/login
    HTTPBasic:
      type: http
      scheme: basic

````