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

# Delete a pre-test

> Deletes a pre-test that is completed or failed, or one created in the app that was never started (it is listed as queued). From then on GET /adscore/pretests/{id} and its report answer 404, and GET /adscore/pretests no longer lists it. Deleting does not give back the quota the pre-test used, and the Idempotency-Key that created it cannot be used again. Any other pre-test that has not finished cannot be deleted: you get 409 pretest_in_progress, so wait until it is completed or failed. Deleting a pre-test that is already deleted answers the same 200, so the request is safe to repeat.

Requires the `adscore:write` scope.



## OpenAPI

````yaml /api-reference/openapi.json delete /adscore/pretests/{id}
openapi: 3.1.0
info:
  title: Unite API
  version: 1.0.0
  description: >-
    Run Ad Score pre-tests from your own systems: upload a creative, create a
    pre-test, and read its result and PDF report. The Ad Score routes are under
    /adscore and need the adscore:read or adscore:write scope; uploads and
    webhook endpoints are shared by every product and stay at the root. Every
    request needs an API key sent as a Bearer token. Every response carries an
    X-Request-Id header.
servers:
  - url: https://myunite.ai/api/v1
security:
  - bearerAuth: []
tags:
  - name: Catalog
    description: What you can send when you create a pre-test.
  - name: Uploads
    description: Send creative files and brand assets.
  - name: Brands
    description: Create and complete brands for your workspace.
  - name: Pretests
    description: Create pre-tests and read their results.
  - name: Quota
    description: How many pre-tests you can still run.
  - name: Create
    description: Generate and edit images, videos and music, and read what was generated.
  - name: Webhooks
    description: Manage the endpoints that are notified when a pre-test changes.
paths:
  /adscore/pretests/{id}:
    delete:
      tags:
        - Pretests
      summary: Delete a pre-test
      description: >-
        Deletes a pre-test that is completed or failed, or one created in the
        app that was never started (it is listed as queued). From then on GET
        /adscore/pretests/{id} and its report answer 404, and GET
        /adscore/pretests no longer lists it. Deleting does not give back the
        quota the pre-test used, and the Idempotency-Key that created it cannot
        be used again. Any other pre-test that has not finished cannot be
        deleted: you get 409 pretest_in_progress, so wait until it is completed
        or failed. Deleting a pre-test that is already deleted answers the same
        200, so the request is safe to repeat.


        Requires the `adscore:write` scope.
      operationId: deletePretest
      parameters:
        - name: id
          in: path
          required: true
          description: Pre-test id.
          schema:
            type: string
      responses:
        '200':
          description: The pre-test was deleted.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeletedPretest'
        '401':
          description: >-
            Error. Possible codes: invalid_api_key, api_key_revoked,
            api_key_expired.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Error. Possible codes: feature_not_enabled, key_owner_not_member,
            insufficient_scope.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: 'Error. Possible codes: not_found.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: 'Error. Possible codes: pretest_in_progress.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 'Error. Possible codes: rate_limited.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            Retry-After:
              $ref: '#/components/headers/Retry-After'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: 'Error. Possible codes: internal_error.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  headers:
    X-Request-Id:
      description: >-
        Identifier of this request. Quote it when you email support@myunite.ai.
        It is also in error.requestId.
      schema:
        type: string
    RateLimit-Limit:
      description: >-
        Requests allowed per minute for this key and bucket: 600 for reads, 60
        for writes. Sent on responses once the key is accepted. On 401 errors
        and on 403 errors raised while the key is checked they may be absent.
      schema:
        type: integer
    RateLimit-Remaining:
      description: Requests left in the current window.
      schema:
        type: integer
    RateLimit-Reset:
      description: Seconds until the oldest counted request leaves the window.
      schema:
        type: integer
    Retry-After:
      description: Seconds to wait before you try again.
      schema:
        type: integer
  schemas:
    DeletedPretest:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          const: pretest
        deleted:
          type: boolean
          const: true
      required:
        - id
        - object
        - deleted
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - invalid_api_key
                - api_key_revoked
                - api_key_expired
                - insufficient_scope
                - insufficient_role
                - confirmation_required
                - content_rejected
                - insufficient_credits
                - spend_limit_reached
                - feature_not_enabled
                - key_owner_not_member
                - rate_limited
                - concurrency_limit
                - invalid_request
                - idempotency_key_required
                - idempotency_conflict
                - idempotency_key_retired
                - upload_not_found
                - upload_invalid
                - file_too_large
                - video_too_long
                - source_url_rejected
                - source_url_unreachable
                - invalid_ooh_format
                - voice_origin_mismatch
                - invalid_placement
                - brand_not_found
                - quota_exhausted
                - not_found
                - report_not_ready
                - pretest_in_progress
                - webhook_url_rejected
                - webhook_endpoint_limit
                - internal_error
              description: >-
                Stable machine-readable code. Branch on this, not on the
                message. voice_origin_mismatch is legacy: no longer returned.
            message:
              type: string
              description: Human-readable explanation in English. Its wording can change.
            requestId:
              type: string
              description: >-
                Same value as the X-Request-Id response header. Quote it when
                you email support@myunite.ai.
            docUrl:
              type: string
              description: Page that explains this code.
            param:
              description: >-
                The field, query parameter or header the error refers to, when
                there is one.
              type: string
          required:
            - code
            - message
            - requestId
            - docUrl
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key, sent as `Authorization: Bearer unite_live_...`. Create keys in
        the workspace settings.

````

## Related topics

- [Create a pre-test](https://docs.myunite.ai/api-reference/pretests/create-a-pre-test.md)
- [Get a pre-test](https://docs.myunite.ai/api-reference/pretests/get-a-pre-test.md)
- [List pre-tests](https://docs.myunite.ai/api-reference/pretests/list-pre-tests.md)
- [Get the pre-test quota](https://docs.myunite.ai/api-reference/quota/get-the-pre-test-quota.md)
- [Get the PDF report of a pre-test](https://docs.myunite.ai/api-reference/pretests/get-the-pdf-report-of-a-pre-test.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.