---
title: Decide a temporary grant request
description: Approve or deny the submitted terms, which are immutable.
breadcrumbs: Docs > API > Decide a temporary grant request
---

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

# Decide a temporary grant request

## 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/usage/admin/temporary-grant-requests/{request_id}/decision     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/usage/admin/temporary-grant-requests/{request_id}/decision |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/usage/admin/temporary-grant-requests/{request_id}/decision |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/usage/admin/temporary-grant-requests/{request_id}/decision      |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/usage/admin/temporary-grant-requests/{request_id}/decision |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/usage/admin/temporary-grant-requests/{request_id}/decision |
| uk1.datadoghq.com | POST https://api.uk1.datadoghq.com/api/v2/usage/admin/temporary-grant-requests/{request_id}/decision |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/usage/admin/temporary-grant-requests/{request_id}/decision      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/usage/admin/temporary-grant-requests/{request_id}/decision  |

### Overview

Approve or deny the submitted terms, which are immutable. Approval atomically writes the grant, audit record, and request decision. An expired request can't be approved. Requires the Billing Edit permission. Requires an authenticated human user. Service-account credentials aren't supported. Request status remains approved after the grant's expiry, revocation, or replacement.

This endpoint requires the `billing_edit` permission.

OAuth apps require the `billing_edit` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#usage-metering) to access this endpoint.

### Arguments

#### Path Parameters

| Field                   | Type   | Description                       |
| ----------------------- | ------ | --------------------------------- |
| request_id [*required*] | string | The temporary grant request UUID. |

### Request

#### Body Data (required)

{% tabs %}
{% tab label="Model" %}
| Parent field | Field                   | Type   | Description                                                                                                                      |
| ------------ | ----------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]       | object | A decision on a pending request.                                                                                                 |
| data         | attributes [*required*] | object | Binary decision. Overrides, reason fields, and unknown attributes are rejected, including null values.                           |
| attributes   | decision [*required*]   | enum   | Approve the exact submitted total and expiry, or deny the request. Allowed enum values: `approved`, `denied`.                    |
| data         | id [*required*]         | uuid   | Request UUID. Must match request_id in the path. Missing or mismatched IDs return 400 Bad Request.                               |
| data         | type [*required*]       | enum   | The temporary grant request resource type. Allowed enum values: `temporary_grant_requests`. Default: `temporary_grant_requests`. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "decision": "denied"
    },
    "id": "12345678-1234-1234-1234-123456789012",
    "type": "temporary_grant_requests"
  }
}
```
{% /tab %}
{% /tabs %}

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
A single temporary grant request.

| Parent field | Field                             | Type      | Description                                                                                                                                                                                                                                                                              |
| ------------ | --------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]                 | object    | A temporary grant request resource.                                                                                                                                                                                                                                                      |
| data         | attributes [*required*]           | object    | Request history and the linked grant state. List and detail reads include grant_state for approved requests. Decision responses record the decision. Read the request for current grant state.                                                                                           |
| attributes   | created_at [*required*]           | date-time | When the request was submitted.                                                                                                                                                                                                                                                          |
| attributes   | decided_at                        | date-time | When the decision or cancellation was recorded.                                                                                                                                                                                                                                          |
| attributes   | decided_by_user_id                | uuid      | UUID of the reviewer, or of the requester if the request was canceled.                                                                                                                                                                                                                   |
| attributes   | entity_key [*required*]           | string    | The requester identity resolved by the server.                                                                                                                                                                                                                                           |
| attributes   | expires_at [*required*]           | date-time | Immutable exclusive expiry, normalized to UTC microsecond precision.                                                                                                                                                                                                                     |
| attributes   | grant_state                       | enum      | Current state of the grant associated with an approved request. Replaced means a newer grant superseded this grant. The newer grant might no longer be active. This field is absent for requests that weren't approved. Allowed enum values: `active`, `expired`, `revoked`, `replaced`. |
| attributes   | justification [*required*]        | string    | Reason for requesting temporary credits. Trimmed and limited to 4096 UTF-8 bytes.                                                                                                                                                                                                        |
| attributes   | quota_namespace [*required*]      | string    | The quota namespace. Only AI credits are supported.                                                                                                                                                                                                                                      |
| attributes   | requested_by_user_id [*required*] | uuid      | UUID of the authenticated requester.                                                                                                                                                                                                                                                     |
| attributes   | status [*required*]               | enum      | The durable request decision, independent of whether its grant is still active. Allowed enum values: `pending`, `approved`, `denied`, `cancelled`.                                                                                                                                       |
| attributes   | total [*required*]                | int64     | Target monthly AI credit limit in positive whole credits, not additional credits. Fractional credits are not accepted.                                                                                                                                                                   |
| data         | id [*required*]                   | uuid      | Server-generated request UUID.                                                                                                                                                                                                                                                           |
| data         | type [*required*]                 | enum      | The temporary grant request resource type. Allowed enum values: `temporary_grant_requests`. Default: `temporary_grant_requests`.                                                                                                                                                         |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "created_at": "2028-02-16T00:00:00Z",
      "decided_at": "2028-02-16T00:00:00Z",
      "decided_by_user_id": "12345678-1234-1234-1234-123456789012",
      "entity_key": "user_handle:jane@example.com",
      "expires_at": "2028-02-16T00:00:00Z",
      "grant_state": "active",
      "justification": "Credits needed to finish the incident investigation.",
      "quota_namespace": "ai_credits",
      "requested_by_user_id": "12345678-1234-1234-1234-123456789012",
      "status": "pending",
      "total": 200
    },
    "id": "12345678-1234-1234-1234-123456789012",
    "type": "temporary_grant_requests"
  }
}
```
{% /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="401" %}
Unauthorized

{% 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.

| 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="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="409" %}
Conflict

{% 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
# Path parameters
export request_id="12345678-1234-1234-1234-123456789012"

# 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/usage/admin/temporary-grant-requests/${request_id}/decision" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "decision": "denied"
    },
    "id": "12345678-1234-1234-1234-123456789012",
    "type": "temporary_grant_requests"
  }
}
EOF
```
{% /tab %}
{% /tabs %}
