API keys / tokens

To access the Nominal platform via its API or the command-line interface requires a system generated password called an API key. Setting an API key is the first step in any scripted workflow.

For historic reasons, there exists a variant of an API key called a Personal access token. These API keys are short lived and meant for quick, one-off experiments—but are otherwise identical in function.

Generating an API key

API keys are generated from the profile page:

Profile Page — Generating API keys

Click API keysGenerate API key. Give the key a name and an expiry date, and click Generate key. Copy the key: you won’t be able to see it again.

As noted above, Personal access tokens are short-lived API keys, aimed at quick experimentation. To generate one of these, click Personal access tokensCopy access token. The token is copied to the clipboard.

Using the API key

You may now use the API key to authenticate your script, either via the API or the CLI:

1import nominal as nm
2
3nm.set_token(
4 url = 'https://api.gov.nominal.io/api',
5 token = '<API KEY>'
6)
1$ nom auth set-token <API KEY>
2Successfully set token for 'https://api.gov.nominal.io/api' in /home/user/.nominal.yml
Built with