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

# Send test email and/or sms

> # Description

Send an email and/or sms to the email/phone sent in request's body.

# Validations

- If campaign doesn't have an email template yet and the request have an email it will return an error with 422 status code.
- If campaign doesn't have an sms template yet  and the request have a phone it will return an error with 422 status code.

# Response

No response with a 204 status.

# Body

The body for the request is an object that contains the properties `email` and `phone` 
where: 


- `email`: Email where the test email will be sent. If not present it won't sent any test email.  
- `phone`: Phone where the test sms will be sent. It should be a string with the phone in international format. If not present it won't sent any test sms.

# Description

Send an email and/or sms to the email/phone sent in request's body.

# Validations

* If campaign doesn't have an email template yet and the request have an email it will return an error with 422 status code.
* If campaign doesn't have an sms template yet  and the request have a phone it will return an error with 422 status code.

# Response

No response with a 204 status.

# Body

The body for the request is an object that contains the properties `email` and `phone`
where:

* `email`: Email where the test email will be sent. If not present it won't sent any test email.
* `phone`: Phone where the test sms will be sent. It should be a string with the phone in international format. If not present it won't sent any test sms.


## OpenAPI

````yaml POST /campaigns-service/v1/campaigns/{campaignId}/sendTest
openapi: 3.0.3
info:
  title: SightX API
  version: 1.0.0
  description: >-
    SightX REST API documentation. Most responses are JSON; some export
    endpoints return files. API access is a paid add-on — contact
    sales@sightx.io for details.
servers:
  - url: https://auth.admin.sightx.io
    description: Authentication (Production)
  - url: https://auth.staging-admin.sightx.io
    description: Authentication (Staging)
security:
  - AuthorizationHeader: []
paths:
  /campaigns-service/v1/campaigns/{campaignId}/sendTest:
    post:
      summary: Send test email and/or sms
      description: >-
        # Description


        Send an email and/or sms to the email/phone sent in request's body.


        # Validations


        - If campaign doesn't have an email template yet and the request have an
        email it will return an error with 422 status code.

        - If campaign doesn't have an sms template yet  and the request have a
        phone it will return an error with 422 status code.


        # Response


        No response with a 204 status.


        # Body


        The body for the request is an object that contains the properties
        `email` and `phone` 

        where: 



        - `email`: Email where the test email will be sent. If not present it
        won't sent any test email.  

        - `phone`: Phone where the test sms will be sent. It should be a string
        with the phone in international format. If not present it won't sent any
        test sms.
      operationId: >-
        send-test-email-and-or-sms-post-campaigns-service-v1-campaigns-campaignid-sendtest
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
            example:
              email: email@example.com
              phone: '+12345670000'
      responses:
        '200':
          description: Successful response
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '500':
          description: Internal server error
      servers:
        - url: https://campaigns.sightx.io
components:
  securitySchemes:
    AuthorizationHeader:
      type: apiKey
      in: header
      name: Authorization
      description: Access token obtained from the m2m-token endpoint.

````