---
title: "POST /v2/{+parent}/profiles"
method: POST
path: "/v2/{+parent}/profiles"
tags: ["projects"]
---

# POST /v2/{+parent}/profiles

`POST /v2/{+parent}/profiles`

CreateProfile creates a new profile resource in the online mode. _Direct use of this API is discouraged, please use a [supported profiler agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) instead for profile collection._ The server ensures that the new profiles are created at a constant rate per deployment, so the creation request may hang for some time until the next profile session is available. The request may fail with ABORTED error if the creation is not available within ~1m, the response will indicate the duration of the backoff the client should take before attempting creating a profile again. The backoff duration is returned in google.rpc.RetryInfo extension on the response status. To a gRPC client, the extension will be return as a binary-serialized proto in the trailing metadata item named "google.rpc.retryinfo-bin".

## Path parameters

- `parent` string, required

## Request body

- CreateProfileRequest — CreateProfileRequest describes a profile resource online creation request. The deployment field must be populated. The profile_type specifies the list of profile types supported by the agent. The creation call will hang until a profile of one of these types needs to be collected.
  - `deployment` Deployment — Deployment contains the deployment identification information.
    - `target` string — Target is the service name used to group related deployments: * Service name for App Engine Flex / Standard. * Cluster and container name for GKE. * User-specified string for direct Compute Engine profiling (e.g. Java). * Job name for Dataflow. Validation regex: `^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$`.
    - `projectId` string — Project ID is the ID of a cloud project. Validation regex: `^a-z{4,61}[a-z0-9]$`.
    - `labels` object — Labels identify the deployment within the user universe and same target. Validation regex for label names: `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. Value for an individual label must be <= 512 bytes, the total size of all label names and values must be <= 1024 bytes. Label named "language" can be used to record the programming language of the profiled deployment. The standard choices for the value include "java", "go", "python", "ruby", "nodejs", "php", "dotnet". For deployments running on Google Cloud Platform, "zone" or "region" label should be present describing the deployment location. An example of a zone is "us-central1-a", an example of a region is "us-central1" or "us-central".
  - `profileType` string[] — One or more profile types that the agent is capable of providing.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/cloudprofiler.md) · [All operations](https://skmtc.net/google/apis/cloudprofiler/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/cloudprofiler/versions/cf0c2e144e8f/schema)
