---
title: "Create a RUM operation"
method: POST
path: "/api/v2/rum/operations"
tags: ["RUM Operations"]
---

# Create a RUM operation

`POST /api/v2/rum/operations`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/rum/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/operations/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a new RUM operation, defining the journey used to detect it from RUM events.

## Request body

- RUMOperationCreateRequest: The request body for creating a RUM operation.
  - `data` RUMOperationCreateRequestData, required: The data object for creating a RUM operation.
    - `attributes` RUMOperationRequestAttributes, required: Attributes for creating or updating a RUM operation.
      - `application_id` string, uuid: The RUM application ID the operation belongs to.
      - `category` string, nullable: The category of the RUM operation.
      - `description` string, nullable: A description of the RUM operation.
      - `display_name` string: A human-readable display name for the RUM operation.
      - `feature_ids` string[]: The list of journey IDs associated with the RUM operation.
      - `journey_rum` RUMOperationJourneyRum, required: The definition of a RUM operation's journey, used to detect it from RUM events.
        - `rum_steps` RUMOperationJourneyStep[], required: The ordered list of steps composing the RUM journey.
          - `composite` RUMOperationJourneyCompositeRule: A composite rule combining several predicates. Used as an alternative to `nodes` on a journey step when several conditions must be matched together, in any order or in a specific order.
            - `composite_rule_id` string: The unique identifier of the composite rule. Generated by the server if omitted.
            - `config_version` string: A hash of the composite rule's configuration, computed by the server.
            - `kind` 'all_of' | 'in_order', required: The rule used to combine the composite rule's predicates. `all_of` requires every predicate to match, in any order. `in_order` requires every predicate to match in the given order.
            - `max_window_ms` integer: The maximum time window, in milliseconds, in which all predicates must match.
            - `predicates` RUMOperationJourneyPredicate[], required: The list of predicates that must be matched by RUM events.
              - …
          - `nodes` RUMOperationJourneyNode[]: The list of nodes that can match this step. Mutually exclusive with `composite`.
            - `id` string: The unique identifier of the node. Generated by the server if omitted.
            - `query` string, required: The RUM search query used to match events for this node.
          - `type` 'start' | 'update' | 'stop' | 'error' | 'abandoned', required: The type of a step within a RUM operation's journey.
      - `name` string, required: The unique name of the RUM operation. Must not contain spaces.
      - `tags` string[], required: A list of tags associated with the RUM operation.
    - `type` 'operations', required: The JSON:API type for RUM operation resources.

## Response `200`

OK

- RUMOperationResponse: The response for a single RUM operation.
  - `data` RUMOperationResponseData, required: The data object in a RUM operation response.
    - `attributes` RUMOperationResponseAttributes, required: Attributes of a RUM operation response.
      - `application_id` string, uuid, nullable: The RUM application ID the operation belongs to.
      - `category` string, nullable: The category of the RUM operation.
      - `created_at` string, date-time: The timestamp when the RUM operation was created.
      - `created_by` RUMOperationUser: A Datadog user referenced by a RUM operation.
        - `email` string: The email of the user.
        - `handle` string: The handle of the user.
        - `name` string: The name of the user.
        - `uuid` string: The UUID of the user.
      - `description` string, nullable: A description of the RUM operation.
      - `display_name` string: A human-readable display name for the RUM operation.
      - `feature_ids` string[]: The list of journey IDs associated with the RUM operation.
      - `journey_rum` RUMOperationJourneyRum, required: The definition of a RUM operation's journey, used to detect it from RUM events.
        - `rum_steps` RUMOperationJourneyStep[], required: The ordered list of steps composing the RUM journey.
          - `composite` RUMOperationJourneyCompositeRule: A composite rule combining several predicates. Used as an alternative to `nodes` on a journey step when several conditions must be matched together, in any order or in a specific order.
            - `composite_rule_id` string: The unique identifier of the composite rule. Generated by the server if omitted.
            - `config_version` string: A hash of the composite rule's configuration, computed by the server.
            - `kind` 'all_of' | 'in_order', required: The rule used to combine the composite rule's predicates. `all_of` requires every predicate to match, in any order. `in_order` requires every predicate to match in the given order.
            - `max_window_ms` integer: The maximum time window, in milliseconds, in which all predicates must match.
            - `predicates` RUMOperationJourneyPredicate[], required: The list of predicates that must be matched by RUM events.
              - …
          - `nodes` RUMOperationJourneyNode[]: The list of nodes that can match this step. Mutually exclusive with `composite`.
            - `id` string: The unique identifier of the node. Generated by the server if omitted.
            - `query` string, required: The RUM search query used to match events for this node.
          - `type` 'start' | 'update' | 'stop' | 'error' | 'abandoned', required: The type of a step within a RUM operation's journey.
      - `name` string, required: The unique name of the RUM operation. Must not contain spaces.
      - `org_id` integer: The ID of the organization the RUM operation belongs to.
      - `tags` string[], required: A list of tags associated with the RUM operation.
      - `updated_at` string, date-time, nullable: The timestamp when the RUM operation was last updated.
      - `updated_by` RUMOperationUser: A Datadog user referenced by a RUM operation.
        - `email` string: The email of the user.
        - `handle` string: The handle of the user.
        - `name` string: The name of the user.
        - `uuid` string: The UUID of the user.
    - `id` string, required: The unique identifier of the RUM operation.
    - `type` 'operations', required: The JSON:API type for RUM operation resources.

## Other responses

- `400`: Bad Request
- `409`: Conflict. An operation with this name already exists.
- `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)
