Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

API Gateway API key file format

Focus mode
API Gateway API key file format - Amazon API Gateway

API Gateway can import API keys from external files of a comma-separated value (CSV) format, and then associate the imported keys with one or more usage plans. The imported file must contain the Name and Key columns. The column header names aren't case sensitive, and columns can be in any order, as shown in the following example:

Key,name apikey1234abcdefghij0123456789,MyFirstApiKey

A Key value must be between 20 and 128 characters. A Name value cannot exceed 1024 characters.

An API key file can also have the Description, Enabled, or UsagePlanIds column, as shown in the following example:

Name,key,description,Enabled,usageplanIds MyFirstApiKey,apikey1234abcdefghij0123456789,An imported key,TRUE,c7y23b

When a key is associated with more than one usage plan, the UsagePlanIds value is a comma-separated string of the usage plan IDs, enclosed with a pair of double or single quotes, as shown in the following example:

Enabled,Name,key,UsageplanIds true,MyFirstApiKey,apikey1234abcdefghij0123456789,"c7y23b,glvrsr"

Unrecognized columns are permitted, but are ignored. The default value is an empty string or a true Boolean value.

The same API key can be imported multiple times, with the most recent version overwriting the previous one. Two API keys are identical if they have the same key value.

Note

For best practices to consider, see Best practices for API keys and usage plans.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.