# Create Email Preview Test V2

This call creates a new email test and submits it to our system for processing.All requests must contain a subject property and one source property (either html or url). All other properties are optional. In the following table, each property and its default value is shown. If content-checking variables (such as those for link validation, image validation, or accessibility) are set in the body of the request, the endpoint will run content-checking on the email content. The response will include an id property that should be used to request the results or trigger further processes on the email content.For enterprise customers, the response will also include the customer_id and reference_id that were submitted with the test.

Endpoint: POST /v2/preview/tests
Version: 1.0.0
Security: basicAuth

## Security:

  - `basicAuth` (unknown)
    http basic

## Request fields (application/json):

  - `subject` (string, required)

  - `html` (string)

  - `mime` (string)

  - `url` (string)

  - `transfer_encoding` (string)

  - `charset` (string)

  - `reference_id` (string)

  - `customer_id` (string)

  - `clients` (array)

  - `image_blocking` (boolean)

  - `headers` (object)

  - `spam` (object | null)

  - `spam.test_method` (string)

  - `spam.from_address` (string)

  - `spam.key` (string)

  - `spam.smtp_info` (object | null)

  - `spam.smtp_info.host` (string)

  - `spam.smtp_info.port` (integer)

  - `spam.smtp_info.secure` (string)

  - `spam.smtp_info.username` (string)

  - `spam.smtp_info.password` (string)

  - `content_checking` (object)

  - `content_checking.link_validation` (boolean)
    Enable comprehensive link analysis

  - `content_checking.image_validation` (boolean)
    Enable comprehensive image analysis

  - `content_checking.accessibility` (boolean)
    Enable comprehensive accessibility analysis

  - `content_checking.code_analysis` (boolean)
    Enable comprehensive code analysis of the email content to detect HTML and CSS features and provides a compatibility report across major email clients.

  - `user_id` (string)

  - `folder_id` (string)

  - `project_name` (string)

## Request examples:

  - `Example` (unknown)

## Response 200:

  - `200` (unknown)
    A 200 response

## Response 200 fields (application/json):

  - `id` (string)

  - `reference_id` (string)

  - `customer_id` (string)

  - `spam` (object | null)

  - `spam.key` (string)

  - `spam.address_list` (array)

  - `warnings` (array)

  - `warnings.name` (string)

  - `warnings.message` (string)

  - `content_checking` (any)

  - `content_checking.link_validation` (any)

  - `content_checking.link_validation.items` (object)

  - `content_checking.link_validation.items.id` (string)

  - `content_checking.link_validation.items.links` (object)

  - `content_checking.link_validation.items.links.self` (string)

  - `content_checking.link_validation.errors` (array)

  - `content_checking.link_validation.errors.status` (string)

  - `content_checking.link_validation.errors.title` (string)

  - `content_checking.link_validation.errors.detail` (string)

  - `content_checking.image_validation` (any)

  - `content_checking.accessibility` (any)

  - `content_checking.code_analysis` (any)

  - `content_checking.code_analysis.meta` (object | null)

  - `content_checking.code_analysis.items` (object, required)

  - `content_checking.code_analysis.items.id` (string, required)

## Response 400:

  - `400` (unknown)
    A 400 response

## Response 400 fields (application/json):

  - `Reason` (string, required)

## Response 401:

  - `401` (unknown)
    A 401 response

## Response 401 fields (application/json):

  - `Reason` (string, required)

## Response 500:

  - `500` (unknown)
    A 500 response

## Response 500 fields (application/json):

  - `message` (string, required)
    Response message

## Response default:

  - `default` (unknown)
    A default response

## Response default fields (application/json):

  - `error` (object)

  - `error.name` (string)

  - `error.message` (string)

## Response 200 examples:

  - `Example` (unknown)

