---
title: Create a GitHub Costs integration account
description: Create a GitHub Costs integration account.
breadcrumbs: Docs > API > Create a GitHub Costs integration account
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Create a GitHub Costs integration account

## v2 (latest)

{% alert level="warning" %}
**Note**: This endpoint is in Preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help.md).
{% /alert %}

| Datadog site      | API endpoint                                                                           |
| ----------------- | -------------------------------------------------------------------------------------- |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/integration-interfaces/github-costs/accounts     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/integration-interfaces/github-costs/accounts |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/integration-interfaces/github-costs/accounts |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/integration-interfaces/github-costs/accounts      |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/integration-interfaces/github-costs/accounts |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/integration-interfaces/github-costs/accounts |
| uk1.datadoghq.com | POST https://api.uk1.datadoghq.com/api/v2/integration-interfaces/github-costs/accounts |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/integration-interfaces/github-costs/accounts      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/integration-interfaces/github-costs/accounts  |

### Overview

Create a GitHub Costs integration account.

This endpoint requires the `manage_integrations` permission.

### Request

#### Body Data (required)

{% tabs %}
{% tab label="Model" %}
| Parent field             | Field                        | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ------------------------ | ---------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                          | data [*required*]            | object  | Data envelope for creating a GitHub Costs integration account.                                                                                                                                                                                                                                                                                                                                                                         |
| data                     | attributes [*required*]      | object  | Writable attributes used to create a GitHub Costs integration account.                                                                                                                                                                                                                                                                                                                                                                 |
| attributes               | authentication [*required*]  | <oneOf> | Authentication for creating the GitHub Costs integration account. Exactly one method is set.                                                                                                                                                                                                                                                                                                                                           |
| authentication           | <auth_type=bearer_token>     | object  | Bearer token authentication. Use the token type that matches `settings.enterprise_name`: a classic personal access token for an enterprise, or a fine-grained personal access token for an organization.                                                                                                                                                                                                                               |
| <auth_type=bearer_token> | auth_type [*required*]       | enum    | The authentication method type. Allowed enum values: `bearer_token`. Default: `bearer_token`.                                                                                                                                                                                                                                                                                                                                          |
| <auth_type=bearer_token> | token [*required*]           | string  | For an enterprise, a personal access token (classic) from an Enterprise Admin user with the `manage_billing:enterprise` and `read:org` scopes. For an organization, a fine-grained personal access token owned by that organization and created by an organization owner, with the `Administration` organization permission set to read-only.                                                                                          |
| attributes               | name [*required*]            | string  | Human-readable name of the GitHub Costs integration account.                                                                                                                                                                                                                                                                                                                                                                           |
| attributes               | settings [*required*]        | object  | Settings for creating the GitHub Costs integration account.                                                                                                                                                                                                                                                                                                                                                                            |
| settings                 | enterprise_name [*required*] | string  | Slug of the GitHub enterprise, as in `https://github.com/enterprises/<enterprise-name>`, or login of a GitHub organization, as in `https://github.com/<organization-name>`. An enterprise covers every organization it owns. Connecting both an enterprise and one of its organizations counts that organization's costs twice. The token in `authentication` must match: classic for an enterprise, fine-grained for an organization. |
| settings                 | tags                         | string  | Comma-separated list of custom tags for this GitHub Costs account.                                                                                                                                                                                                                                                                                                                                                                     |
| data                     | type [*required*]            | enum    | The type of the integration account resource. Always `integration-account`. Allowed enum values: `integration-account`. Default: `integration-account`.                                                                                                                                                                                                                                                                                |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "authentication": {
        "auth_type": "bearer_token",
        "token": "your-token"
      },
      "name": "github-costs-acme",
      "settings": {
        "enterprise_name": "enterprise-name",
        "tags": "env:prod,team:example"
      }
    },
    "type": "integration-account"
  }
}
```
{% /tab %}
{% /tabs %}

### Response

{% tabs %}
{% tab label="201" %}
Created

{% tabs %}
{% tab label="Model" %}
Response payload for a single GitHub Costs integration account.

| Parent field              | Field                        | Type      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ------------------------- | ---------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                           | data [*required*]            | object    | Data envelope of a GitHub Costs integration account, including server-assigned identity.                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| data                      | attributes [*required*]      | object    | Attributes of a GitHub Costs integration account returned in responses.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| attributes                | authentication               | <oneOf>   | Authentication configured on the GitHub Costs integration account.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| authentication            | <auth_type=bearer_token>     | object    | The bearer token authentication method configured on the account.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| <auth_type=bearer_token>  | auth_type [*required*]       | enum      | The authentication method type. Allowed enum values: `bearer_token`. Default: `bearer_token`.                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| attributes                | dataflows                    | object    | Data Datadog collects from GitHub Costs, keyed by dataflow ID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| dataflows                 | github-cloud-cost-metrics    | object    | GitHub costs, including Actions, storage, and Copilot, which you can analyze in [Cloud Cost Management](https://docs.datadoghq.com/cloud_cost_management.md). Reported costs are estimates based on list prices and usage data and include discounts when available, but not negotiated rates. Requires Cloud Cost Management on your Datadog organization and a GitHub account on the enhanced billing platform. Without them, this dataflow collects no data. This dataflow is always on and cannot be turned off, so it appears in responses only. |
| github-cloud-cost-metrics | enabled                      | boolean   | Whether Datadog collects this data. Always `true`, because this collection cannot be turned off. Read-only.                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| github-cloud-cost-metrics | status                       | object    | Read-only collection status of a dataflow. Read-only.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| status                    | health                       | enum      | Collection health of a single dataflow. Allowed enum values: `DATAFLOW_HEALTH_OK`, `DATAFLOW_HEALTH_BROKEN`, `DATAFLOW_HEALTH_UNKNOWN`.                                                                                                                                                                                                                                                                                                                                                                                                               |
| status                    | message                      | string    | Human-readable detail, populated when the dataflow is not healthy.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| status                    | updated_at                   | date-time | Time the status was last computed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| attributes                | name [*required*]            | string    | Human-readable name of the GitHub Costs integration account.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| attributes                | settings [*required*]        | object    | Settings configured on the GitHub Costs integration account.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| settings                  | enterprise_name [*required*] | string    | Slug of the GitHub enterprise, as in `https://github.com/enterprises/<enterprise-name>`, or login of a GitHub organization, as in `https://github.com/<organization-name>`.                                                                                                                                                                                                                                                                                                                                                                           |
| settings                  | tags                         | string    | Comma-separated list of custom tags for this GitHub Costs account.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| data                      | id [*required*]              | string    | Server-generated unique identifier of the GitHub Costs integration account. Read-only.                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| data                      | type [*required*]            | enum      | The type of the integration account resource. Always `integration-account`. Allowed enum values: `integration-account`. Default: `integration-account`.                                                                                                                                                                                                                                                                                                                                                                                               |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "authentication": {
        "auth_type": "bearer_token"
      },
      "dataflows": {
        "github-cloud-cost-metrics": {
          "enabled": true,
          "status": {
            "health": "DATAFLOW_HEALTH_OK",
            "message": "",
            "updated_at": "2026-06-25T08:30:50Z"
          }
        }
      },
      "name": "github-costs-acme",
      "settings": {
        "enterprise_name": "enterprise-name",
        "tags": "env:prod,team:example"
      }
    },
    "id": "5f1a8d3c-7e2b-4f9a-b6c4-8d0e3a7f1b52",
    "type": "integration-account"
  }
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Forbidden

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="404" %}
Not Found

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="422" %}
The server cannot process the request because it contains invalid data.

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/integration-interfaces/github-costs/accounts" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "authentication": {
        "auth_type": "bearer_token",
        "token": "your-token"
      },
      "name": "github-costs-acme",
      "settings": {
        "enterprise_name": "enterprise-name",
        "tags": "env:prod,team:example"
      }
    },
    "type": "integration-account"
  }
}
EOF
```
{% /tab %}
{% /tabs %}
