Try it free

Create a bucket

  • Latest Dynatrace
  • Reference
  • Published Oct 13, 2026

Create a custom Grail bucket in Dynatrace with the Storage Management API by setting the bucket name, table, retention, and optional display name or class.

POSTSaaShttps://{your-environment-id}.apps.dynatrace.com/platform/storage/management/v1/bucket-definitions

Overview

Create a new custom bucket.

Bucket creation can take up to 1 minute.

To create a new custom Grail bucket with Storage Management you need to specify the following values:

Allowed JSON values

  • bucketName defines the name of the bucket. The bucket name can't be edited or changed at a later time.

    • must be unique

    • has to be between 3-100 characters long and has to start with a letter

    • can only contain

      • lowercase alphanumeric characters [ a - z ]

      • underscores [ _ ] and

      • hyphens [ - ].

    • must not start with

      • default_

      • dt_

  • table name of the table this bucket is assigned to. Currently allowed one of [logs, events, bizevents, spans, security.events, user.sessions, user.events].

  • retentionDays describes the data retention period in days between 1 day - 3657 days (10 years + 1 week).

  • displayName Optional field that can be used to describe the bucket. Length of the field is limited to 200 characters.

  • bucketClass Optional field that can be used to specify the bucket class. Allowed values are live and historic. If not specified, the bucket class will be set to live by default.

Authentication

To execute this request, you need a platform token or OAuth access token with storage:bucket-definitions:write scope. To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
bodyCreateBucket

New Bucket

bodyRequired

Request body objects

The CreateBucket object

ElementTypeDescriptionRequired
bucketClassstring

Classification of the bucket. Determines the ingest mode. Allowed values: live, historic. Defaults to live if not specified. Historic buckets are only supported for table 'logs'.

The element can hold these values
  • live
  • historic
Optional
bucketNamestring

The unique identifier of the bucket within the tenant.

Required
displayNamestring

Descriptive name of the bucket. No restriction regarding unique naming or valid characters.

Optional
includedQueryLimitDaysinteger

The period in days in which queries from the bucket are included in the pricing model.

Optional
includedQueryLimitDaysOrDefaultinteger-Optional
metricIntervalstring

Interval of aggregated metric data. Only applies to metric buckets.

The element can hold these values
  • PT1M
  • PT5M
  • PT15M
  • PT1H
Optional
retentionDaysinteger

The retention period in days of the data in the bucket.

Optional
retentionDaysOrDefaultinteger-Optional
tablestring

Name of the table the bucket is assigned to. One of [logs, events, bizevents, spans, security.events, user.sessions, user.events]

Required

Request body JSON model

This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.

{
"bucketName": "custom_logs",
"table": "logs",
"displayName": "Custom logs bucket",
"retentionDays": 35,
"includedQueryLimitDays": 0
}

Response

Response codes

CodeTypeDescription
201Bucket

Successfully created bucket definition

400ErrorEnvelope

bad request

401ErrorEnvelope

unauthorized

403ErrorEnvelope

missing permissions

409ErrorEnvelope

Bucket already exists

Response body objects

The Bucket object

ElementTypeDescription
bucketClassstring

The class of the bucket. Read-only after creation.

The element can hold these values
  • live
  • historic
bucketNamestring

The unique identifier of the bucket within the tenant.

displayNamestring

Descriptive name of the bucket. No restriction regarding unique naming or valid characters.

estimatedUncompressedBytesinteger

Estimated uncompressed size of the bucket in bytes.

estimatedUncompressedBytesOnDemandinteger

Estimated uncompressed size of on-demand data in the bucket in bytes.

estimatedUncompressedBytesQueryIncludedinteger

Estimated uncompressed size of query-included data in the bucket in bytes.

includedQueryLimitDaysinteger

The period in days in which queries from the bucket are included in the pricing model.

metricIntervalstring

Interval of aggregated metric data. Only applies to metric buckets.

The element can hold these values
  • PT1S
  • PT5S
  • PT10S
  • PT1M
  • PT5M
  • PT15M
  • PT1H
recordsinteger

Amount of records in the bucket.

retentionDaysinteger

The retention period in days of the data in the bucket.

statusstring

The current status of the bucket, depending on bucket lifecycle.

The element can hold these values
  • creating
  • active
  • updating
  • deleting
tablestring

Name of the table the bucket is assigned to.

updatableboolean

A flag indicating whether a bucket can be updated or not.

versioninteger

Optimistic locking version. Update requests define with this on which version the data updated is based on. This must match with the version stored, otherwise the update will fail due to concurrent modification.

The ErrorEnvelope object

ElementTypeDescription
errorExceptionalReturn-

The ExceptionalReturn object

ElementTypeDescription
codeinteger-
errorDetails(CustomValidationErrorInfo | InvalidAuditEventsErrorInfo | MediaTypeErrorInfo | ParameterErrorInfo | ProxyErrorInfo | QueryFrontendRawErrorInfo | RequestBodyErrorInfo)[]-
messagestring-

The CustomValidationErrorInfo object

The ErrorInfo object

ElementTypeDescription
messagestring-

The InvalidAuditEventsErrorInfo object

The MediaTypeErrorInfo object

The ParameterErrorInfo object

The ProxyErrorInfo object

The QueryFrontendRawErrorInfo object

The RequestBodyErrorInfo object

Response body JSON models

{
"bucketName": "custom_logs",
"table": "logs",
"displayName": "Custom logs bucket",
"status": "creating",
"retentionDays": 35,
"includedQueryLimitDays": 0,
"version": 1,
"updatable": true
}
{
"error": {
"code": 400,
"message": "Missing request header",
"errorDetails": [
{
"type": "parameter",
"parameterDescriptor": "Dt-Tenant",
"message": "is required"
}
]
}
}
Related tags
Platform APIDynatrace Platform