API Keys
API keys are the recommended way to programmatically authenticate with the API.
Creating an API Key
- Navigate to the API Keys page in the PerceptPixel dashboard.
- Dashboard > Settings > API Keys
- If you don't have an account, you can Sign Up for one.
- Enter a friendly name for the API key, and click "Create".
- The API key will be displayed on the page. Make sure to copy it and store it in a safe place.
caution
The API key will only be displayed once. You won't be able to see the API key on the dashboard again.
- Use the API key to authenticate with the PerceptPixel API.
note
The format of an API key is pxl_XXXX.YYYY{...}
, where XXXX
and YYYY
are random characters.
The length of a valid API key is 41 characters, consisting of,
pxl_XXXX
, an 8 character prefix.
(a single period, separator)YYYY{...}
(a 32 character secret key)
Authenticating with an API Key
The API key must be passed as a header to authenticate with the PerceptPixel API.
Authorization: Api-Key ${API_KEY}
Error Handling
Unless otherwise specified, the API will return the status of requests using HTTP status codes as follows.
Status | Response |
---|---|
200 | Success |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
409 | Already Exists |