Tutorial: Manage API key credentials

Learn how to manage API key credentials to generate API keys and manage their privileges and item access.

API key credentials
The item page of API key credentials in a portal

API key credentials are a type of developer credentials used in API key authentication. You can manage the settings of your API keys from the item page of your API key credentials.

This tutorial shows how to manage API key credentials in your portal to complete the following tasks:

  • Edit privileges to enable access to the geocoding service.

  • Edit item access to enable access to a private feature layer.

  • Regenerate an API key to apply the new privileges and item access rights.

  • Generate a secondary API key with a new expiration date.

Prerequisites

Steps

Sign in to your portal

You use your portal to create and manage items, including API key credentials.

  1. Sign in to your portal with your ArcGIS account.

Find your API key credentials

Developer credentials are stored as an item in your portal. Go to the item page of your credentials to manage their settings.

  1. Go to Content > My content.

  2. Search for the developer credentials you created in the prerequisites step.

  3. Click on the developer credentials to go to its item page.

Edit privileges

The privileges of API key credentials are managed through the settings on their item page. Add privileges to your credentials to enable access to the geocoding service.

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

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

    Edit credential privileges
  3. Select new privileges for your API keys using the privileges window. The privileges used in this scenario are:

    • Privileges: Location services > Geocoding > Geocoding (not stored)

    To view a list of all available privileges, go to Privileges.

  4. Click Save. In the warning that appears, click Yes.

Edit item access

The items your API key credentials are authorized to access are managed through the settings of their item page. Edit the item access of your API key credentials to enable access to a feature layer in your application.

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

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

    Edit credential privileges
  3. From the Edit item access window, 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.

  4. Click Save. In the warning that appears, click Yes.

Generate a new API key

Editing privileges and item access will invalidate all existing API keys associated with the credentials. You must generate a new API keys to use it in your application.

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

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

    Generate an API key
  3. Copy the API key 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. This secondary key has identical privileges and item access to the first key with a new expiration date.

What's next?

Your API key now has the correct privileges to access the geocoding service as well as your private feature layers. Use the key to complete one of the following tutorials:

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