API key credentials

API key credentials item

in a portal.

API key credentials are an used to create and manage . You can manage the settings of API key credentials to generate up to two API keys and define their privileges and expiration date. API key credentials can also be used to regenerate or invalidate existing API keys.

Create API key credentials

You can create by using the Developer credentials tool in your .

The steps to create API key credentials with an are:

  1. Sign in to your .

  2. Click Content > My content > New item and select Developer credentials.

  3. In the Credential types menu, select API key credentials.

  4. Set the credential to determine the operations your will be authorized to perform.

  5. Set the credential item access privileges to determine the your will be authorized to access.

  6. Review your selections and, when you are ready, click Generate token. Save the as you will not be able to view it again.

Privileges

Service privileges DEV
The privilege selector for developer credentials

include a selector that can authorize access to secure ArcGIS . Once privileges are configured using the selector, the resulting will be authorized to access the specified services and perform operations.

The privileges available to include:

  • , such as the and
  • operations, such as creating and managing , , and groups.
  • for performing feature and raster analysis operations.

The exact privileges available depend on the ArcGIS product you are using and the roles assigned to your .

Edit privileges

You can edit the privileges of your API key credentials to adjust the authorization level of your API keys. Performing this action will invalidate all API keys associated with the credentials. You must regenerate an API key after editing privileges to use it in your application.

  1. Go to Settings on the of your .

  2. Under Application > Privileges, click the Edit privileges button.

    Edit credential privileges
  3. Select new privileges for your API key credentials using the privileges window. To view a list of all available privileges, go to Privileges.

  4. Click Save. In the warning that appears, click Yes. Your API keys will be invalidated.

Item access privileges

Edit item access menu
The item access menu for developer credentials

also include an item access menu used to allow access to specific in a . The resulting will be authorized to access any items you specify in this menu.

The items available in this menu include all of the items owned by your account with a of Private, Group, or Organization.

Edit item access

You can edit the items that your API key credentials are authorized to access. Performing this action will invalidate all API keys associated with the credentials. You must regenerate an API key after editing item access to use it in your application.

  1. Go to Settings on the of your .

  2. Under Application > Privileges, click the Edit item access button.

    Edit item access
  3. Select items to grant your API key credentials access to.

  4. Click Save. In the warning that appears, click Yes. Your API keys will be invalidated.

Referrers

Referrers DEV
The referrers field for developer credentials

A referrer is an HTTP header field used to identify the client requesting a server resource. This functions as a security measure, allowing applications to confirm their client's identity. When have a specific HTTP referer header set, services can confirm that an incoming request's referrer matches one of the valid referrers assigned to that access token.

Specific domains can be provided or you can use wildcard characters (*) in the subdomain of your allowed referrer. For example https://*.your-app.com will allow the access token to be used on both https://dev.your-app.com and https://your-app.com. While it is also possible to restrict access token use to specific paths (https://your-app.com/page), we do not recommend this method because browsers may remove the path due to privacy concerns.

Manage API keys

API key credentials DEV

API key credentials are used to manage , a type of long-lived . You can manage the settings of your API keys from the of your API key credentials.

The following management actions are supported for API keys:

Generate a secondary API key

You can generate a secondary in the same credentials with identical privileges and a new expiration date. The first API key will remain valid. This action is commonly used when Rotating API keys in your application.

  1. Go to Settings on the of your API key credentials.

  2. Under Application > API keys, click Generate a secondary API key.

    Generate a secondary API key
  3. Set an Expiration date for the key and click Generate API key.

  4. Copy the from the window that appears and paste it into your application.

Regenerate an API key

If you lose access to an API key, you can regenerate it with a new expiration date. This will invalidate the previous key.

  1. Go to Settings on the of your API key credentials.

  2. Under Application > API keys, find the API key you want to regenerate. Click Regenerate API key.

    Regenerate an API key
  3. Click Confirm expiration date and set a new expiration date if desired.

  4. Click Yes, regenerate API key. Copy the from the window that appears and paste it into your application.

Invalidate an API key

You can invalidate an API key so that it no longer functions in applications. If your API key gets stolen, it should be invalidated to avoid fraudulent charges to your .

  1. Go to Settings on the of your API key credentials.

  2. Under Application > API keys, find the API key you want to regenerate. Click Invalidate API key.

    Regenerate an API key
  3. Click Yes, invalidate API key.

Rotate API keys

Up to two can be created in each set of . The two API keys have individual expiration dates, but share the same and access defined by the credentials.

Creating two API keys in one set of credentials allows you to seamlessly rotate keys in your deployed application. When an API key is about to expire, you can generate a second API key and replace it in your application without the app going offline. The high-level workflow for rotating API keys is as follows:

  1. Sign in to your to view your .

  2. Check the expiration date of your API key 1. API keys should be rotated in your applications when they are close to their expiration date.

  3. When your API key 1's expiration date is approaching, go to Settings > Application in your API key credentials and click Generate a secondary API key.

    Generate a secondary API key
  4. Set the Expiration date of your API key 2 and click Generate API key.

  5. Copy the API key 2 and paste it into your application.

  6. Deploy your application using the new API key 2 before your API key 1 expires.

Usage tracking

All services and content accessed with are tracked. You can monitor the usage of credentials in order to view the consumption of services and the billing amount.

The steps to monitor usage vary based on the type of the credentials were created with:

developers use their to monitor service usage. To monitor service usage of , use the following steps:

  1. Go to location.arcgis.com and sign in with an .

  2. Click My dashboard > Usage > Developer credentials.

  3. In the left sidebar, select the item you would like to review usage for.

  4. In the Billing cycle selector, choose a billing cycle to inspect. The main panel of the window will show a usage report.

    Billing cycle selector
  5. Review the usage report for your . Usage information is organized by . Click Download CSV to download the information as a .csv file.

    API key credentials usage report
  6. Click the dropdown button on a specific service to view a usage timeline. The panel will show the resource consumption for each day of the billing cycle.

    Credentials usage timeline

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close