---
title: "Add control to test mapping"
method: POST
path: "/controls/{controlId}/add-test-to-control"
tags: ["Controls"]
---

# Add control to test mapping

`POST /controls/{controlId}/add-test-to-control`

Add a control to test mapping.

## Path parameters

- `controlId` string, required

## Request body

- AddControlTestMappingInput
  - `testId` string, required — The ID of the test to add to the control.

## Response `200`

Ok

- object
  - `test` Test, required
    - `id` string, required — The test's unique ID.
    - `name` string, required — The test's name.
    - `lastTestRunDate` string, date-time, required — The timestamp of the last test run.
    - `latestFlipDate` string, date-time, nullable, required — The most recent date when the test flipped.
    - `description` string, required — The test's description.
    - `failureDescription` string, required — The test's failure description.
    - `remediationDescription` string, required — The test's remediation description.
    - `version` object, required — The test's version.
      - `minor` number, double, required — The minor version number.
      - `major` number, double, required — The major version number.
    - `category` 'Accounts access' | 'Account security' | 'Account setup' | 'Computers' | 'Custom' | 'Data storage' | 'Employees' | 'Infrastructure' | 'IT' | 'Logging' | 'Monitoring alerts' | 'People' | 'Policies' | 'Risk analysis' | 'Software development' | 'CSPM alert management' | 'Vendors' | 'Vulnerability management', required
    - `integrations` string[], required — This test's third-party integration dependencies.
    - `status` 'OK' | 'DEACTIVATED' | 'NEEDS_ATTENTION' | 'IN_PROGRESS' | 'INVALID' | 'NOT_APPLICABLE', required
    - `deactivatedStatusInfo` DeactivatedStatusInfo, required
      - `isDeactivated` boolean, required — The deactivated status of the test.
      - `deactivatedReason` string, nullable, required — The reason for deactivation.
      - `lastUpdatedDate` string, date-time, nullable, required — The date of the last update to the deactivated status.
    - `remediationStatusInfo` RemediationStatusInfo, required
      - `status` 'DISABLED' | 'DUE_SOON' | 'INVALID' | 'IN_PROGRESS' | 'NA' | 'NEEDS_WORK' | 'OVERDUE' | 'PASS', required — Enum for the possible test remediation statuses
      - `soonestRemediateByDate` string, date-time, nullable, required — The soonest date by which the remediation should be completed.
      - `itemCount` number, double, required — The number of items that need remediation.
    - `owner` Owner, required
      - `id` string, required — Unique identifier for the person.
      - `displayName` string, required — Name of the person that is shown in product.
      - `emailAddress` string, required — Email address of the person.
  - `control` Control, required
    - `id` string, required — The control's unique ID.
    - `externalId` string, nullable, required — The control's external ID.
    - `name` string, required — The control's name.
    - `description` string, required — The control's description.
    - `source` 'Vanta' | 'Custom', required
    - `domains` string[], required — The security domains that the control belongs to.
    - `owner` Owner, required
      - `id` string, required — Unique identifier for the person.
      - `displayName` string, required — Name of the person that is shown in product.
      - `emailAddress` string, required — Email address of the person.
    - `role` string, nullable — The control's GDPR role, if the control is a GDPR control.
    - `customFields` CustomField[], required — The control's custom field values, if control custom fields is included in your Vanta instance.
      - `label` string, required
      - `value` union, required
        - string
        - string[]
    - `creationDate` string, date-time, nullable, required — When the control was created. Returns null for Vanta library controls.
    - `modificationDate` string, date-time, nullable, required — When the control was last modified. Returns null for Vanta library controls.

---

[API](https://skmtc.net/vanta/apis/build-integrations.md) · [All operations](https://skmtc.net/vanta/apis/build-integrations/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vanta/build-integrations/revisions/6c1f7590538b/schema)
