Managing API Keys
When creating API keys within the Market, it is important to note:
- No IAM support, all keys have full permission.
- Two key pairs can be active at any one time.
- Management of API keys can be performed within the API, or through a GUI found here.
- Note these keys are for interacting with the Market, and not for authenticating with the Chainlink Explorer.
Creating an API Key with CLI
- Login with your email and password, storing the returned cookie:
curl --fail -c market.cookie -X POST https://market.link/v1/user/login \ -H 'Content-Type: application/json' \ -d \ '{ "email": "", "password": "" }'
- If you have 2FA enabled, send your 2FA token to the api:
curl --fail -b market.cookie -X POST https://market.link/v1/user/login/twofactor \ -H 'Content-Type: application/json' \ -d \ '{ "token": "" }'
- Create a new key pair, storing the returned keys somewhere safe:
curl --fail -b market.cookie -X POST https://market.link/v1/keys/ \ -H 'Content-Type: application/json'
- Delete the cookie:
rm -rf market.cookie
Authenticating with API Keys
To authenticate using the key pair, set headers x-access-key-id
and x-secret-key
:
curl --fail -X GET https://market.link/v1/keys/ \
-H "x-access-key-id: ${access_key_id}"
-H "x-secret-key: ${secret_key}"
-H 'Content-Type: application/json'
Deleting an API Key
curl --fail -b market.cookie -X DELETE https://market.link/v1/keys/:accessKeyId \
-H 'Content-Type: application/json