---
title: "Generate a new external ID"
method: PUT
path: "/api/v1/integration/aws/generate_new_external_id"
tags: ["AWS Integration"]
deprecated: true
---

# Generate a new external ID

`PUT /api/v1/integration/aws/generate_new_external_id`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v1/integration/aws/generate_new_external_id`
- Auth: API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`

> **Deprecated.**

**This endpoint is deprecated - use the V2 endpoints instead.** Generate a new AWS external ID for a given AWS account ID and role name pair.

## Request body

- AWSAccount: Returns the AWS account associated with this integration.
  - `access_key_id` string: Your AWS access key ID. Only required if your AWS account is a GovCloud or China account.
  - `account_id` string: Your AWS Account ID without dashes.
  - `account_specific_namespace_rules` object: An object (in the form `{"namespace1":true/false, "namespace2":true/false}`) containing user-supplied overrides for AWS namespace metric collection. **Important**: This field only contains namespaces explicitly configured through API calls, not the comprehensive enabled or disabled status of all namespaces. If a namespace is absent from this field, it uses Datadog's internal defaults (all namespaces enabled by default, except `AWS/SQS`, `AWS/ElasticMapReduce`, and `AWS/Usage`). For a complete view of all namespace statuses, use the V2 AWS Integration API instead.
  - `cspm_resource_collection_enabled` boolean: Whether Datadog collects cloud security posture management resources from your AWS account. This includes additional resources not covered under the general `resource_collection`.
  - `excluded_regions` string[]: An array of [AWS regions](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints) to exclude from metrics collection.
  - `extended_resource_collection_enabled` boolean: Whether Datadog collects additional attributes and configuration information about the resources in your AWS account. Required for `cspm_resource_collection`.
  - `filter_tags` string[]: The array of EC2 tags (in the form `key:value`) defines a filter that Datadog uses when collecting metrics from EC2. Wildcards, such as `?` (for single characters) and `*` (for multiple characters) can also be used. Only hosts that match one of the defined tags will be imported into Datadog. The rest will be ignored. Host matching a given tag can also be excluded by adding `!` before the tag. For example, `env:production,instance-type:c1.*,!region:us-east-1`
  - `host_tags` string[]: Array of tags (in the form `key:value`) to add to all hosts and metrics reporting through this integration.
  - `metrics_collection_enabled` boolean: Whether Datadog collects metrics for this AWS account.
  - `resource_collection_enabled` boolean: Deprecated in favor of 'extended_resource_collection_enabled'. Whether Datadog collects a standard set of resources from your AWS account.
  - `role_name` string: Your Datadog role delegation name.
  - `secret_access_key` string: Your AWS secret access key. Only required if your AWS account is a GovCloud or China account.

## Response `200`

OK

- AWSAccountCreateResponse: The Response returned by the AWS Create Account call.
  - `external_id` string: AWS external_id.

## Other responses

- `400`: Bad Request
- `403`: Authentication Error
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v1-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v1-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v1-collection/revisions/ca5871004d26?raw)
