API Reference
Getting started with the Pxl API
Create and manage Pxl assets programmatically using the official Pxl API. We currently off short links and analytics support.
This feature is available on all plans.
Overview
The Pxl API is based on REST. It has predictable resource-oriented URLs, accepts form-encoded request bodies, returns responses as JSON, and uses standard HTTP response codes and authentication.
Authentication
Our API supports Token Authentication as defined in RFC6750. Within every API request you make, you will need to include your access token.
Create an API token
- Log in to your Pxl dashboard
- Click on Settings in the lower left corner
- Choose API to see your API tokens
- Click the Generate Token button in the top right corner to create a new token
Save your token!
Be sure to copy and save your token. It can only be viewed once.
After generating a token you will pass it in the Authorization request header using the Bearer
authentication scheme:
Authorization: Bearer <Your Access Token>
When a token has expired or has been revoked, it can no longer be used to authenticate Pxl API requests. Once expired or revoked, a token cannot be restored, you will need to create a new token.
MIME Types
Responses from our API are in JSON format with UTF-8 encoding. Request bodies sent to the API should also be in JSON format. A Content-Type header is required whenever you're sending a request body:
Content-Type: application/json
Rate limiting
API requests are limited to 500 requests per calendar day and per authentication token. All authenticated requests will be associated with the user and organization that generated the token.
Increased limits
We recently increased the request limit from 100 to 500. If you have an API token issued earlier than September 2024, please create a new one.
The returned HTTP headers of any API request show your current rate limit status:
curl -I "https://api.pxl.to/api/v1/short" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"
> HTTP/2 200
> Date: Mon, 01 Jul 2022 17:27:06 GMT
> x-ratelimit-limit: 100
> x-ratelimit-remaining: 99
> x-ratelimit-reset: 1658966400
> x-ratelimit-latency: 5