---
title: "Create Profile"
method: POST
path: "/profile"
tags: ["Profile"]
---

# Create Profile

`POST /profile`

## Request

- Base URL: `https://oneuptime.com/api`
- URL: `https://oneuptime.com/api/profile`
- Auth: API key in header `APIKey`
- TypeScript: <https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification/docs/profile/post.ts> (a function with typed inputs; its response is checked against the schema)

Endpoint to create a new Profile

## Request body

- object
  - `data` ProfileItemV3CreateSchema, required: Create schema for ProfileItemV3
    - `projectId` string, uuid: ID of project
    - `primaryEntityId` string, uuid, required: ID of the resource the profile belongs to (Service / Host / DockerHost / KubernetesCluster / Monitor — disambiguated by primaryEntityType)
    - `primaryEntityType` string: Discriminator for primaryEntityId — tells the read side which resource table to dispatch to
    - `profileId` string, required: Unique identifier for the profile
    - `traceId` string: Correlation with traces
    - `spanId` string: Correlation with spans
    - `startTime` string, date-time, required: Profile start timestamp
    - `endTime` string, date-time, required: Profile end timestamp
    - `startTimeUnixNano` union, required: Profile start timestamp in unix nanoseconds
      - number
      - string
    - `endTimeUnixNano` union, required: Profile end timestamp in unix nanoseconds
      - number
      - string
    - `durationNano` union, required: Duration of the profile in nanoseconds
      - number
      - string
    - `profileType` string, required: Type of profile (e.g., cpu, wall, alloc_objects, alloc_space, goroutine)
    - `unit` string, required: Unit of the profile values (e.g., nanoseconds, bytes)
    - `periodType` string: Sampling period type
    - `period` union: Sampling period value
      - number
      - string
    - `attributes` object: Profile-level attributes
    - `attributeKeys` string[]: Attribute keys extracted from attributes
    - `entityKeys` string[]: Stable keys of every OpenTelemetry entity (service, host, k8s.pod, container, ...) this signal belongs to. A superset that includes the primary entity. Enables cross-cutting membership queries via has(entityKeys, :key).
    - `serviceEntityKey` string: Scalar entity key for this entity type (see entityKeys); '' when the resource has no entity of this type.
    - `hostEntityKey` string: Scalar entity key for this entity type (see entityKeys); '' when the resource has no entity of this type.
    - `k8sPodEntityKey` string: Scalar entity key for this entity type (see entityKeys); '' when the resource has no entity of this type.
    - `k8sNodeEntityKey` string: Scalar entity key for this entity type (see entityKeys); '' when the resource has no entity of this type.
    - `k8sClusterEntityKey` string: Scalar entity key for this entity type (see entityKeys); '' when the resource has no entity of this type.
    - `containerEntityKey` string: Scalar entity key for this entity type (see entityKeys); '' when the resource has no entity of this type.
    - `sampleCount` number, required: Number of samples in this profile
    - `originalPayloadFormat` string: Format of the original payload (e.g., pprofext)

## Response `201`

Created successfully

- object
  - `data` ProfileItemV3ReadSchema
    - `projectId` string, required: Project ID
    - `primaryEntityId` string, required: Service ID
    - `primaryEntityType` string: Service Type
    - `profileId` string, required: Profile ID
    - `traceId` string: Trace ID
    - `spanId` string: Span ID
    - `startTime` string: Start Time
    - `endTime` string: End Time
    - `startTimeUnixNano` string: Start Time in Unix Nano
    - `endTimeUnixNano` string: End Time in Unix Nano
    - `durationNano` string: Duration in Nanoseconds
    - `profileType` string, required: Profile Type
    - `unit` string, required: Unit
    - `periodType` string: Period Type
    - `period` string: Period
    - `attributes` string: Attributes
    - `attributeKeys` string[]: Attribute Keys
    - `entityKeys` string[]: Entity Keys
    - `serviceEntityKey` string: Service Entity Key
    - `hostEntityKey` string: Host Entity Key
    - `k8sPodEntityKey` string: Kubernetes Pod Entity Key
    - `k8sNodeEntityKey` string: Kubernetes Node Entity Key
    - `k8sClusterEntityKey` string: Kubernetes Cluster Entity Key
    - `containerEntityKey` string: Container Entity Key
    - `sampleCount` number, required: Sample Count
    - `originalPayloadFormat` string: Original Payload Format

## Other responses

- `400`: Bad request. This response indicates that the request was malformed or contained invalid data.
- `401`: Unauthorized. This response indicates that the request requires user authentication.
- `402`: Payment Required. This response indicates that the request requires payment or a valid subscription.
- `403`: Forbidden. This response indicates that the server understood the request, but refuses to authorize it.
- `405`: Project not found. This response indicates that the requested project does not exist or is not accessible.
- `408`: Request Timeout. This response indicates that the server timed out waiting for the request.
- `415`: Unable to reach server. This response indicates that the server is currently unreachable or down.
- `422`: Not authorized. This response indicates that the user does not have permission to access the requested resource.
- `500`: Internal Server Error. This response indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.

---

[API](https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification.md) - [All operations](https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification/llms.txt) - [OpenAPI document](https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification/revisions/ba3307d00304?raw)
