Skip to main content

Create and revoke API keys

An API key lets your scripts and tools use the Netface API. A key belongs to one project and sees that project only. Its value is shown once, when you create it.

Before you begin​

  • A project in your organization.
  • Permission to manage the API keys of that project. Without it, Console shows You do not have access to the API keys of this project. Ask an administrator of your organization.

Create a key​

  1. In Console, open the project and choose API keys.
  2. Under New API key, fill in:
    • Name: what the key is for.
    • Scope: Read, or Read and write.
    • Expires in (days): a whole number from 1 to 365. Leave it empty for a key that does not expire.
  3. Choose Create key.
  4. Choose Copy key, store the value in your secret manager, then choose I have stored it.

Netface keeps only a digest of the key and cannot show it again.

Use a key with the API​

Send the key as a bearer token:

curl -H "Authorization: Bearer $NETFACE_API_KEY" https://api.netface.net/v1/servers

Keys are created and revoked in Console.

Revoke a key​

  1. On the API keys page, choose Revoke on the key's row.
  2. Choose Yes, revoke it.

Requests with this key fail from then on. This cannot be undone.

Common problems​

What you seeWhat to do
This project has reached its key limit, or the project is archived.Check the project's state and its list of keys.
The API answers 401The key may be revoked or expired. Check its Status on the API keys page, and create a new key if needed.
You lost the value of a keyCreate a new key, move your tools to it, then revoke the old one.