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

# Add or replace a success metric

> Configure what counts as success for an initiative: a customer-data event, a record on a custom object, or a value extracted from the conversation, measured within 48 hours of the first message. Omit `rootId` to add a metric; pass an existing metric's `rootId` to replace it with a new version. This is not a patch — send the metric's complete configuration, because omitted fields are cleared. Successes are recalculated on every read, so replacing a metric also changes what the dashboard reports for past conversations. Use success_metrics_catalog to find the event, object type or variable to point at.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/initiatives/{id}/success-metrics
openapi: 3.1.0
info:
  title: Boom API
  version: 1.0.0
  description: >-
    Boom's public REST API — one uniform surface over every platform capability.
    CDP: upsert people and custom objects, define object and relationship types,
    link and unlink relationships, and record behavioral events — one record per
    request or up to 1000 per request via the `/batch` endpoints. Segments: read
    (list, read, membership) and full authoring — discover the filterable
    catalog, validate a filter, create and update segments, preview match
    counts, and trigger evaluation. Initiatives: create and configure outreach
    initiatives, link WhatsApp templates, drive the lifecycle (launch, cancel,
    archive), and read collected-data summaries. Participants: enroll people
    into an active initiative, track their status, read conversation
    transcripts, and stop outreach. Journeys: read-only access to always-on
    message flows and their metrics. WhatsApp templates: list your WhatsApp
    numbers and list, read, and create message templates. The same capabilities
    are exposed as MCP tools with identical schemas.
servers:
  - url: https://www.useboom.ai
    description: Production
  - url: https://dev.useboom.ai
    description: Development (sandbox — use a development organization API key)
security:
  - bearerAuth: []
paths:
  /api/v1/initiatives/{id}/success-metrics:
    post:
      tags:
        - Initiatives
      summary: Add or replace a success metric
      description: >-
        Configure what counts as success for an initiative: a customer-data
        event, a record on a custom object, or a value extracted from the
        conversation, measured within 48 hours of the first message. Omit
        `rootId` to add a metric; pass an existing metric's `rootId` to replace
        it with a new version. This is not a patch — send the metric's complete
        configuration, because omitted fields are cleared. Successes are
        recalculated on every read, so replacing a metric also changes what the
        dashboard reports for past conversations. Use success_metrics_catalog to
        find the event, object type or variable to point at.
      operationId: success_metrics_upsert
      parameters:
        - name: id
          in: path
          required: true
          schema:
            $schema: https://json-schema.org/draft/2020-12/schema
            type: string
            minLength: 1
            description: The initiative id.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              properties:
                rootId:
                  description: >-
                    Omit to add a new metric. Pass an existing metric's `rootId`
                    to replace it with a new version.
                  type: string
                name:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: The metric label, shown in the dashboard picker.
                signalType:
                  default: CDP_EVENT
                  description: >-
                    What counts as success: a customer-data event, a record on a
                    custom object, or a value extracted from the conversation.
                    Default CDP_EVENT.
                  type: string
                  enum:
                    - CDP_EVENT
                    - CUSTOM_OBJECT
                    - EXTRACTED_VARIABLE
                aggregation:
                  default: COUNT
                  description: >-
                    How matched values roll up. COUNT needs no value field; SUM,
                    AVERAGE and MAX each require one. Default COUNT.
                  type: string
                  enum:
                    - COUNT
                    - SUM
                    - AVERAGE
                    - MAX
                eventName:
                  description: >-
                    Required when signalType is CDP_EVENT: the event name that
                    marks success.
                  anyOf:
                    - type: string
                    - type: 'null'
                valueProperty:
                  description: >-
                    The numeric event property to aggregate. Required when
                    signalType is CDP_EVENT and aggregation is not COUNT.
                  anyOf:
                    - type: string
                    - type: 'null'
                valueSource:
                  default: EVENT_PROPERTY
                  description: >-
                    Whether the aggregated value lives on the event itself or on
                    a custom object the event points at. Default EVENT_PROPERTY.
                  type: string
                  enum:
                    - EVENT_PROPERTY
                    - RELATED_OBJECT
                valueObjectTypeId:
                  description: >-
                    Required when valueSource is RELATED_OBJECT: the
                    custom-object type to read the value from.
                  anyOf:
                    - type: string
                    - type: 'null'
                valueRefProperty:
                  description: >-
                    Required when valueSource is RELATED_OBJECT: the event
                    property holding the object's external id.
                  anyOf:
                    - type: string
                    - type: 'null'
                variableId:
                  description: >-
                    Required when signalType is EXTRACTED_VARIABLE: the
                    extracted variable that defines success.
                  anyOf:
                    - type: string
                    - type: 'null'
                objectTypeId:
                  description: >-
                    Required when signalType is CUSTOM_OBJECT: the custom-object
                    type a qualifying record belongs to.
                  anyOf:
                    - type: string
                    - type: 'null'
                objectAttributeFilter:
                  description: >-
                    Optional equality filter on the object's attributes, e.g.
                    {"status":"SUCCEEDED"}.
                  anyOf:
                    - type: object
                      propertyNames:
                        type: string
                      additionalProperties: {}
                    - type: 'null'
                objectTimeAttribute:
                  description: >-
                    Required when signalType is CUSTOM_OBJECT: the attribute
                    holding the business timestamp to measure against.
                  anyOf:
                    - type: string
                    - type: 'null'
                objectValueAttribute:
                  description: >-
                    The numeric object attribute to aggregate. Required when
                    signalType is CUSTOM_OBJECT and aggregation is not COUNT.
                  anyOf:
                    - type: string
                    - type: 'null'
                linkagePath:
                  description: >-
                    How the object is linked to a person. Omit or send an empty
                    array when it is linked directly.
                  anyOf:
                    - type: array
                      items:
                        type: object
                        properties:
                          kind:
                            type: string
                            enum:
                              - PERSON_OBJECT
                              - OBJECT_OBJECT
                          role:
                            type: string
                          direction:
                            type: string
                            enum:
                              - PARENT_TO_CHILD
                              - CHILD_TO_PARENT
                          objectTypeId:
                            type: string
                        required:
                          - kind
                          - role
                          - objectTypeId
                    - type: 'null'
              required:
                - name
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  rootId:
                    type: string
                    description: >-
                      Stable id for this metric across versions. Pass it back to
                      edit the metric.
                  version:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: Version number; every edit creates a new one.
                  status:
                    type: string
                    enum:
                      - ACTIVE
                      - SUPERSEDED
                  name:
                    type: string
                  signalType:
                    type: string
                    enum:
                      - CDP_EVENT
                      - CUSTOM_OBJECT
                      - EXTRACTED_VARIABLE
                  aggregation:
                    type: string
                    enum:
                      - COUNT
                      - SUM
                      - AVERAGE
                      - MAX
                  eventName:
                    anyOf:
                      - type: string
                      - type: 'null'
                  valueProperty:
                    anyOf:
                      - type: string
                      - type: 'null'
                  valueSource:
                    type: string
                    enum:
                      - EVENT_PROPERTY
                      - RELATED_OBJECT
                  valueObjectTypeId:
                    anyOf:
                      - type: string
                      - type: 'null'
                  valueRefProperty:
                    anyOf:
                      - type: string
                      - type: 'null'
                  variableId:
                    anyOf:
                      - type: string
                      - type: 'null'
                  objectTypeId:
                    anyOf:
                      - type: string
                      - type: 'null'
                  objectAttributeFilter:
                    anyOf:
                      - type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      - type: 'null'
                  objectTimeAttribute:
                    anyOf:
                      - type: string
                      - type: 'null'
                  objectValueAttribute:
                    anyOf:
                      - type: string
                      - type: 'null'
                  linkagePath:
                    anyOf:
                      - type: array
                        items:
                          type: object
                          properties:
                            kind:
                              type: string
                              enum:
                                - PERSON_OBJECT
                                - OBJECT_OBJECT
                            role:
                              type: string
                            direction:
                              type: string
                              enum:
                                - PARENT_TO_CHILD
                                - CHILD_TO_PARENT
                            objectTypeId:
                              type: string
                          required:
                            - kind
                            - role
                            - objectTypeId
                          additionalProperties: false
                      - type: 'null'
                  windowHours:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: >-
                      Hours after the first outbound message in which a signal
                      still counts. Fixed at 48.
                  createdAt:
                    type: string
                    description: ISO 8601 timestamp of this version.
                required:
                  - rootId
                  - version
                  - status
                  - name
                  - signalType
                  - aggregation
                  - eventName
                  - valueProperty
                  - valueSource
                  - valueObjectTypeId
                  - valueRefProperty
                  - variableId
                  - objectTypeId
                  - objectAttributeFilter
                  - objectTimeAttribute
                  - objectValueAttribute
                  - linkagePath
                  - windowHours
                  - createdAt
                additionalProperties: false
        '400':
          description: Validation failed or the request cannot proceed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Stable machine-readable error code (snake_case).
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '401':
          description: Missing, malformed, or revoked API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Stable machine-readable error code (snake_case).
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '404':
          description: The resource does not exist in this organization.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Stable machine-readable error code (snake_case).
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '409':
          description: >-
            Conflicts with the current state (duplicates, wrong lifecycle
            state).
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Stable machine-readable error code (snake_case).
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '422':
          description: The request is well-formed but semantically invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Stable machine-readable error code (snake_case).
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '429':
          description: Rate limit exceeded — retry after `Retry-After`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Stable machine-readable error code (snake_case).
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Stable machine-readable error code (snake_case).
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '503':
          description: Transient error — retry with a narrower request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Stable machine-readable error code (snake_case).
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Organization API key, sent as `Authorization: Bearer boom_org_...`.'

````