API Keys
To be able to use Chakra APIs, first you need to create an API Key for your usecase from the API Keys section.
Create An API Key
To create an API Key you need to provide the following information:
- Name - Name of the key. Please use a meaningful name. This makes management of keys easier.
- Description (optional) - Description for the api keys
- Access Role - Chose a
role
for the new API Key. the API Key will inherit and be limited by the privileges supplied by the assigned role. Ensure that publicly exposed apiKeys have the least privileged role needed to accomplish the task.
Using the API Key
In the details view of an api key find the Access Tokens
section. Copy the access token to use in your api calls.
The access token needs to be passed as a Bearer
token as part of the Authorization
header while making api calls.
Sample curl request below
curl --request GET \
--url https://api.chakrahq.com/v1/ext/config \
--header 'Authorization: Bearer <your_access_token>' \
Curl request with sample access token
curl --request GET \
--url https://api.chakrahq.com/v1/ext/config \
--header 'Authorization: Bearer Nv6TD2sYSdTi2PFAwhUACt1wL8g0k1DMswbckKGwwaPrWSpnhE92u9x7GRkyckQMOgYC6a9yJE9ZFiWD9OiqQYoMS4zx12CcbIa9b69Vrwtfou7nUlc2BTPIRDkGOR3Ak6YvLV3MGjzytO6i8X82w30jQxdG18HXrw1gjlVLCg0r92yDhr6s4Hkxtl1iIibA6GHcXtjaqSnTjq7I7JOQRicMFdWGBBX59vsB8jU4pQwIqq1XxuPtXMNN7jtMnPA' \
Data Format
Most Chakra APIs will return the response data in the following format
{
"_data": {},
"_meta": {},
"_errors": []
}
_data
- will contain the data part of the api response
_meta
- will contain extra or meta information regarding the response
_errors
- if there were any errors this will contain an array of error responses
API Key Guidelines
- Always use separate api keys for separate usecases
- Only provide as much privilege (by the role that is assigned during creation) as is needed by your usecases
- Be careful when using API Keys in frontend side code. These keys should have the least privilege possible