---
title: "Bulk create and remove teams ownership mappings"
method: POST
path: "/api/v2/rum/config/teams-ownership/mappings/operations"
tags: ["Rum Teams Ownership"]
---

# Bulk create and remove teams ownership mappings

`POST /api/v2/rum/config/teams-ownership/mappings/operations`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/rum/config/teams-ownership/mappings/operations`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token`
- TypeScript: <https://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/rum/config/teams-ownership/mappings/operations/post.ts> (a function with typed inputs; its response is checked against the schema)

Add and remove teams ownership mappings for your organization in a single atomic request, following
the JSON:API [atomic operations extension](https://jsonapi.org/ext/atomic/).
Operations are applied together: if any operation is invalid, none of the operations are applied.
Add operations are processed before remove operations, so results may not appear in the same
order as the request.

## Request body

- TeamsOwnershipMappingBatchRequest: The request body for bulk-creating and bulk-removing teams ownership mappings.
  - `atomic:operations` TeamsOwnershipMappingBatchOperation[], required: The list of add and remove operations to apply atomically.
    - `data` TeamsOwnershipMappingBatchOperationData: The mapping to add. Required when `op` is `add`.
      - `attributes` TeamsOwnershipMappingBatchOperationDataAttributes, required: The attributes of the mapping to add. `team_handle` and `view_name` are required when `op` is `add`. At least one of `service` or `application_id` must be provided.
        - `application_id` string, uuid: The ID of the RUM application this mapping applies to. For browser applications, provide the real application UUID — the team is applied to the view regardless of service. For mobile applications, omit this field (or set it to the nil UUID `00000000-0000-0000-0000-000000000000`) — the team is applied to the view and service combination across all applications.
        - `match_type` 'exact' | 'prefix': How the `view_name` is matched against RUM view names.
        - `service` string: The RUM application's service name. For browser applications, this is optional. For mobile applications, this is required and scopes the ownership to a specific service.
        - `team_handle` string: The handle of the team that owns the matched RUM views.
        - `view_name` string: The RUM view name to match, or its prefix when `match_type` is `prefix`.
      - `type` 'teams_ownership_mappings', required: The type of the resource. The value should always be teams_ownership_mappings.
    - `op` 'add' | 'remove', required: Whether this operation adds a new mapping or removes an existing one.
    - `ref` TeamsOwnershipMappingBatchOperationRef: Identifies an existing mapping to remove. Required when `op` is `remove`.
      - `id` string, required: The ID of the mapping to remove.
      - `type` 'teams_ownership_mappings', required: The type of the resource. The value should always be teams_ownership_mappings.

## Response `200`

OK

- TeamsOwnershipMappingBatchResponse: The response body for the bulk create and remove operation. On success, `atomic:results` contains one entry per operation. Add results appear before remove results and may not match request order. Correlate add results by their `type` and `id` rather than by array position. On failure, no operations were applied and `errors` describes what went wrong.
  - `atomic:results` TeamsOwnershipMappingBatchResult[]: The result of each operation. Add operations are processed first, then remove operations, so results may not appear in the same order as the request. Present only on success.
    - `data` TeamsOwnershipMappingBatchResultData: The mapping created by an `add` operation.
      - `attributes` TeamsOwnershipMappingBatchResultDataAttributes, required: The attributes of a mapping created by an `add` operation.
        - `application_id` string, uuid: The ID of the RUM application, when one was provided.
        - `created_at` string, date-time, required: Timestamp when the mapping was created.
        - `created_by` string, required: The UUID of the user who created the mapping.
        - `match_type` 'exact' | 'prefix', required: How the `view_name` is matched against RUM view names.
        - `org_id` integer, required: The ID of the organization that owns this mapping.
        - `service` string: The RUM application's service name, when one was provided.
        - `team_handle` string, required: The handle of the team that owns the matched RUM views.
        - `view_name` string, required: The RUM view name to match, or its prefix when `match_type` is `prefix`.
      - `id` string, required: The unique identifier of the teams ownership mapping.
      - `type` 'teams_ownership_mappings', required: The type of the resource. The value should always be teams_ownership_mappings.
  - `errors` TeamsOwnershipMappingBatchError[]: The validation or processing errors encountered. Present only when the request could not be completed.
    - `detail` string: A human-readable explanation specific to this error.
    - `status` string, required: The HTTP status code applicable to this error.
    - `title` string, required: A short, human-readable summary of the error.

## Other responses

- `400`: Bad Request. One or more operations failed validation, so none of the operations were applied. Errors are returned in the JSON:API atomic operations error format rather than the standard error response.
- `403`: Not Authorized
- `404`: Not Found. One or more mappings requested for removal do not exist.
- `409`: Conflict. One or more mappings requested for creation already exist.
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/3f70db624329?raw)
