API
Programmatic access to your own links: list, create, edit and delete. Anonymous links cannot be created through the API — every one belongs to the token owner.
Base address
Authorization
Every request carries an Authorization header with a token from your account. Cookies and sessions are not used for the API at all, so a request from someone else’s browser has nothing to forge.
Tokens are created in the "API tokens" section of your account and shown once.
Format
Requests and responses are UTF-8 JSON. A request body must carry Content-Type: application/json and stay under 32 KB.
Link fields
code | Short code, the part in the address |
|---|---|
short_url | Ready-to-share short link |
url | Destination address |
clicks | Number of clicks |
status | Moderation state: active, flagged or blocked |
created_at | Creation moment, ISO 8601 in UTC |
last_click_at | Moment of the last click, or null |
Endpoints
List parameters
limit— How many to return, 1 to 100. Defaults to 50.offset— How many to skip. Defaults to 0.
Example
Replace PXNT_TOKEN with your own token.
Rate limits
The limit is counted per token rather than per address, so several machines sharing a token share one budget. On excess the service answers 429 with a Retry-After header in seconds.
- reading — 600 requests per hour
- create, edit and delete — 120 requests per hour
Errors
An error comes back with a fitting status code and a body of one shape: error holds a machine-readable code, message an explanation in the interface language.
| Status | error field | When |
|---|---|---|
| 401 | unauthorized | The Authorization header is missing or malformed, or the token was revoked |
| 403 | forbidden | The account is blocked |
| 404 | not_found | You have no link with this code |
| 400 | validation_error | The destination failed validation, or the request body is wrong |
| 409 | conflict | Another of your links already points to this address |
| 413 | payload_too_large | The request body is larger than 32 KB |
| 429 | rate_limited | The rate limit is exceeded |