> ## Documentation Index
> Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create metric

> > For the complete documentation index, see [llms.txt](https://launchdarkly-preview.mintlify.app/llms.txt). For the full documentation snapshot, see [llms-full.txt](https://launchdarkly-preview.mintlify.app/llms-full.txt).

Create a new metric in the specified project. The expected `POST` body differs depending on the specified `kind` property.



## OpenAPI

````yaml /openapi/launchdarkly-api.json post /api/v2/metrics/{projectKey}
openapi: 3.0.3
info:
  title: LaunchDarkly REST API
  description: >
    > For the complete documentation index, see
    https://launchdarkly-preview.mintlify.app/llms.txt.

    > For the full documentation snapshot, see
    https://launchdarkly-preview.mintlify.app/llms-full.txt.


    This is the LaunchDarkly REST API. It lets you build custom integrations,
    automate your workflow, and manage feature flags and other LaunchDarkly
    resources programmatically.


    For authentication, rate limits, pagination, versioning, JSON Patch and
    semantic patches, beta resources, and the full SDK End-of-Life table, read
    the [REST API overview](https://launchdarkly-preview.mintlify.app/api).


    To fetch the complete OpenAPI spec, use [Get OpenAPI
    spec](https://launchdarkly.com/docs/api/other/get-openapi-spec).
  contact:
    name: LaunchDarkly Technical Support Team
    url: https://support.launchdarkly.com
    email: support@launchdarkly.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: '2.0'
servers:
  - url: https://app.launchdarkly.com
    description: ' Default'
  - url: https://app.launchdarkly.us
    description: ' Federal'
security:
  - ApiKey:
      - read
      - write
tags:
  - name: Access tokens
    description: >-
      The access tokens API allows you to list, create, modify, and delete
      access tokens programmatically.
  - name: Account members
    description: >-
      The account members API allows you to invite new members to an account by
      making a `POST` request to `/api/v2/members`. When you invite a new member
      to an account, an invitation is sent to the email you provided.
  - name: Account usage (beta)
    description: >-
      > ### This feature is in beta > > To use this feature, pass in a header
      including the `LD-API-Version` key with value set to `beta`. Use this
      header with each call.
  - name: AI Configs
    description: >-
      The AI Configs API allows you to create, retrieve, and edit AI Configs, AI
      Config variations, and AI model configurations.
  - name: Announcements
    description: >-
      The announcements API lets you create and update a custom announcement
      banner that appears in the LaunchDarkly user interface for everyone in
      your organization.
  - name: Applications (beta)
    description: >-
      > ### This feature is in beta > > To use this feature, pass in a header
      including the `LD-API-Version` key with value set to `beta`. Use this
      header with each call.
  - name: Approvals
    description: >-
      An account member can request approval on changes to a flag or AI Config's
      targeting or variations, or to a segment's targeting. Members may be
      required to request approval depending on the settings in their
      LaunchDarkly project.
  - name: Approvals (beta)
    description: >-
      > ### This feature is in beta > > To use this feature, pass in a header
      including the `LD-API-Version` key with value set to `beta`. Use this
      header with each call.
  - name: Audit log
    description: >-
      LaunchDarkly maintains a record of all the changes made to any resource in
      the system. You can access this history using the audit log API, including
      filtering by timestamps, or using a custom policy to select which entries
      to receive.
  - name: Code references
    description: >-
      > ### Code references is an Enterprise feature > > Code references is
      available to customers on an Enterprise plan. To learn more, [read about
      our pricing](https://launchdarkly.com/pricing/).
  - name: Context settings
    description: >-
      You can use the context settings API to assign a context to a specific
      variation for any feature flag. To learn more, read [View and manage
      contexts](https://launchdarkly.com/docs/home/observability/context-attributes#view-and-manage-contexts).
  - name: Contexts
    description: >-
      Contexts are people, services, machines, or other resources that encounter
      feature flags in your product. Contexts are identified by their `kind`,
      which describes the type of resources encountering flags, and by their
      `key`.
  - name: Custom roles
    description: >-
      > ### Custom roles is an Enterprise feature > > Custom roles is available
      to customers on an Enterprise plan. To learn more, [read about our
      pricing](https://launchdarkly.com/pricing/).
  - name: Data Export destinations
    description: >-
      > ### Data Export is an add-on feature > > Data Export is available as an
      add-on for customers on a Foundation or Enterprise plan. To learn more,
      [read about our pricing](https://launchdarkly.com/pricing/).
  - name: Environments
    description: >-
      Environments allow you to maintain separate rollout rules in different
      contexts, from local development to QA, staging, and production. With the
      LaunchDarkly Environments API, you can programmatically list, create, and
      manage environments.
  - name: Experiments
    description: >-
      > ### Available for subscription customers > > Experimentation is
      available to all customers on a Developer, Foundation, or Enterprise
      subscription. If you're on an older Pro or Enterprise plan,
      Experimentation is available as an add-on.
  - name: Feature flags
    description: >-
      The feature flags API allows you to list, create, and modify feature flags
      and their targeting. For example, you can control percentage rollouts,
      target specific contexts, or even toggle off a feature flag
      programmatically.
  - name: Feature flags (beta)
    description: >-
      > ### This feature is in beta > > To use this feature, pass in a header
      including the `LD-API-Version` key with value set to `beta`. Use this
      header with each call.
  - name: Flag import configurations (beta)
    description: >-
      > ### This feature is in beta > > To use this feature, pass in a header
      including the `LD-API-Version` key with value set to `beta`. Use this
      header with each call.
  - name: Flag links (beta)
    description: >-
      > ### This feature is in beta > > To use this feature, pass in a header
      including the `LD-API-Version` key with value set to `beta`. Use this
      header with each call.
  - name: Flag triggers
    description: >-
      > ### Flag triggers is an Enterprise feature > > Flag triggers is
      available to customers on an Enterprise plan. To learn more, [read about
      our pricing](https://launchdarkly.com/pricing/).
  - name: Follow flags
    description: >-
      Follow flags to receive email updates about targeting changes to a flag in
      a project and environment.
  - name: Holdouts (beta)
    description: >-
      > ### Available for customers using Experimentation > > Holdouts are
      available to customers using
      [Experimentation](https://launchdarkly.com/docs/api/experiments).
  - name: Insights charts (beta)
    description: >-
      > ### This feature is in beta > > To use this feature, pass in a header
      including the `LD-API-Version` key with value set to `beta`. Use this
      header with each call.
  - name: Insights deployments (beta)
    description: >-
      > ### This feature is in beta > > To use this feature, pass in a header
      including the `LD-API-Version` key with value set to `beta`. Use this
      header with each call.
  - name: Insights flag events (beta)
    description: >-
      > ### This feature is in beta > > To use this feature, pass in a header
      including the `LD-API-Version` key with value set to `beta`. Use this
      header with each call.
  - name: Insights pull requests (beta)
    description: >-
      > ### This feature is in beta > > To use this feature, pass in a header
      including the `LD-API-Version` key with value set to `beta`. Use this
      header with each call.
  - name: Insights repositories (beta)
    description: >-
      > ### This feature is in beta > > To use this feature, pass in a header
      including the `LD-API-Version` key with value set to `beta`. Use this
      header with each call.
  - name: Insights scores (beta)
    description: >-
      > ### This feature is in beta > > To use this feature, pass in a header
      including the `LD-API-Version` key with value set to `beta`. Use this
      header with each call.
  - name: Integration audit log subscriptions
    description: >-
      Audit log integration subscriptions allow you to send audit log events
      hooks to one of dozens of external tools. For example, you can send flag
      change event webhooks to external third party software.
  - name: Integration delivery configurations (beta)
    description: >-
      > ### This feature is in beta > > To use this feature, pass in a header
      including the `LD-API-Version` key with value set to `beta`. Use this
      header with each call.
  - name: Integrations (beta)
    description: >-
      > ### This feature is in beta > > To use this feature, pass in a header
      including the `LD-API-Version` key with value set to `beta`. Use this
      header with each call.
  - name: Layers
    description: >-
      > ### Available for customers using Experimentation > > Layers are
      available to customers using
      [Experimentation](https://launchdarkly.com/docs/api/experiments).
  - name: Metrics
    description: >-
      Metrics track flag behavior over time when an experiment is running. The
      data generated from experiments gives you more insight into the impact of
      a particular flag.
  - name: Metrics (beta)
    description: >-
      > ### This feature is in beta > > To use this feature, pass in a header
      including the `LD-API-Version` key with value set to `beta`. Use this
      header with each call.
  - name: OAuth2 Clients
    description: >-
      The OAuth2 client API allows you to register a LaunchDarkly OAuth client
      for use in your own custom integrations.
  - name: Persistent store integrations (beta)
    description: >-
      > ### This feature is in beta > > To use this feature, pass in a header
      including the `LD-API-Version` key with value set to `beta`. Use this
      header with each call.
  - name: Projects
    description: >-
      Projects allow you to manage multiple different software projects under
      one LaunchDarkly account. Each project has its own unique set of
      environments and feature flags.
  - name: Relay Proxy configurations
    description: >-
      > ### Relay Proxy automatic configuration is an Enterprise feature > >
      Relay Proxy automatic configuration is available to customers on an
      Enterprise plan. To learn more, [read about our
      pricing](https://launchdarkly.com/pricing/).
  - name: Release pipelines (beta)
    description: >-
      > ### This feature is in beta > > To use this feature, pass in a header
      including the `LD-API-Version` key with value set to `beta`. Use this
      header with each call.
  - name: Release policies (beta)
    description: >-
      > ### This feature is in beta > > To use this feature, pass in a header
      including the `LD-API-Version` key with value set to `beta`. Use this
      header with each call.
  - name: Releases (beta)
    description: >-
      > ### This feature is in beta > > To use this feature, pass in a header
      including the `LD-API-Version` key with value set to `beta`. Use this
      header with each call.
  - name: Scheduled changes
    description: >-
      > ### Scheduled flag changes is an Enterprise feature > > Scheduled flag
      changes is available to customers on an Enterprise plan. To learn more,
      [read about our pricing](https://launchdarkly.com/pricing/).
  - name: Segments
    description: >-
      > ### Synced segments and larger list-based segments are an Enterprise
      feature > > This section documents endpoints for rule-based, list-based,
      and synced segments.
  - name: Tags
    description: >-
      Tags are simple strings that you can attach to most resources in
      LaunchDarkly. Tags are useful for grouping resources into a set that you
      can name in a resource specifier.
  - name: Teams
    description: >-
      > ### Teams is an Enterprise feature > > Teams is available to customers
      on an Enterprise plan. To learn more, [read about our
      pricing](https://launchdarkly.com/pricing/).
  - name: Teams (beta)
    description: >-
      > ### This feature is in beta > > To use this feature, pass in a header
      including the `LD-API-Version` key with value set to `beta`. Use this
      header with each call.
  - name: User settings
    description: >-
      > ### Contexts are now available > > After you have upgraded your
      LaunchDarkly SDK to use contexts instead of users, you should use
      [Contexts](https://launchdarkly.com/docs/api/contexts) instead of the user
      settings API.
  - name: Users
    description: >-
      > ### Contexts are now available > > After you have upgraded your
      LaunchDarkly SDK to use contexts instead of users, you should use
      [Contexts](https://launchdarkly.com/docs/api/contexts) instead of these
      endpoints.
  - name: Users (beta)
    description: >-
      > ### Contexts are now available > > After you have upgraded your
      LaunchDarkly SDK to use contexts instead of users, you should use
      [Contexts](https://launchdarkly.com/docs/api/contexts) instead of these
      endpoints.
  - name: Views (beta)
    description: >-
      > ### This feature is in beta > > To use this feature, pass in a header
      including the `LD-API-Version` key with value set to `beta`. Use this
      header with each call.
  - name: Webhooks
    description: >-
      The webhooks API lets you build your own integrations that subscribe to
      activities in LaunchDarkly. When you generate an activity in LaunchDarkly,
      such as when you change a flag or you create a project, LaunchDarkly sends
      an HTTP POST payload to the...
  - name: Workflow templates
    description: >-
      > ### Workflows are in maintenance mode > > The workflows feature is in
      maintenance mode, and is planned for future deprecation at a date not yet
      specified.
  - name: Workflows
    description: >-
      > ### Workflows are in maintenance mode > > The workflows feature is in
      maintenance mode, and is planned for future deprecation at a date not yet
      specified.
  - name: Other
    description: Other requests available in the LaunchDarkly API.
paths:
  /api/v2/metrics/{projectKey}:
    post:
      tags:
        - Metrics
      summary: Create metric
      description: >-
        > For the complete documentation index, see
        [llms.txt](https://launchdarkly-preview.mintlify.app/llms.txt). For the
        full documentation snapshot, see
        [llms-full.txt](https://launchdarkly-preview.mintlify.app/llms-full.txt).


        Create a new metric in the specified project. The expected `POST` body
        differs depending on the specified `kind` property.
      operationId: postMetric
      parameters:
        - name: projectKey
          in: path
          description: The project key
          required: true
          schema:
            type: string
            format: string
            description: The project key
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MetricPost'
            example:
              eventKey: Order placed
              isNumeric: false
              key: metric-key-123abc
              kind: custom
        required: true
      responses:
        '201':
          description: Metric response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricRep'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidRequestErrorRep'
        '401':
          description: Invalid access token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorRep'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenErrorRep'
        '404':
          description: Invalid resource identifier
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorRep'
        '409':
          description: Status conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusConflictErrorRep'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitedErrorRep'
components:
  schemas:
    MetricPost:
      type: object
      required:
        - key
        - kind
      properties:
        key:
          type: string
          description: A unique key to reference the metric
          example: metric-key-123abc
        name:
          type: string
          description: A human-friendly name for the metric
          example: Example metric
        description:
          type: string
          description: Description of the metric
          example: optional description
        kind:
          type: string
          description: The kind of event your metric will track
          example: custom
          enum:
            - pageview
            - click
            - custom
            - trace
        selector:
          type: string
          description: One or more CSS selectors. Required for click metrics only.
          example: .dropdown-toggle
        urls:
          type: array
          description: >-
            One or more target URLs. Required for click and pageview metrics
            only.
          items:
            $ref: '#/components/schemas/UrlPost'
          example: invalid example
        isNumeric:
          type: boolean
          description: >-
            Whether to track numeric changes in value against a baseline
            (<code>true</code>) or to track a conversion when an end user takes
            an action (<code>false</code>). Required for custom and trace
            metrics only.
          example: false
        unit:
          type: string
          description: >-
            The unit of measure. Applicable for numeric custom and trace metrics
            only.
          example: orders
        eventKey:
          type: string
          description: >-
            The event key to use in your code. Required for custom
            conversion/binary and custom numeric metrics only.
          example: Order placed
        successCriteria:
          type: string
          description: >-
            Success criteria. Required for custom and trace numeric metrics,
            optional for custom and trace conversion metrics.
          example: HigherThanBaseline
          enum:
            - HigherThanBaseline
            - LowerThanBaseline
        tags:
          type: array
          description: Tags for the metric
          items:
            type: string
          example:
            - example-tag
        randomizationUnits:
          type: array
          description: An array of randomization units allowed for this metric
          items:
            type: string
          example:
            - user
        maintainerId:
          type: string
          description: The ID of the member who maintains this metric
          example: 569fdeadbeef1644facecafe
        unitAggregationType:
          type: string
          description: The method by which multiple unit event values are aggregated
          example: average
          enum:
            - average
            - sum
        analysisType:
          type: string
          description: The method for analyzing metric events
          example: mean
        percentileValue:
          type: integer
          description: >-
            The percentile for the analysis method. An integer denoting the
            target percentile between 0 and 100. Required when
            <code>analysisType</code> is <code>percentile</code>.
          example: 95
        eventDefault:
          $ref: '#/components/schemas/MetricEventDefaultRep'
        dataSource:
          $ref: '#/components/schemas/MetricDataSourceRefRep'
        filters:
          $ref: '#/components/schemas/EventFilter'
          description: >-
            Filters for the metric to exclude certain events from being
            included. This is only supported for custom metrics.
        windowStartOffset:
          type: integer
          format: int64
          description: >-
            Not yet implemented - The start of the measurement window, in
            milliseconds relative to the unit's first exposure to a flag
            variation
        windowEndOffset:
          type: integer
          format: int64
          description: >-
            Not yet implemented - The end of the measurement window, in
            milliseconds relative to the unit's first exposure to a flag
            variation
        traceQuery:
          type: string
          description: The trace query to use for the metric. Required for trace metrics.
          example: service.name = "checkout"
        traceValueLocation:
          type: string
          description: >-
            The location in the trace to use for numeric values. Required for
            numeric trace metrics.
          example: duration
    MetricRep:
      type: object
      required:
        - _id
        - _versionId
        - key
        - name
        - kind
        - _links
        - tags
        - _creationDate
        - dataSource
      properties:
        experimentCount:
          type: integer
          description: The number of experiments using this metric
          example: 0
        metricGroupCount:
          type: integer
          description: The number of metric groups using this metric
          example: 0
        activeExperimentCount:
          type: integer
          description: The number of active experiments using this metric
          example: 2
        activeGuardedRolloutCount:
          type: integer
          description: The number of active guarded rollouts using this metric
          example: 1
        _id:
          type: string
          description: The ID of this metric
          example: 5902deadbeef667524a01290
        _versionId:
          type: string
          description: The version ID of the metric
          example: version-id-123abc
        _version:
          type: integer
          description: Version of the metric
          example: 1
        key:
          type: string
          description: A unique key to reference the metric
          example: metric-key-123abc
        name:
          type: string
          description: A human-friendly name for the metric
          example: My metric
        kind:
          type: string
          description: The kind of event the metric tracks
          example: custom
          enum:
            - pageview
            - click
            - custom
            - trace
        _attachedFlagCount:
          type: integer
          description: The number of feature flags currently attached to this metric
          example: 0
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Link'
          description: The location and content type of related resources
          example:
            parent:
              href: /api/v2/metrics/my-project
              type: application/json
            self:
              href: /api/v2/metrics/my-project/my-metric
              type: application/json
        _site:
          $ref: '#/components/schemas/Link'
          description: Details on how to access the metric in the LaunchDarkly UI
          example: '{"href":"/experiments/metrics/my-metric/edit","type":"text/html"}'
        _access:
          $ref: '#/components/schemas/Access'
          description: Details on the allowed and denied actions for this metric
        tags:
          type: array
          description: Tags for the metric
          items:
            type: string
          example: []
        _creationDate:
          $ref: '#/components/schemas/UnixMillis'
          description: Timestamp of when the metric was created
          example: '1628192791148'
        lastModified:
          $ref: '#/components/schemas/Modification'
        maintainerId:
          type: string
          description: The ID of the member who maintains this metric
          example: 569fdeadbeef1644facecafe
        _maintainer:
          $ref: '#/components/schemas/MemberSummary'
          description: Details on the member who maintains this metric
          example: >-
            {"_links":{"self":{"href":"/api/v2/members/569fdeadbeef1644facecafe","type":"application/json"}},"_id":"569fdeadbeef1644facecafe","firstName":"Ariel","lastName":"Flores","role":"owner","email":"ariel@acme.com"}
        description:
          type: string
          description: Description of the metric
        category:
          type: string
          description: The category of the metric
          example: Error monitoring
        isNumeric:
          type: boolean
          description: >-
            For custom and trace metrics, whether to track numeric changes in
            value against a baseline (<code>true</code>) or to track a
            conversion when an end user takes an action (<code>false</code>).
          example: true
        successCriteria:
          type: string
          description: For custom and trace metrics, the success criteria
          enum:
            - HigherThanBaseline
            - LowerThanBaseline
        unit:
          type: string
          description: For numeric custom and trace metrics, the unit of measure
        eventKey:
          type: string
          description: For custom metrics, the event key to use in your code
          example: Order placed
        randomizationUnits:
          type: array
          description: An array of randomization units allowed for this metric
          items:
            type: string
          example:
            - user
        filters:
          $ref: '#/components/schemas/Filter'
          description: >-
            The filters narrowing down the audience based on context attributes
            or event properties.
          example: >-
            {"type":"group","op":"and","values":[{"type":"contextAttribute","op":"in","contextKind":"user","attribute":"country","values":["JP"],"negate":false},{"type":"eventProperty","op":"in","attribute":"category","values":["magic-wands"],"negate":false}]}
        unitAggregationType:
          type: string
          description: The method by which multiple unit event values are aggregated
          example: average
          enum:
            - average
            - sum
        analysisType:
          type: string
          description: The method for analyzing metric events
          example: mean
          enum:
            - mean
            - percentile
        percentileValue:
          type: integer
          description: >-
            The percentile for the analysis method. An integer denoting the
            target percentile between 0 and 100. Required when
            <code>analysisType</code> is <code>percentile</code>.
          example: 95
        eventDefault:
          $ref: '#/components/schemas/MetricEventDefaultRep'
        dataSource:
          $ref: '#/components/schemas/MetricDataSourceRefRep'
        lastSeen:
          $ref: '#/components/schemas/UnixMillis'
          description: Timestamp of most recent data for this metric, at one-hour fidelity
        archived:
          type: boolean
          description: Whether the metric version is archived
        archivedAt:
          $ref: '#/components/schemas/UnixMillis'
          description: Timestamp when the metric version was archived
          example: '1609459200000'
        selector:
          type: string
          description: For click metrics, the CSS selectors
        urls:
          $ref: '#/components/schemas/UrlMatchers'
          description: For click and pageview metrics, the target URLs
          example: '[{"kind":"exact","url":"https://www.example.com/page1"}]'
        windowStartOffset:
          type: integer
          format: int64
          description: >-
            Not yet implemented - The start of the measurement window, in
            milliseconds relative to the unit's first exposure to a flag
            variation
        windowEndOffset:
          type: integer
          format: int64
          description: >-
            Not yet implemented - The end of the measurement window, in
            milliseconds relative to the unit's first exposure to a flag
            variation
        traceQuery:
          type: string
          description: For trace metrics, the trace query to use for the metric.
          example: service.name = "checkout"
        traceValueLocation:
          type: string
          description: >-
            For trace metrics, the location in the trace to use for numeric
            values.
          example: duration
        experiments:
          $ref: '#/components/schemas/DependentExperimentListRep'
          description: >-
            Experiments that use this metric, including those using a metric
            group that contains this metric
        metricGroups:
          type: array
          description: Metric groups that use this metric
          items:
            $ref: '#/components/schemas/DependentMetricGroupRep'
        lastUsedInExperiment:
          $ref: '#/components/schemas/DependentExperimentRep'
          description: The most recent experiment that used this metric
        lastUsedInGuardedRollout:
          $ref: '#/components/schemas/DependentMeasuredRolloutRep'
          description: The most recent guarded rollout that used this metric
        isActive:
          type: boolean
          description: Whether the metric is active
          example: true
        _attachedFeatures:
          type: array
          description: Details on the flags attached to this metric
          items:
            $ref: '#/components/schemas/FlagListingRep'
    InvalidRequestErrorRep:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Specific error code encountered
          example: invalid_request
        message:
          type: string
          description: Description of the error
          example: Invalid request body
    UnauthorizedErrorRep:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Specific error code encountered
          example: unauthorized
        message:
          type: string
          description: Description of the error
          example: Invalid access token
    ForbiddenErrorRep:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Specific error code encountered
          example: forbidden
        message:
          type: string
          description: Description of the error
          example: Forbidden. Access to the requested resource was denied.
    NotFoundErrorRep:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Specific error code encountered
          example: not_found
        message:
          type: string
          description: Description of the error
          example: Invalid resource identifier
    StatusConflictErrorRep:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Specific error code encountered
          example: optimistic_locking_error
        message:
          type: string
          description: Description of the error
          example: Conflict. Optimistic lock error. Try again later.
    RateLimitedErrorRep:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Specific error code encountered
          example: rate_limited
        message:
          type: string
          description: Description of the error
          example: You've exceeded the API rate limit. Try again later.
    UrlPost:
      type: object
      properties:
        kind:
          type: string
          enum:
            - exact
            - canonical
            - substring
            - regex
        url:
          type: string
        substring:
          type: string
        pattern:
          type: string
    MetricEventDefaultRep:
      type: object
      properties:
        disabled:
          type: boolean
          description: >-
            Whether to disable defaulting missing unit events when calculating
            results. Defaults to false
        value:
          type: number
          description: >-
            The default value applied to missing unit events. Set to 0 when
            <code>disabled</code> is false. No other values are currently
            supported.
          example: 0
    MetricDataSourceRefRep:
      type: object
      required:
        - key
      properties:
        key:
          type: string
        environmentKey:
          type: string
        _name:
          type: string
        _integrationKey:
          type: string
    EventFilter:
      type: object
      required:
        - type
        - op
        - values
        - negate
      properties:
        type:
          type: string
          description: Filter type. One of [contextAttribute, eventProperty, group]
          example: contextAttribute
        attribute:
          type: string
          description: >-
            If not a group node, the context attribute name or event property
            name to filter on
          example: country
        op:
          $ref: '#/components/schemas/Operator'
          description: The function to perform
          example: in
        values:
          type: array
          description: >-
            The context attribute / event property values or group member nodes.
            Numeric values must not exceed 14 decimal places.
          items: {}
          example:
            - JP
        contextKind:
          type: string
          description: For context attribute filters, the context kind.
          example: user
        negate:
          type: boolean
          description: >-
            If set, then take the inverse of the operator. 'in' becomes 'not
            in'.
          example: false
    Link:
      type: object
      properties:
        href:
          type: string
        type:
          type: string
    Access:
      type: object
      required:
        - denied
        - allowed
      properties:
        denied:
          type: array
          items:
            $ref: '#/components/schemas/AccessDenied'
        allowed:
          type: array
          items:
            $ref: '#/components/schemas/AccessAllowedRep'
    UnixMillis:
      type: integer
      format: int64
    Modification:
      type: object
      properties:
        date:
          type: string
          format: date-time
          example: '2021-08-05T19:46:31.148082Z'
    MemberSummary:
      type: object
      required:
        - _links
        - _id
        - role
        - email
      properties:
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Link'
          description: The location and content type of related resources
          example:
            self:
              href: /api/v2/members/569f183514f4432160000007
              type: application/json
        _id:
          type: string
          description: The member's ID
          example: 569f183514f4432160000007
        firstName:
          type: string
          description: The member's first name
          example: Ariel
        lastName:
          type: string
          description: The member's last name
          example: Flores
        role:
          type: string
          description: >-
            The member's base role. If the member has no additional roles, this
            role will be in effect.
          example: admin
        email:
          type: string
          description: The member's email address
          example: ariel@acme.com
    Filter:
      type: object
      required:
        - type
        - op
        - values
        - negate
      properties:
        type:
          type: string
          description: Filter type. One of [contextAttribute, eventProperty, group]
          example: contextAttribute
          enum:
            - group
            - contextAttribute
            - eventProperty
        attribute:
          type: string
          description: >-
            If not a group node, the context attribute name or event property
            name to filter on
          example: country
        op:
          $ref: '#/components/schemas/Operator'
          description: The function to perform
          example: in
        values:
          type: array
          description: The context attribute / event property values or group member nodes
          items: {}
          example:
            - JP
        contextKind:
          type: string
          description: For context attribute filters, the context kind.
          example: user
        negate:
          type: boolean
          description: >-
            If set, then take the inverse of the operator. 'in' becomes 'not
            in'.
          example: false
    UrlMatchers:
      items:
        $ref: '#/components/schemas/UrlMatcher'
      type: array
    DependentExperimentListRep:
      type: array
      items:
        $ref: '#/components/schemas/DependentExperimentRep'
    DependentMetricGroupRep:
      type: object
      required:
        - key
        - name
        - kind
        - _links
      properties:
        key:
          type: string
          description: A unique key to reference the metric group
          example: metric-group-key-123abc
        name:
          type: string
          description: A human-friendly name for the metric group
          example: My metric group
        kind:
          type: string
          description: The type of the metric group
          example: funnel
          enum:
            - funnel
            - standard
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Link'
          description: The location and content type of related resources
          example:
            parent:
              href: /api/v2/projects/my-project
              type: application/json
            self:
              href: /api/v2/projects/my-project/metric-groups/my-metric-group
              type: application/json
    DependentExperimentRep:
      type: object
      required:
        - key
        - name
        - environmentId
        - environmentKey
        - creationDate
        - _links
      properties:
        key:
          type: string
          description: The experiment key
          example: experiment-key-123abc
        name:
          type: string
          description: The experiment name
          example: Example experiment
        environmentId:
          type: string
          description: The environment ID
          example: 1234a56b7c89d012345e678f
        environmentKey:
          type: string
          description: The environment key
          example: production
        creationDate:
          $ref: '#/components/schemas/UnixMillis'
          description: Timestamp of when the experiment was created
          example: '1654104600000'
        archivedDate:
          $ref: '#/components/schemas/UnixMillis'
          description: Timestamp of when the experiment was archived
          example: '1654104600000'
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Link'
          description: The location and content type of related resources
          example:
            parent:
              href: /api/v2/projects/my-project/environments/my-environment
              type: application/json
            self:
              href: >-
                /api/v2/projects/my-project/environments/my-environment/experiments/example-experiment
              type: application/json
    DependentMeasuredRolloutRep:
      type: object
      required:
        - _id
        - flagKey
        - flagName
        - environmentKey
        - environmentName
        - status
        - creationDate
        - _links
      properties:
        _id:
          type: string
          description: The guarded rollout measured rollout Id
          example: 885ccadf-181b-4a9a-8414-7ad6f7ba2db0
        flagKey:
          type: string
          description: 'The guarded rollout flag key '
          example: my-flag
        flagName:
          type: string
          description: 'The guarded rollout flag name '
          example: My Flag
        flagPurpose:
          type: string
          description: The guarded rollout flag purpose
          example: migration
        environmentKey:
          type: string
          description: The guarded rollout environment key
          example: production
        environmentName:
          type: string
          description: The guarded rollout environment name
          example: Production
        status:
          type: string
          description: The guarded rollout status
          example: monitoring
        creationDate:
          $ref: '#/components/schemas/UnixMillis'
          description: Timestamp of when the guarded rollout was created
          example: '1654104600000'
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Link'
          description: The location and content type of related resources
          example:
            self:
              href: >-
                /api/v2/projects/my-project/flags/my-flag/environments/production/measured-rollouts/885ccadf-181b-4a9a-8414-7ad6f7ba2db0
              type: application/json
    FlagListingRep:
      type: object
      required:
        - name
        - key
      properties:
        name:
          type: string
          description: The flag name
          example: Example flag
        key:
          type: string
          description: The flag key
          example: flag-key-123abc
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Link'
        _site:
          $ref: '#/components/schemas/Link'
    Operator:
      type: string
    AccessDenied:
      type: object
      required:
        - action
        - reason
      properties:
        action:
          $ref: '#/components/schemas/ActionIdentifier'
        reason:
          $ref: '#/components/schemas/AccessDeniedReason'
    AccessAllowedRep:
      type: object
      required:
        - action
        - reason
      properties:
        action:
          $ref: '#/components/schemas/ActionIdentifier'
        reason:
          $ref: '#/components/schemas/AccessAllowedReason'
    UrlMatcher:
      type: object
      additionalProperties: {}
    ActionIdentifier:
      type: string
    AccessDeniedReason:
      type: object
      required:
        - effect
      properties:
        resources:
          type: array
          description: Resource specifier strings
          items:
            type: string
          example:
            - proj/*:env/*;qa_*:/flag/*
        notResources:
          type: array
          description: >-
            Targeted resources are the resources NOT in this list. The
            <code>resources</code> and <code>notActions</code> fields must be
            empty to use this field.
          items:
            type: string
        actions:
          type: array
          description: Actions to perform on a resource
          items:
            $ref: '#/components/schemas/ActionSpecifier'
          example:
            - '*'
        notActions:
          type: array
          description: >-
            Targeted actions are the actions NOT in this list. The
            <code>actions</code> and <code>notResources</code> fields must be
            empty to use this field.
          items:
            $ref: '#/components/schemas/ActionSpecifier'
        effect:
          type: string
          description: >-
            Whether this statement should allow or deny actions on the
            resources.
          example: allow
          enum:
            - allow
            - deny
        role_name:
          type: string
    AccessAllowedReason:
      type: object
      required:
        - effect
      properties:
        resources:
          type: array
          description: Resource specifier strings
          items:
            type: string
          example:
            - proj/*:env/*;qa_*:/flag/*
        notResources:
          type: array
          description: >-
            Targeted resources are the resources NOT in this list. The
            <code>resources</code> and <code>notActions</code> fields must be
            empty to use this field.
          items:
            type: string
        actions:
          type: array
          description: Actions to perform on a resource
          items:
            $ref: '#/components/schemas/ActionSpecifier'
          example:
            - '*'
        notActions:
          type: array
          description: >-
            Targeted actions are the actions NOT in this list. The
            <code>actions</code> and <code>notResources</code> fields must be
            empty to use this field.
          items:
            $ref: '#/components/schemas/ActionSpecifier'
        effect:
          type: string
          description: >-
            Whether this statement should allow or deny actions on the
            resources.
          example: allow
          enum:
            - allow
            - deny
        role_name:
          type: string
    ActionSpecifier:
      type: string
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization

````