---
agentTools:
  projectIndex: https://mailivery.readme.io/llms.txt
---

# Delete Test

Soft-delete a completed or failed test.

**Restrictions:** Cannot delete tests with status `sending`, `detecting`, or `analyzing`.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Mailivery API",
    "description": "Welcome to the Mailivery API – the programmatic way to connect mailboxes, automate warm-up, and monitor deliverability from inside your own product or scripts.\n\n> **Terminology note — mailbox vs. campaign.** In the Mailivery dashboard, a connected sending account is called a **mailbox**. In the API, the same entity is modeled as a **campaign** — that's why request paths use `/campaigns/...`, identifiers are named `campaignId` / `campaign_id`, and the response schema is `Campaign`. Throughout this reference, when an endpoint description says \"mailbox,\" it refers to the same underlying record as `campaignId` in the URL or payload. No data difference — just two names for one thing.\n\n## Getting Started\n\nTo start integrating Mailivery into your application, follow these steps:\n\n### 1\\. **Sign Up for API Access**\n\nConnect with Our Product team and get Your API Keys.\n\n### 2\\. **API Documentation**\n\nRefer to our comprehensive API documentation for detailed information on endpoints, request and response formats, and authentication mechanisms. The documentation provides clear guidance on implementing Mailivery's API in your application.\n\n### 3\\. **Explore Code Samples**\n\nAccelerate your integration process by exploring our collection of code samples. These samples cover common use cases and showcase best practices for integrating Mailivery's API seamlessly.\n\n### 4\\. **Support and Resources**\n\nIf you encounter any challenges or have questions during the integration process, our dedicated support team is here to assist you.\n\n## Conclusion\n\nUnlock the full potential of Mailivery's email warm-up tool with our API. By seamlessly integrating our solution into your applications, you improve email deliverability and establish a robust sender reputation that stands the test of SPAM algorithms. Get started today and elevate your email marketing success with Mailivery.",
    "version": "1.1.0",
    "contact": {
      "name": "Suraj Jadhav",
      "email": "suraj@sourceitmarketing.com",
      "url": "https://mailivery.io"
    },
    "termsOfService": "https://mailivery.io",
    "license": {
      "name": "Custom License",
      "url": "https://mailivery.io"
    }
  },
  "servers": [
    {
      "url": "https://app.mailivery.io/api/v1",
      "description": "Production / Live server"
    },
    {
      "url": "https://app-staging.mailivery.io/api/v1",
      "description": "Staging / Testing server"
    }
  ],
  "paths": {
    "/inbox-placement-tests/{testId}": {
      "delete": {
        "tags": [
          "IPT - Tests"
        ],
        "summary": "Delete Test",
        "description": "Soft-delete a completed or failed test.\n\n**Restrictions:** Cannot delete tests with status `sending`, `detecting`, or `analyzing`.\n",
        "operationId": "deleteTest",
        "parameters": [
          {
            "$ref": "#/components/parameters/IPTTestId"
          },
          {
            "$ref": "#/components/parameters/X-Request-ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Test deleted.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/IPTXRequestID"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/IPTSuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "example": "IPT_TEST_DELETED"
                        },
                        "message": {
                          "example": "Test deleted successfully"
                        },
                        "data": {
                          "type": "array",
                          "maxItems": 0,
                          "example": []
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Cannot delete a test in progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IPTErrorEnvelope"
                },
                "example": {
                  "success": false,
                  "status": 400,
                  "code": "IPT_TEST_CANNOT_DELETE",
                  "message": "Cannot delete a test in progress",
                  "errors": {
                    "test": [
                      "Test is currently sending. Please wait for completion before deleting."
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/IPTUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/IPTForbidden"
          },
          "404": {
            "$ref": "#/components/responses/IPTTestNotFound"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/IPTTestId"
        }
      ]
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "responses": {
      "IPTUnauthorized": {
        "description": "Authentication required or token invalid.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/IPTErrorEnvelope"
            },
            "example": {
              "success": false,
              "status": 401,
              "code": "UNAUTHENTICATED",
              "message": "Unauthenticated."
            }
          }
        }
      },
      "IPTForbidden": {
        "description": "User does not own this resource.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/IPTErrorEnvelope"
            },
            "example": {
              "success": false,
              "status": 403,
              "code": "IPT_UNAUTHORIZED_ACCESS",
              "message": "You do not have permission to access this test."
            }
          }
        }
      },
      "IPTTestNotFound": {
        "description": "Test not found.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/IPTErrorEnvelope"
            },
            "example": {
              "success": false,
              "status": 404,
              "code": "IPT_TEST_NOT_FOUND",
              "message": "Test not found or you don't have access to it",
              "errors": {
                "test_id": [
                  "The specified test does not exist"
                ]
              }
            }
          }
        }
      }
    },
    "schemas": {
      "IPTSuccessEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "status": {
            "type": "integer",
            "example": 200
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "IPTErrorEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "status": {
            "type": "integer"
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "parameters": {
      "X-Request-ID": {
        "name": "X-Request-ID",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "example": "43873599-9e19-42e6-9a5b-b2bc0a264a28"
        },
        "description": "Any unique string, timestamp, or UUID for logging."
      },
      "IPTTestId": {
        "name": "testId",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer"
        },
        "description": "Inbox placement test ID."
      }
    },
    "headers": {
      "IPTXRequestID": {
        "description": "Echoed request identifier.",
        "schema": {
          "type": "string"
        }
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "IPT - Tests",
      "description": "Create, list, and manage inbox placement tests."
    }
  ],
  "x-tagGroups": [
    {
      "name": "Getting Started",
      "tags": [
        "Mailivery API Introduction"
      ]
    },
    {
      "name": "Connecting Mailboxes",
      "tags": [
        "Connecting Mailboxes"
      ]
    },
    {
      "name": "Warm-Up Controls",
      "tags": [
        "Warm-Up Controls"
      ]
    },
    {
      "name": "Managing Mailboxes",
      "tags": [
        "Managing Mailboxes"
      ]
    },
    {
      "name": "Metrics & Health",
      "tags": [
        "Metrics & Health"
      ]
    },
    {
      "name": "Custom Warm-Up Templates",
      "tags": [
        "Custom Warm-Up Templates"
      ]
    },
    {
      "name": "Yahoo Deliverability Filter",
      "tags": [
        "Yahoo Deliverability Filter"
      ]
    },
    {
      "name": "Warm-Up Audience",
      "tags": [
        "Warm-Up Audience"
      ]
    },
    {
      "name": "Object Structures",
      "tags": [
        "Object Structures"
      ]
    },
    {
      "name": "Webhooks",
      "tags": [
        "Webhooks"
      ]
    },
    {
      "name": "Connection Recheck",
      "tags": [
        "Connection Health"
      ]
    },
    {
      "name": "Inbox Placement Test (Beta)",
      "tags": [
        "IPT - Tests",
        "IPT - Results",
        "IPT - Schedule",
        "IPT - Resources"
      ]
    },
    {
      "name": "Blacklist Monitoring",
      "tags": [
        "Blacklist Monitoring"
      ]
    },
    {
      "name": "Email Verification",
      "tags": [
        "Email Verification"
      ]
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 106,
      "1": 188,
      "2": 56,
      "3": 116,
      "4": 238,
      "5": 154,
      "6": 138,
      "7": 7,
      "8": 188,
      "9": 72,
      "10": 137,
      "11": 106
    }
  }
}
```