---
title: "Create an API key"
method: POST
path: "/api/v2/api_keys"
tags: ["Key Management"]
---

# Create an API key

`POST /api/v2/api_keys`

Create an API key.

## Request body

- APIKeyCreateRequest — Request used to create an API key.
  - `data` APIKeyCreateData, required — Object used to create an API key.
    - `attributes` APIKeyCreateAttributes, required — Attributes used to create an API Key.
      - `category` string — The APIKeyCreateAttributes category.
      - `name` string, required — Name of the API key.
      - `remote_config_read_enabled` boolean — The APIKeyCreateAttributes remote_config_read_enabled.
    - `type` 'api_keys', required — API Keys resource type.

## Response `201`

Created

- APIKeyResponse — Response for retrieving an API key.
  - `data` FullAPIKey — Datadog API key.
    - `attributes` FullAPIKeyAttributes — Attributes of a full API key.
      - `category` string — The category of the API key.
      - `created_at` string, date-time — Creation date of the API key.
      - `date_last_used` string, date-time, nullable — Date the API Key was last used
      - `key` string — The API key.
      - `last4` string — The last four characters of the API key.
      - `modified_at` string, date-time — Date the API key was last modified.
      - `name` string — Name of the API key.
      - `remote_config_read_enabled` boolean — The remote config read enabled status.
    - `id` string — ID of the API key.
    - `relationships` APIKeyRelationships — Resources related to the API key.
      - `created_by` RelationshipToUser — Relationship to user.
        - `data` RelationshipToUserData, required — Relationship to user object.
          - `id` string, required — A unique identifier that represents the user.
          - `type` 'users', required — Users resource type.
      - `modified_by` NullableRelationshipToUser, nullable — Relationship to user.
        - `data` NullableRelationshipToUserData, nullable, required — Relationship to user object.
          - `id` string, required — A unique identifier that represents the user.
          - `type` 'users', required — Users resource type.
    - `type` 'api_keys' — API Keys resource type.
  - `included` APIKeyResponseIncludedItem[] — Array of objects related to the API key.
    - union — An object related to an API key.
      - User — User object returned by the API.
        - `attributes` UserAttributes — Attributes of user object returned by the API.
          - `created_at` string, date-time — The ISO 8601 timestamp of when the user account was created.
          - `disabled` boolean — Whether the user account is deactivated. Disabled users cannot log in.
          - `email` string — The email address of the user, used for login and notifications.
          - `handle` string — The unique handle (username) of the user, typically matching their email prefix.
          - `icon` string — URL of the user's profile icon, typically a Gravatar URL derived from the email address.
          - `last_login_time` string, date-time, nullable — The ISO 8601 timestamp of the user's most recent login, or null if the user has never logged in.
          - `mfa_enabled` boolean — Whether multi-factor authentication (MFA) is enabled for the user's account.
          - `modified_at` string, date-time — The ISO 8601 timestamp of when the user account was last modified.
          - `name` string, nullable — The full display name of the user as shown in the Datadog UI.
          - `service_account` boolean — Whether this is a service account rather than a human user. Service accounts are used for programmatic API access.
          - `status` string — The current status of the user account (for example, `Active`, `Pending`, or `Disabled`).
          - `title` string, nullable — The job title of the user (for example, "Senior Engineer" or "Product Manager").
          - `uuid` string — The globally unique identifier (UUID) of the user.
          - `verified` boolean — Whether the user's email address has been verified.
        - `id` string — ID of the user.
        - `relationships` UserResponseRelationships — Relationships of the user object returned by the API.
          - `org` RelationshipToOrganization — Relationship to an organization.
            - `data` RelationshipToOrganizationData, required — Relationship to organization object.
              - …
          - `other_orgs` RelationshipToOrganizations — Relationship to organizations.
            - `data` RelationshipToOrganizationData[], required — Relationships to organization objects.
              - …
          - `other_users` RelationshipToUsers — Relationship to users.
            - `data` RelationshipToUserData[], required — Relationships to user objects.
              - …
          - `roles` RelationshipToRoles — Relationship to roles.
            - `data` RelationshipToRoleData[] — An array containing type and the unique identifier of a role.
              - …
        - `type` 'users' — Users resource type.
      - LeakedKey — The definition of LeakedKey object.
        - `attributes` LeakedKeyAttributes, required — The definition of LeakedKeyAttributes object.
          - `date` string, date-time, required — The LeakedKeyAttributes date.
          - `leak_source` string — The LeakedKeyAttributes leak_source.
        - `id` string, required — The LeakedKey id.
        - `type` 'leaked_keys', required — The definition of LeakedKeyType object.

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `429` — Too many requests

---

[API](https://skmtc.net/datadog/apis/api-v2.md) · [All operations](https://skmtc.net/datadog/apis/api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/datadog/api-v2/revisions/da68bf029e4c/schema)
