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

# Create Connected-Mailbox Test

Create and optionally start a new inbox placement test using a connected mailbox (campaign).

# 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/connected-mailbox": {
      "post": {
        "tags": [
          "IPT - Tests"
        ],
        "summary": "Create Connected-Mailbox Test",
        "description": "Create and optionally start a new inbox placement test using a connected mailbox (campaign).",
        "operationId": "createConnectedMailboxTest",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Request-ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateConnectedMailboxRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Test created.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/IPTXRequestID"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/IPTSuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "example": 201
                        },
                        "code": {
                          "example": "IPT_TEST_CREATED"
                        },
                        "message": {
                          "example": "Inbox placement test created successfully"
                        },
                        "data": {
                          "$ref": "#/components/schemas/TestCreatedResponse"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "status": 201,
                  "code": "IPT_TEST_CREATED",
                  "message": "Inbox placement test created successfully",
                  "data": {
                    "id": 123,
                    "test_name": "Newsletter Campaign Test",
                    "status": "sending",
                    "test_method": "connected_mailbox",
                    "total_seeds": 20,
                    "created_at": "2025-01-15T10:30:00.000000Z",
                    "estimated_completion": "2025-01-15T10:45:00.000000Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/IPTValidationError"
          },
          "401": {
            "$ref": "#/components/responses/IPTUnauthorized"
          },
          "402": {
            "$ref": "#/components/responses/IPTInsufficientCredits"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "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."
            }
          }
        }
      },
      "IPTValidationError": {
        "description": "Request validation failed.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/IPTErrorEnvelope"
            },
            "example": {
              "success": false,
              "status": 400,
              "code": "VALIDATION_ERROR",
              "message": "Please check the request parameters",
              "errors": {
                "test_name": [
                  "The test name field is required."
                ]
              }
            }
          }
        }
      },
      "IPTInsufficientCredits": {
        "description": "Not enough credits.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/IPTErrorEnvelope"
                },
                {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "required_credits": {
                          "type": "integer",
                          "example": 1
                        },
                        "available_credits": {
                          "type": "integer",
                          "example": 0
                        }
                      }
                    }
                  }
                }
              ]
            },
            "example": {
              "success": false,
              "status": 402,
              "code": "IPT_INSUFFICIENT_CREDITS",
              "message": "Insufficient credits to perform this operation",
              "data": {
                "required_credits": 1,
                "available_credits": 0
              }
            }
          }
        }
      }
    },
    "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"
              }
            }
          }
        }
      },
      "CreateConnectedMailboxRequest": {
        "type": "object",
        "required": [
          "campaign_id",
          "test_name",
          "subject",
          "email_body"
        ],
        "properties": {
          "campaign_id": {
            "type": "integer",
            "description": "ID of the connected mailbox (campaign) to send from."
          },
          "test_name": {
            "type": "string",
            "maxLength": 255,
            "description": "Descriptive name for the test."
          },
          "subject": {
            "type": "string",
            "maxLength": 500,
            "description": "Email subject line."
          },
          "email_body": {
            "type": "string",
            "minLength": 10,
            "description": "HTML email content."
          },
          "provider_filter": {
            "$ref": "#/components/schemas/ProviderFilter"
          },
          "schedule_type": {
            "$ref": "#/components/schemas/ScheduleType"
          },
          "schedule_config": {
            "type": "object",
            "nullable": true,
            "description": "Schedule configuration for recurring tests."
          },
          "auto_start": {
            "type": "boolean",
            "default": true,
            "description": "Start test immediately."
          },
          "schedule_timezone": {
            "type": "string",
            "description": "IANA timezone for scheduling (e.g. `America/Chicago`)."
          }
        }
      },
      "TestCreatedResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "test_name": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/TestStatus"
          },
          "test_method": {
            "type": "string",
            "enum": [
              "connected_mailbox"
            ]
          },
          "total_seeds": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "estimated_completion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TestStatus": {
        "type": "string",
        "enum": [
          "pending",
          "pending_send",
          "sending",
          "detecting",
          "analyzing",
          "completed",
          "failed",
          "scheduled"
        ]
      },
      "ProviderFilter": {
        "type": "string",
        "enum": [
          "all",
          "business",
          "consumer"
        ],
        "default": "all"
      },
      "ScheduleType": {
        "type": "string",
        "enum": [
          "one_time",
          "daily",
          "weekly",
          "bi_weekly",
          "monthly"
        ],
        "default": "one_time"
      }
    },
    "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."
      }
    },
    "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": "Bulk Import",
      "tags": [
        "Bulk Import"
      ]
    },
    {
      "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": 206,
      "2": 145,
      "3": 36,
      "4": 58,
      "5": 253,
      "6": 8,
      "7": 42,
      "8": 44,
      "9": 142,
      "10": 191,
      "11": 142
    }
  }
}
```