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

# Create a test on an assessment

> Create a test on an assessment. The test runs from the start of its planned start date for the duration of its plan,
and is submitted for review unless created as a draft. Warning order contacts must be users with access to the organization.
Requires the permission to update the assessment, and assessment creation enabled for the organization.




## OpenAPI

````yaml /monolith-v1-openapi.yaml post /v1/assessments/{assessment_id}/tests
openapi: 3.0.3
info:
  title: Synack API
  version: 2.0.0
  description: >
    Comprehensive API for Synack's security testing platform, providing
    endpoints for managing assessments, vulnerabilities, users, and security
    testing operations.
  contact:
    name: Synack Engineering
    email: engineering@synack.com
  license:
    name: Proprietary
servers:
  - url: https://api.synack.com
    description: Commercial - V1 API
  - url: https://api.synack.us
    description: FedRAMP (Medium) - V1 API
security:
  - BearerAuth: []
  - BasicAuth: []
  - ApiKeyAuth: []
tags:
  - name: Assessments
    description: Operations related to security assessments
  - name: Tests
    description: Operations related to security tests
  - name: Test Plans
    description: Operations related to test plans
  - name: Vulnerabilities
    description: Operations related to security vulnerabilities
  - name: Suspected Vulnerabilities
    description: Operations related to suspected vulnerabilities
  - name: Comments
    description: Operations related to comments
  - name: Patch Verifications
    description: Operations related to patch verifications
  - name: Users
    description: Operations related to users
  - name: Assessment Groups
    description: Operations related to assessment groups
  - name: Tags
    description: Operations related to tags
  - name: Vulnerability Statuses
    description: Operations related to vulnerability statuses
  - name: Listings
    description: Operations related to listings
  - name: Login IP Allowlist
    description: Operations related to the organization's login IP allowlist
paths:
  /v1/assessments/{assessment_id}/tests:
    post:
      tags:
        - Tests
      summary: Create a test on an assessment
      description: >
        Create a test on an assessment. The test runs from the start of its
        planned start date for the duration of its plan,

        and is submitted for review unless created as a draft. Warning order
        contacts must be users with access to the organization.

        Requires the permission to update the assessment, and assessment
        creation enabled for the organization.
      operationId: createTest
      parameters:
        - name: assessment_id
          in: path
          required: true
          schema:
            type: string
          description: ID of the assessment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - test_plan
                - planned_start_date
              properties:
                name:
                  type: string
                  description: Name of the test
                  example: Quarterly penetration test
                test_plan:
                  type: string
                  enum:
                    - Synack365
                    - Synack90
                    - Synack14
                    - SynackAPIPentest
                    - SynackST
                    - SynackST+
                    - Sara Pentest
                    - Sara Pentest+
                  description: >
                    Name of the test plan, one of those the test plans operation
                    returns for the organization.

                    SynackAPIPentest is for API assessments and every other plan
                    for assessments of the other categories.

                    Sara Pentest and Sara Pentest+ need SmartScan enabled and an
                    assessment without a gateway.
                planned_start_date:
                  type: string
                  format: date
                  description: >-
                    Date the test starts on, at the earliest the next business
                    day
                  example: '2030-01-07'
                draft:
                  type: boolean
                  default: false
                  description: >-
                    Whether to keep the test as a draft instead of submitting it
                    for review
                test_objective:
                  type: string
                  description: Objective of the test
                known_vulnerabilities:
                  type: string
                  description: Vulnerabilities already known on the assets under test
                smartscan_enabled:
                  type: boolean
                  default: true
                  description: >-
                    Whether SmartScan runs for the duration of the test, always
                    the case on Sara Pentest and Sara Pentest+
                roes:
                  type: array
                  description: Rules of engagement of the test
                  items:
                    type: object
                    required:
                      - description
                    properties:
                      description:
                        type: string
                        example: No testing of the payment provider
                warning_order_contacts:
                  type: array
                  maxItems: 30
                  uniqueItems: true
                  description: >-
                    Email addresses of the users to send the warning order to,
                    each a user with access to the organization, listed at most
                    once regardless of letter case
                  items:
                    type: string
                    format: email
                outage_windows:
                  type: array
                  description: >-
                    Periods during which testing pauses, each one-time or
                    recurring
                  items:
                    oneOf:
                      - $ref: '#/components/schemas/OneTimeOutageWindow'
                      - $ref: '#/components/schemas/RecurringOutageWindow'
                    discriminator:
                      propertyName: type
                      mapping:
                        one_time: '#/components/schemas/OneTimeOutageWindow'
                        recurring: '#/components/schemas/RecurringOutageWindow'
      responses:
        '201':
          description: The created test, with its review status as draft_status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Test'
        '400':
          description: >-
            A parameter is missing or invalid, or the test overlaps with another
            test on the assessment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '403':
          description: The user is not allowed to create tests on the assessment
        '404':
          description: >-
            No assessment matched the given ID, or test creation is not enabled
            for the organization
        '422':
          description: The test could not be submitted for review
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
components:
  schemas:
    OneTimeOutageWindow:
      type: object
      description: A single pause in testing
      required:
        - type
        - start_date
        - end_date
      properties:
        type:
          type: string
          enum:
            - one_time
        start_date:
          type: string
          format: date-time
          description: When the pause begins, at least 5 minutes in the future
          example: '2030-01-10T22:00:00-05:00'
        end_date:
          type: string
          format: date-time
          description: When the pause ends, after start_date
          example: '2030-01-11T02:00:00-05:00'
    RecurringOutageWindow:
      type: object
      description: >-
        A pause in testing that repeats from start_time to end_time on each of
        its weekdays between first_day and last_day. The first pause must begin
        at least 5 minutes in the future and a second pause must begin by
        last_day; a single pause is a one_time window.
      required:
        - type
        - weekdays
        - start_time
        - end_time
        - first_day
        - last_day
      properties:
        type:
          type: string
          enum:
            - recurring
        weekdays:
          type: array
          minItems: 1
          uniqueItems: true
          description: Days of the week a pause begins on, each at most once
          items:
            type: string
            enum:
              - monday
              - tuesday
              - wednesday
              - thursday
              - friday
              - saturday
              - sunday
          example:
            - monday
            - tuesday
            - wednesday
            - thursday
            - friday
        start_time:
          type: string
          pattern: ^([01]\d|2[0-3]):[0-5]\d$
          description: Clock time each pause begins, as HH:MM
          example: '22:00'
        end_time:
          type: string
          pattern: ^([01]\d|2[0-3]):[0-5]\d$
          description: >-
            Clock time each pause ends, as HH:MM. A time at or before start_time
            ends the pause on the following day.
          example: '02:00'
        utc_offset:
          type: string
          pattern: ^[+-](0\d|1[0-4]):[0-5]\d$
          default: '+00:00'
          description: >-
            Fixed UTC offset the weekdays, times and days are given in. The
            schedule keeps this offset for its whole span and does not follow
            daylight saving changes.
          example: '-05:00'
        first_day:
          type: string
          format: date
          description: First day a pause can begin on
          example: '2030-01-07'
        last_day:
          type: string
          format: date
          description: Last day a pause can begin on, not before first_day
          example: '2030-01-21'
    Test:
      type: object
      required:
        - id
        - type
        - status
        - draft_status
        - planned_start_date
        - planned_end_date
        - actual_start_date
        - actual_end_date
      properties:
        id:
          type: integer
          format: int64
          description: ID of the test
        type:
          type: string
          description: Name of the test plan
          example: Synack14
        status:
          type: string
          enum:
            - planned
            - active
            - ended
          description: Whether the test has started and ended
        draft_status:
          type: string
          enum:
            - draft
            - in_admin_review
            - in_synack_review
            - needs_more_info
            - completed
          description: Review status of the test, completed once the test is approved
        planned_start_date:
          type: string
          format: date-time
        planned_end_date:
          type: string
          format: date-time
        actual_start_date:
          type: string
          format: date-time
          nullable: true
        actual_end_date:
          type: string
          format: date-time
          nullable: true
    Errors:
      type: object
      required:
        - errors
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
    Error:
      type: object
      required:
        - key
        - title
        - status
      properties:
        key:
          type: string
          description: Machine-readable kind of the error
          example: invalid_parameter
        title:
          type: string
          example: Invalid parameter
        status:
          type: integer
          description: HTTP status of the response
          example: 400
        detail:
          type: string
          description: What went wrong, naming the parameter for a validation error
          example: name is required
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    BasicAuth:
      type: http
      scheme: basic
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Auth

````

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