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

# Get merged profile

> Returns a merged profile for the given application over the specified time range. The output format is controlled by the `out` query parameter: `pprof` returns a gzipped protobuf with Content-Disposition header, `dot` returns a GraphViz DOT graph, `flamebearerv2` returns JSON flame graph data



## OpenAPI

````yaml https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{envId}/continuous-profiling/app/{app}/merge
openapi: 3.0.1
info:
  title: Upsun.com Rest API
  version: '1.0'
  contact:
    name: Support
    url: https://upsun.com/contact-us/
  termsOfService: https://upsun.com/trust-center/legal/tos/
  description: >
    # Introduction


    Upsun, formerly Platform.sh, is a container-based Platform-as-a-Service. Our
    main API

    is simply Git. With a single `git push` and a couple of YAML files in

    your repository you can deploy an arbitrarily complex cluster.

    Every [**Project**](#tag/Project) can have multiple applications (PHP,

    Node.js, Python, Ruby, Go, etc.) and managed, automatically

    provisioned services (databases, message queues, etc.).


    Each project also comes with multiple concurrent

    live staging/development [**Environments**](#tag/Environment).

    These ephemeral development environments

    are automatically created every time you push a new branch or create a

    pull request, and each has a full copy of the data of its parent branch,

    which is created on-the-fly in seconds.


    Our Git implementation supports integrations with third party Git

    providers such as GitHub, Bitbucket, or GitLab, allowing you to simply

    integrate Upsun into your existing workflow.


    ## Using the REST API


    In addition to the Git API, we also offer a REST API that allows you to
    manage

    every aspect of the platform, from managing projects and environments,

    to accessing accounts and subscriptions, to creating robust workflows

    and integrations with your CI systems and internal services.


    These API docs are generated from a standard **OpenAPI (Swagger)**
    Specification document

    which you can find here in [YAML](openapispec-upsun.yaml) and in
    [JSON](openapispec-upsun.json) formats.


    This RESTful API consumes and produces HAL-style JSON over HTTPS,

    and any REST library can be used to access it. On GitHub, we also host

    a few API libraries that you can use to make API access easier, such as our

    [PHP API client](https://github.com/upsun/upsun-sdk-php).


    In order to use the API you will first need to have an [Upsun
    account](https://auth.upsun.com/register/) 

    and [create an API Token](https://docs.upsun.com/anchors/cli/api-token/).


    # Authentication


    ## OAuth2


    API authentication is done with OAuth2 access tokens.


    ### API tokens


    You can use an API token as one way to get an OAuth2 access token. This

    is particularly useful in scripts, e.g. for CI pipelines.


    To create an API token, go to the "API Tokens" section

    of the "Account Settings" tab on the [Console](https://console.upsun.com).


    To exchange this API token for an access token, a `POST` request

    must be made to `https://auth.upsun.com/oauth2/token`.


    The request will look like this in cURL:


    <pre>

    curl -u platform-api-user: \
        -d 'grant_type=api_token&amp;api_token=<em><b>API_TOKEN</b></em>' \
        https://auth.upsun.com/oauth2/token
    </pre>


    This will return a "Bearer" access token that

    can be used to authenticate further API requests, for example:


    <pre>

    {
        "access_token": "<em><b>abcdefghij1234567890</b></em>",
        "expires_in": 900,
        "token_type": "bearer"
    }

    </pre>


    ### Using the Access Token


    To authenticate further API requests, include this returned bearer token

    in the `Authorization` header. For example, to retrieve a list of

    [Projects](#tag/Project)

    accessible by the current user, you can make the following request

    (substituting the dummy token for your own):


    <pre>

    curl -H "Authorization: Bearer <em><b>abcdefghij1234567890</b></em>" \
        https://api.upsun.com/projects
    </pre>


    # HAL Links


    Most endpoints in the API return fields which defines a HAL

    (Hypertext Application Language) schema for the requested endpoint.

    The particular objects returns and their contents can vary by endpoint.

    The payload examples we give here for the requests do not show these

    elements. These links can allow you to create a fully dynamic API client

    that does not need to hardcode any method or schema.


    Unless they are used for pagination we do not show the HAL links in the

    payload examples in this documentation for brevity and as their content

    is contextual (based on the permissions of the user).


    ## _links Objects


    Most endpoints that respond to `GET` requests will include a `_links` object

    in their response. The `_links` object contains a key-object pair labelled
    `self`, which defines

    two further key-value pairs:


    * `href` - A URL string referring to the fully qualified name of the
    returned object. For many endpoints, this will be the direct link to the API
    endpoint on the region gateway, rather than on the general API gateway. This
    means it may reference a host of, for example, `eu-2.platform.sh` rather
    than `api.upsun.com`.

    * `meta` - An object defining the OpenAPI Specification (OAS) [schema
    object](https://swagger.io/specification/#schemaObject) of the component
    returned by the endpoint.


    There may be zero or more other fields in the `_links` object resembling
    fragment identifiers

    beginning with a hash mark, e.g. `#edit` or `#delete`. Each of these keys

    refers to a JSON object containing two key-value pairs:


    * `href` - A URL string referring to the path name of endpoint which can
    perform the action named in the key.

    * `meta` - An object defining the OAS schema of the endpoint. This consists
    of a key-value pair, with the key defining an HTTP method and the value
    defining the [operation
    object](https://swagger.io/specification/#operationObject) of the endpoint.


    To use one of these HAL links, you must send a new request to the URL
    defined

    in the `href` field which contains a body defined the schema object in the
    `meta` field.


    For example, if you make a request such as `GET
    /projects/abcdefghij1234567890`, the `_links`

    object in the returned response will include the key `#delete`. That object

    will look something like this fragment:


    ```

    "#delete": {
        "href": "/api/projects/abcdefghij1234567890",
        "meta": {
            "delete": {
                "responses": {
                    . . . // Response definition omitted for space
                },
                "parameters": []
            }
        }
    }

    ```


    To use this information to delete a project, you would then send a `DELETE`

    request to the endpoint
    `https://api.upsun.com/api/projects/abcdefghij1234567890`

    with no body or parameters to delete the project that was originally
    requested.


    ## _embedded Objects


    Requests to endpoints which create or modify objects, such as `POST`,
    `PATCH`, or `DELETE`

    requests, will include an `_embedded` key in their response. The object

    represented by this key will contain the created or modified object. This

    object is identical to what would be returned by a subsequent `GET` request

    for the object referred to by the endpoint.
  x-logo:
    url: https://docs.upsun.com/images/upsun-api.svg
    href: https://upsun.com/#section/Introduction
    altText: Upsun logo
servers:
  - url: '{schemes}://api.upsun.com'
    description: The Upsun.com API gateway
    variables:
      schemes:
        default: https
security:
  - BearerAuth: []
tags:
  - name: Cert Management
    description: >
      User-supplied SSL/TLS certificates can be managed using these

      endpoints. You can now list and modify certificate provisioners

      using the `/projects/{projectId}/provisioners` and

      `/projects/{projectId}/provisioners/{certificateProvisionerDocumentId}`

      endpoints. For more information, see our

      [Third-party TLS
      certificate](https://docs.upsun.com/anchors/domains/custom/custom-certificates/)

      documentation. These endpoints are not for managing certificates

      that are automatically supplied by Upsun via Let's Encrypt.
  - name: Environment
    description: |
      On Upsun, an environment encompasses a single instance of your
      entire application stack, the services used by the application,
      the application's data storage, and the environment's backups.

      In general, an environment represents a single branch or merge request
      in the Git repository backing a project. It is a virtual cluster
      of read-only application and service containers with read-write
      mounts for application and service data.

      On Upsun, the default branch is your production environment—thus,
      merging changes to this branch will put those changes to production.
  - name: Environment Type
    description: >
      Environment Types is the way Upsun manages access. We currently have 3
      environment types:

      * Development

      * Staging

      * Production


      Each environment type will contain a group of users and their accesses. We
      manage access,

      adding, updating and removing users and their roles, here.


      Each environment will have a type, pointing to one of these 3 environment
      types.

      See `type` in [Environments](#tag/Environment).


      In general:

      * Production will be reserved for the default branch, and cannot be set
      manually.

      * An environment can be set to be type `staging` or development manually
      and when branching.


      Dedicated Generation 2 projects have different rules for environment
      types. If your project

      contains at least one of those Dedicated Generation 2 environments, the
      rules are slightly different:

      * All non-dedicated environments in your project can be `development` or
      `staging`, but never `production`.

      * Dedicated Generation 2 environments can be set either to `staging` or
      `production`, but never `development`.

      * The default branch is not considered to be a special case.
  - name: Environment Backups
    description: |
      A snapshot is a complete backup of an environment, including all the
      persistent data from all services running in an environment and all
      files present in mounted volumes.

      These endpoints can be used to trigger the creation of new backups,
      get information about existing backups, delete existing backups or
      restore a backup.
      More information about backups can be found in our
      [documentation](https://docs.upsun.com/anchors/environments/backup/).
  - name: Environment Variables
    description: >
      These endpoints manipulate user-defined variables which are bound to a

      specific environment, as well as (optionally) the children of an

      environment. These variables can be made available at both build time

      and runtime. For more information on environment variables,

      see the
      [Variables](https://docs.upsun.com/anchors/variables/set/environment/create/)

      section of the documentation.
  - name: Autoscaling
    description: >
      Upsun provides native support for autoscaling, allowing your applications
      to automatically adjust based on resource usage.

      This ensures that your apps remain responsive under load while helping you
      optimize costs.

      You can configure thresholds for metrics such as CPU, RAM, and request
      latency.  

      Resources will automatically scale to meet demand.

      Each container profile assigned to an application or service provides a
      specific combination of CPU and RAM, which you can select via the Upsun UI
      or CLI.


      These endpoints manage autoscaling configurations that are tied to a

      specific environment, and optionally to its child environments.

      You can define scaling rules based on metrics like CPU, memory, or

      request latency, and these rules will be applied at both build time

      and runtime. For more information on configuring autoscaling for your

      environments, see the
      [Autoscaling](https://docs.upsun.com/manage-resources/autoscaling.html)
      section

      of the documentation.
  - name: Project
    description: >
      ## Project Overview


      On Upsun, a Project is backed by a single Git repository

      and encompasses your entire application stack, the services

      used by your application, the application's data storage,

      the production and staging environments, and the backups of those

      environments.


      When you create a new project, you start with a single

      [Environment](#tag/Environment) called *Master*,

      corresponding to the master branch in the Git repository of

      the project—this will be your production environment.


      If you connect your project to an external Git repo

      using one of our [Third-Party Integrations](#tag/Third-Party-Integrations)

      a new development environment can be created for each branch

      or pull request created in the repository. When a new development

      environment is created, the production environment's data

      will be cloned on-the-fly, giving you an isolated, production-ready

      test environment.


      This set of API endpoints can be used to retrieve a list of projects

      associated with an API key, as well as create and update the parameters

      of existing projects.


      > **Note**:

      >

      > To list projects or to create a new project, use
      [`/subscriptions`](#tag/Subscriptions).
  - name: Project Variables
    description: >
      These endpoints manipulate user-defined variables which are bound to an

      entire project. These variables are accessible to all environments

      within a single project, and they can be made available at both build

      time and runtime. For more information on project variables,

      see the
      [Variables](https://docs.upsun.com/anchors/variables/set/project/create/)

      section of the documentation.
  - name: Project Settings
    description: >
      These endpoints can be used to retrieve and manipulate project-level

      settings. Only the `initialize` property can be set by end users. It is
      used

      to initialize a project from an existing Git repository.


      The other properties can only be set by a privileged user.
  - name: Repository
    description: >
      The Git repository backing projects hosted on Upsun can be

      accessed in a **read-only** manner through the
      `/projects/{projectId}/git/*`

      family of endpoints. With these endpoints, you can retrieve objects from

      the Git repository in the same way that you would in a local environment.
  - name: Domain Management
    description: |
      These endpoints can be used to add, modify, or remove domains from
      a project. For more information on how domains function on
      Upsun, see the [Domains](https://docs.upsun.com/anchors/domains/custom/)
      section of our documentation.
  - name: Routing
    description: >
      These endpoints modify an environment's `routes:` section of the
      `.upsun/config.yaml` file.

      For routes to propagate to child environments, the child environments

      must be synchronized with their parent.


      More information about routing can be found in the
      [Routes](https://docs.upsun.com/anchors/routes/)

      section of the documentation.
  - name: Source Operations
    description: >
      These endpoints interact with source code operations as defined in the
      `source.operations`

      key in a project's `.upsun/config.yaml` configuration. More information

      on source code operations is

      [available in our user
      documentation](https://docs.upsun.com/anchors/app/source-operations/).
  - name: Deployment Target
    description: |
      Upsun is capable of deploying the production environments of
      projects in multiple topologies: both in clusters of containers, and
      as dedicated virtual machines. This is an internal API that can
      only be used by privileged users.
  - name: Deployments
    description: |
      The deployments endpoints gives detailed information about the actual
      deployment of an active environment. Currently, it returns the _current_
      deployment with information about the different apps, services, and
      routes contained within.
  - name: Third-Party Integrations
    description: |
      Upsun can easily integrate with many third-party services, including
      Git hosting services (GitHub, GitLab, and Bitbucket),
      health notification services (email, Slack, PagerDuty),
      performance analytics platforms (New Relic, Blackfire, Tideways),
      and webhooks.

      For clarification about what information each field requires, see the
      [External Integrations](https://docs.upsun.com/anchors/integrations/)
      documentation. NOTE: The names of the CLI arguments listed in the
      documentation are not always named exactly the same as the
      required body fields in the API request.
  - name: MFA
    description: >
      Multi-factor authentication (MFA) requires the user to present two (or
      more) types of evidence (or factors) to prove their identity.


      For example, the evidence might be a password and a device-generated code,
      which show the user has the knowledge factor ("something you know") 

      as well as the possession factor ("something you have"). In this way MFA
      offers good protection against the compromise of any single factor, 

      such as a stolen password.


      Using the MFA API you can set up time-based one-time passcodes (TOTP),
      which can be generated on a single registered device ("something you
      have") such as a mobile phone.
  - name: Subscriptions
    description: >
      Each project is represented by a subscription that holds the plan
      information.

      These endpoints can be used to go to a larger plan, add more storage, or
      subscribe to

      optional features.
  - name: Orders
    description: |
      These endpoints can be used to retrieve order information from our billing
      system. Here you can view information about your bill for our services,
      include the billed amount and a link to a PDF of the bill.
  - name: Invoices
    description: >
      These endpoints can be used to retrieve invoices from our billing system.

      An invoice of type "invoice" is generated automatically every month, if
      the customer has active projects.

      Invoices of type "credit_memo" are a result of manual action when there
      was a refund or an invoice correction.
  - name: Vouchers
    description: >
      These endpoints can be used to retrieve vouchers associated with a
      particular

      user as well as apply a voucher to a particular user.
  - name: Records
    description: >
      These endpoints retrieve information about which plans were assigned to a
      particular

      project at which time.
  - name: Support
    description: >
      These endpoints can be used to retrieve information about support ticket
      priority

      and allow you to submit new ticket to the Upsun Support Team.
  - name: System Information
    description: >
      These endpoints can be used to retrieve low-level information and interact
      with the

      core component of Upsun infrastructure.


      This is an internal API that can only be used by privileged users.
paths:
  /projects/{projectId}/environments/{envId}/continuous-profiling/app/{app}/merge:
    get:
      tags:
        - Continuous Profiling
      summary: Get merged profile
      description: >-
        Returns a merged profile for the given application over the specified
        time range. The output format is controlled by the `out` query
        parameter: `pprof` returns a gzipped protobuf with Content-Disposition
        header, `dot` returns a GraphViz DOT graph, `flamebearerv2` returns JSON
        flame graph data
      operationId: get_application_merge
      parameters:
        - name: projectId
          in: path
          required: true
          description: The unique identifier of the Upsun project
          schema:
            type: string
            pattern: '[a-z0-9]+'
            example: 22sdxmbrs4lai
        - name: envId
          in: path
          required: true
          description: The environment identifier
          schema:
            type: string
            pattern: .+
            example: main
        - name: app
          in: path
          required: true
          description: URL-encoded application name
          schema:
            type: string
            pattern: .+
            example: my-app
        - name: from
          in: query
          description: >-
            Start of the time range as a Unix timestamp, defaults to now minus
            30 minutes.
          schema:
            type: integer
            format: int64
            example: 1700000000
        - name: to
          in: query
          description: End of the time range as a Unix timestamp, defaults to now.
          schema:
            type: integer
            format: int64
            example: 1700003600
        - name: profile_type
          in: query
          description: Profile type to query.
          schema:
            type: string
            enum:
              - cpu
              - wall-time
              - wall
              - goroutine
              - alloc_objects
              - alloc_space
              - inuse_objects
              - inuse_space
              - space
            default: null
            example: cpu
        - name: out
          in: query
          description: Output format for the merged profile.
          schema:
            type: string
            enum:
              - pprof
              - dot
              - flamebearerv2
            default: null
            example: pprof
        - name: runtime_mode
          in: query
          description: >-
            Filter mode for runtime parameter. "1" (additive) includes only
            specified runtimes. "-1" (subtractive) excludes specified runtimes
            and includes all others.
          schema:
            type: integer
            enum:
              - 1
              - -1
            example: 1
        - name: runtime[]
          in: query
          description: >-
            Filter by runtime language. Can be specified multiple times for
            multiple values (e.g., ?runtime[]=go&runtime[]=python). Use
            runtime_mode to control inclusion/exclusion behavior.
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              example: go
        - name: runtime_version_mode
          in: query
          description: >-
            Filter mode for runtime_version parameter. "1" (additive) includes
            only specified versions. "-1" (subtractive) excludes specified
            versions and includes all others.
          schema:
            type: integer
            enum:
              - 1
              - -1
            example: 1
        - name: runtime_version[]
          in: query
          description: >-
            Filter by runtime version. Can be specified multiple times for
            multiple values (e.g.,
            ?runtime_version[]=1.21&runtime_version[]=1.22). Use
            runtime_version_mode to control inclusion/exclusion behavior.
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              example: '1.21'
        - name: runtime_arch_mode
          in: query
          description: >-
            Filter mode for runtime_arch parameter. "1" (additive) includes only
            specified architectures. "-1" (subtractive) excludes specified
            architectures and includes all others.
          schema:
            type: integer
            enum:
              - 1
              - -1
            example: 1
        - name: runtime_arch[]
          in: query
          description: >-
            Filter by runtime architecture. Can be specified multiple times for
            multiple values (e.g., ?runtime_arch[]=amd64&runtime_arch[]=arm64).
            Use runtime_arch_mode to control inclusion/exclusion behavior.
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              example: amd64
        - name: runtime_os_mode
          in: query
          description: >-
            Filter mode for runtime_os parameter. "1" (additive) includes only
            specified operating systems. "-1" (subtractive) excludes specified
            operating systems and includes all others.
          schema:
            type: integer
            enum:
              - 1
              - -1
            example: 1
        - name: runtime_os[]
          in: query
          description: >-
            Filter by runtime operating system. Can be specified multiple times
            for multiple values (e.g., ?runtime_os[]=linux&runtime_os[]=darwin).
            Use runtime_os_mode to control inclusion/exclusion behavior.
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              example: linux
        - name: probe_version_mode
          in: query
          description: >-
            Filter mode for probe_version parameter. "1" (additive) includes
            only specified probe versions. "-1" (subtractive) excludes specified
            probe versions and includes all others.
          schema:
            type: integer
            enum:
              - 1
              - -1
            example: 1
        - name: probe_version[]
          in: query
          description: >-
            Filter by probe version. Can be specified multiple times for
            multiple values (e.g.,
            ?probe_version[]=2.28.2&probe_version[]=2.28.1). Use
            probe_version_mode to control inclusion/exclusion behavior.
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              example: 2.28.2
      responses:
        '200':
          description: Merged profile retrieved successfully
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
                description: Gzipped pprof protobuf when `out=pprof`
            text/vnd.graphviz:
              schema:
                type: string
                description: GraphViz DOT graph when `out=dot`
            application/json:
              schema:
                type: object
                additionalProperties: false
                description: Flame graph JSON when `out=flamebearerv2`
                required:
                  - version
                  - flamebearer
                  - metadata
                  - _profile_type
                  - _sample_unit
                properties:
                  version:
                    type: integer
                    description: Flamebearer format version
                    example: 1
                  flamebearer:
                    type: object
                    additionalProperties: false
                    description: >-
                      Core flame graph data structure containing function names
                      and the hierarchical call tree encoded as levels of
                      4-tuples
                    required:
                      - names
                      - levels
                      - numTicks
                      - maxSelf
                    properties:
                      names:
                        type: array
                        description: >-
                          Array of function identifiers referenced by index in
                          `levels`. Each entry is a JSON-encoded location object
                          with `filename`, `name`, and `line` fields
                        items:
                          type: string
                          example: sync/atomic.(*Pointer).Store
                        example:
                          - total
                          - time.now
                          - sync/atomic.(*Pointer).Store
                      levels:
                        type: array
                        description: >-
                          Flame graph call tree encoded as levels. Each level is
                          a flat array of 4-tuples `[offset, total, self,
                          name_index]` where `offset` is the gap from the left
                          edge in sample units, `total` is the inclusive sample
                          count, `self` is the exclusive sample count, and
                          `name_index` references the `names` array
                        items:
                          type: array
                          example:
                            - 0
                            - 7361350000000
                            - 5310000000
                            - 0
                          items:
                            type: integer
                            example: 0
                        example:
                          - - 0
                            - 7361350000000
                            - 5310000000
                            - 0
                          - - 5310000000
                            - 160000000
                            - 0
                            - 1
                            - 0
                            - 483950000000
                            - 0
                            - 2
                      numTicks:
                        type: integer
                        description: Total number of samples across the entire profile
                        example: 7361350000000
                      maxSelf:
                        type: integer
                        description: Maximum exclusive (self) sample count across all nodes
                        example: 333800000000
                  metadata:
                    type: object
                    additionalProperties: false
                    description: >-
                      Profile metadata describing the format and sampling
                      configuration
                    required:
                      - format
                      - spyName
                      - sampleRate
                      - units
                      - name
                    properties:
                      format:
                        type: string
                        description: >-
                          Profile format. Always `single` for merged profiles
                          (`double` is used for diff profiles)
                        example: single
                      spyName:
                        type: string
                        description: >-
                          Name of the profiling agent that collected the data.
                          Always `unknown` for pprof-based profiles
                        example: unknown
                      sampleRate:
                        type: integer
                        description: Sampling rate in Hz used during profiling
                        example: 100
                      units:
                        type: string
                        description: >-
                          Unit of measure for sample values (e.g. `nanoseconds`,
                          `bytes`, `count`)
                        example: nanoseconds
                      name:
                        type: string
                        description: Human-readable name for the profile
                        example: merged_profile
                  timeline:
                    type: object
                    nullable: true
                    description: >-
                      Present for pyroscope flamebearer format compatibility.
                      Always null for merged profiles returned by this endpoint
                      — do not build UI to render this field
                    additionalProperties: false
                    required:
                      - startTime
                      - samples
                      - durationDelta
                    properties:
                      startTime:
                        type: integer
                        format: int64
                        description: Start of the timeline as a Unix timestamp in seconds
                        example: 1700000000
                      samples:
                        type: array
                        description: >-
                          Sequence of sample counts, one per time bucket
                          starting at `startTime` and spaced by `durationDelta`
                        items:
                          type: integer
                          example: 100
                        example:
                          - 100
                          - 200
                          - 150
                      durationDelta:
                        type: integer
                        format: int64
                        description: Time interval between consecutive samples in seconds
                        example: 10
                      watermarks:
                        type: object
                        description: Map of sample index to watermark timestamp
                        additionalProperties:
                          type: integer
                          format: int64
                    example: null
                  groups:
                    type: object
                    description: >-
                      Present for pyroscope flamebearer format compatibility.
                      Always an empty object for merged profiles returned by
                      this endpoint — do not build UI to render this field
                    additionalProperties:
                      type: object
                      additionalProperties: false
                      required:
                        - startTime
                        - samples
                        - durationDelta
                      properties:
                        startTime:
                          type: integer
                          format: int64
                          description: Start of the timeline as a Unix timestamp in seconds
                          example: 1700000000
                        samples:
                          type: array
                          description: >-
                            Sequence of sample counts, one per time bucket
                            starting at `startTime` and spaced by
                            `durationDelta`
                          items:
                            type: integer
                            example: 100
                          example:
                            - 100
                            - 200
                            - 150
                        durationDelta:
                          type: integer
                          format: int64
                          description: Time interval between consecutive samples in seconds
                          example: 10
                        watermarks:
                          type: object
                          description: Map of sample index to watermark timestamp
                          additionalProperties:
                            type: integer
                            format: int64
                    example: {}
                  heatmap:
                    type: object
                    nullable: true
                    description: >-
                      Present for pyroscope flamebearer format compatibility.
                      Always null for merged profiles returned by this endpoint
                      — do not build UI to render this field
                    additionalProperties: false
                    required:
                      - values
                      - timeBuckets
                      - valueBuckets
                      - startTime
                      - endTime
                      - minValue
                      - maxValue
                      - minDepth
                      - maxDepth
                    properties:
                      values:
                        type: array
                        description: >-
                          2D matrix of occurrence counts indexed as
                          `values[time_bucket][value_bucket]`
                        items:
                          type: array
                          example:
                            - 0
                            - 1
                            - 3
                            - 0
                          items:
                            type: integer
                            example: 0
                      timeBuckets:
                        type: integer
                        format: int64
                        description: Number of bins on the time (X) axis
                        example: 10
                      valueBuckets:
                        type: integer
                        format: int64
                        description: Number of bins on the value (Y) axis
                        example: 20
                      startTime:
                        type: integer
                        format: int64
                        description: Start of the time axis as Unix nanoseconds
                        example: 1700000000000000000
                      endTime:
                        type: integer
                        format: int64
                        description: End of the time axis as Unix nanoseconds
                        example: 1700003600000000000
                      minValue:
                        type: integer
                        description: Minimum value axis boundary
                        example: 0
                      maxValue:
                        type: integer
                        description: Maximum value axis boundary
                        example: 1000000
                      minDepth:
                        type: integer
                        description: Minimum non-zero count in the values matrix
                        example: 1
                      maxDepth:
                        type: integer
                        description: Maximum count in the values matrix
                        example: 500
                    example: null
                  _profile_type:
                    type: string
                    description: Profile type name
                    example: cpu
                  _sample_unit:
                    type: string
                    description: Unit of the sample values
                    example: nanoseconds
                  _aggregation_type:
                    type: string
                    description: Aggregation method for timeline data
                    enum:
                      - avg
                      - sum
                    example: sum
                  _application:
                    type: string
                    description: Application name the profile was collected from
                    example: ingester
                  _from:
                    type: string
                    format: date-time
                    description: Start of the merged time range
                    example: '2026-03-25T15:18:53Z'
                  _to:
                    type: string
                    format: date-time
                    description: End of the merged time range
                    example: '2026-04-01T14:18:53Z'
                  _scale_factor:
                    type: integer
                    description: Scale factor applied to sample values
                    example: 1
        '400':
          description: >-
            Bad request - Invalid parameters. Please consult the API
            documentation to fix the request parameters.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                required:
                  - code
                  - message
                properties:
                  code:
                    type: integer
                    example: 400
                  message:
                    type: string
                    example: invalid 'profile_type' parameter (invalid)
        '403':
          description: >-
            Forbidden - Access denied due to insufficient permissions, or the
            requested project/environment does not exist (to prevent information
            disclosure)
        '499':
          description: >-
            Query timeout - The query exceeded the server timeout limit. Please
            narrow down the query by reducing the time range or adding more
            specific filters
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                required:
                  - code
                  - message
                properties:
                  code:
                    type: integer
                    example: 499
                  message:
                    type: string
                    example: Timeout while querying data
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````