---
type: api
title: Get charts by deployment. Currently unavailable in self-hosted ECE.
description: Retrieves the usage charts for the given  deployment.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/v4/operation/operation-get-costs-charts-by-deployment
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/v4/operation/operation-get-costs-charts-by-deployment
products:
  - Elastic Cloud Enterprise
---

# Get charts by deployment. Currently unavailable in self-hosted ECE.

deprecated

## Paths

- `GET` `/billing/costs/{organization_id}/deployments/{deployment_id}/charts`

- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/v4/authentication#basicauth)
- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/v4/authentication#apikey)

#### Path Parameters

- `organization_id` (string)
  Identifier for the organization
- `deployment_id` (string)
  Id of a Deployment

## Description

Retrieves the usage charts for the given  deployment.

## Query String Parameters

- `from` (string)
  A datetime for the beginning of the desired range for which to fetch costs. Defaults to start of current month.
- `to` (string)
  A datetime for the end of the desired range for which to fetch costs. Defaults to the current date.
- `bucketing_strategy` (enum  · default: daily)
  The desired bucketing strategy for the charts. Defaults to `daily`.
  Values: `daily`, `monthly`

## Responses

#### `200`

The usage charts of a deployment.

`application/json`

- `data` ([] ChartItem)
  The list of chart item
  - `timestamp` (integer)
    Axis X position
  - `values` ([] ChartItemValue)
    the collection of values to plot the chart item
    - `id` (string)
      The id of chart item value
    - `name` (string)
      The name of the chart item value
    - `value` (number)
      The actual value of the chart item value
#### `400`

The specified date range is invalid. (code: `costs.invalid_date_range`)

`application/json`

- `errors` ([] BasicFailedReplyElement)
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` ([] string)
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response Headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

#### `403`

The current user does not have access to the requested organization. (code: `organization.invalid_access`)

`application/json`

- `errors` ([] BasicFailedReplyElement)
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` ([] string)
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response Headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

#### `404`

Organization not found. (code: `organization.not_found`)

`application/json`

- `errors` ([] BasicFailedReplyElement)
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` ([] string)
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response Headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

#### `429`

Too many requests. (code: `billing_service.rate_limited`)

`application/json`

- `errors` ([] BasicFailedReplyElement)
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` ([] string)
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response Headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

#### `500`

Error fetching the itemized costs for the organization. (code: `billing_service.failed_request`)

`application/json`

- `errors` ([] BasicFailedReplyElement)
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` ([] string)
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response Headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

## Code Examples

#### Console

```console
GET /billing/costs/{organization_id}/deployments/{deployment_id}/charts
```

#### curl

```curl
curl -X GET "/billing/costs/{organization_id}/deployments/{deployment_id}/charts"
```

