---
title: "Add/remove/update mappings between 'TestPlan' entities and other entities"
method: POST
path: "/testplan/mapping/bulk/{otherEntities}"
tags: ["TestPlan"]
---

# Add/remove/update mappings between 'TestPlan' entities and other entities

`POST /testplan/mapping/bulk/{otherEntities}`

## Request

- Base URL: `https://app.testiny.io/api/v1`
- URL: `https://app.testiny.io/api/v1/testplan/mapping/bulk/{otherEntities}`
- Auth: API key in header `X-Api-Key`
- TypeScript: <https://skmtc.dev/testiny/apis/testiny-api/docs/testplan/mapping/bulk/:otherEntities/post.ts> (a function with typed inputs; its response is checked against the schema)

Adds/Removes/Updates mappings between entities (e.g. test cases, test runs, etc.) if the mapping is defined. Id values are named by entity e.g. 'testcase_id', 'testrun_id' (see request schema)

## Path parameters

- `otherEntities` string, required

## Query parameters

- `op` 'add' | 'update' | 'add_or_update' | 'delete'

## Request body

- union
  - object[]
    - `ids` object: An object of entity id keys for the member entities
      - `testcase_id` integer, required
      - `testplan_id` integer, required
    - `mapped` TestPlanTestCaseValues
      - `testplan_id` integer: The testplan_id property
      - `testcase_id` integer: The testcase_id property
      - `testcase_source_query_id` integer: The id of the testcase source query if created from a test plan query
      - `testcase_source_folder_id` integer: The id of the folder if created in a test plan from a folder
  - object[]
    - `ids` object: An object of entity id keys for the member entities
      - `testcase_folder_id` integer, required
      - `testplan_id` integer, required
    - `mapped` TestPlanTestCaseFolderValues
      - `testplan_id` integer: The testplan_id property
      - `testcase_folder_id` integer: The testcase_folder_id property
  - object[]
    - `ids` object: An object of entity id keys for the member entities
      - `testcase_query_id` integer, required
      - `testplan_id` integer, required
    - `mapped` TestPlanTestCaseQueryValues
      - `testplan_id` integer: The testplan_id property
      - `testcase_query_id` integer: The testcase_query_id property

## Other responses

- `4XX`: The request failed because invalid request parameters or data were supplied or access was denied.
- `5XX`: The request failed because an error occurred during processing of the request.

---

[API](https://skmtc.dev/testiny/apis/testiny-api.md) - [All operations](https://skmtc.dev/testiny/apis/testiny-api/llms.txt) - [OpenAPI document](https://skmtc.dev/testiny/apis/testiny-api/revisions/8f7643b2429d?raw)
