Learn how to manage API key credentials
API key credentials are a type of developer credentials
This tutorial shows how to manage API key credentials
-
Edit privileges
Privileges are a set of permissions assigned to ArcGIS accounts, developer credentials, and applications that grant access to secure resources and functionality in ArcGIS. to enable access to the geocoding serviceA geocoding service is a service that can search for addresses, place addresses, businesses, reverse geocode coordinates to addresses, provide suggestions for places, and perform bulk geocoding. It is hosted by Esri as the ArcGIS Geocoding service and can also be hosted in ArcGIS Enterprise. . -
Edit item access to enable access to a private feature layer
A feature layer (client-side) is a data layer that can access and display features from a feature service that has the same type of geometry and attribute fields. . -
Regenerate an API key
An API key is a long-lived access token created using API key credentials. They are valid for up to one year and are typically embedded directly into client applications. to apply the new privileges and item access rights. -
Generate a secondary API key
An API key is a long-lived access token created using API key credentials. They are valid for up to one year and are typically embedded directly into client applications. with a new expiration date.
Prerequisites
-
You need an ArcGIS Location Platform account
An ArcGIS Location Platform account, formerly known as an ArcGIS Developer account, is an identity associated with an ArcGIS Location Platform subscription. . -
You need to complete the Create an API key tutorial. Create API key credentials
API key credentials are an item that contains the parameters used to create and manage long-lived access tokens for API key authentication. They are a type of developer credential. with the following privileges:- Privileges: Location services > Basemaps > Basemap styles service
-
You need to complete the full Import data to create a feature layer tutorial to create private data layers
A hosted layer is an item in a portal that contains the properties and settings for a hosted data service or a layer in a hosted data service. hosted in your portal.
Steps
Sign in to your portal
You use your portal to create and manage items, including API key credentials.
- In your web browser, go to https://location.arcgis.com, and sign in with your ArcGIS Location Platform account. In the dashboard, click My portal to go to your portal.
Find your API key credentials
Developer credentials
-
Go to Content > My content.
-
Search for the developer credentials
Developer credentials are a type of item in a portal that contains parameters for authentication. There are two types of developer credentials: API key credentials and OAuth credentials. you created in the prerequisites step. -
Click on the developer credentials to go to its item page
An item page is a web page in ArcGIS Online or the developer dashboard used to access and manage the properties for an item and the content it references such as a web map, hosted layer, or file. .
Edit item access
The items
-
Go to Settings on the item page
An item page is a web page in ArcGIS Online or the developer dashboard used to access and manage the properties for an item and the content it references such as a web map, hosted layer, or file. of your API key credentials. -
Under Application > Credentials, click the Edit button. In the warning that appears, click Continue.
-
Select a type of application that your key will be used in. The application type used in this scenario is Public application.
-
In the Item access window, select Grant access to specific items.
-
Select the feature layers you created in the Prerequisites:
- Trailheads
- Trails
- Parks and Open Space
This will grant your API key credentials access to the layers.
-
Click Next.
Edit privileges
The privileges
-
Select new privileges for your API keys using the Privileges window. The privileges used in this scenario are:
- Privileges: Location services > Geocoding > Geocode (not stored)
To view a list of all privileges available to API keys
An API key is a long-lived access token created using API key credentials. They are valid for up to one year and are typically embedded directly into client applications. , go to Privileges. -
Click Save to close the window.
-
Click the Save button under Application to update your API key credential.
Generate a new API key
Editing privileges
-
Go to Settings on the item page
An item page is a web page in ArcGIS Online or the developer dashboard used to access and manage the properties for an item and the content it references such as a web map, hosted layer, or file. of your API key credentials. -
Under Application > API keys, click Generate API key.
-
Copy the API key
An API key is a long-lived access token created using API key credentials. They are valid for up to one year and are typically embedded directly into client applications. from the window that appears and store it in a safe location. You will not be able to see it again.
You can also generate a secondary API key using the same API key credentials
What's next?
Your API key

Search with autosuggest
Search for an address with autosuggest using the geocoding service.

Add a feature layer
Access and display point, line, and polygon features from a feature service.