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

https://pxnt.ru/api/v1

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.

Authorization: Bearer pxnt_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

codeShort code, the part in the address
short_urlReady-to-share short link
urlDestination address
clicksNumber of clicks
statusModeration state: active, flagged or blocked
created_atCreation moment, ISO 8601 in UTC
last_click_atMoment of the last click, or null

Endpoints

GET /api/v1/links List your links, newest first
POST /api/v1/links Create a link
GET /api/v1/links/{code} A single link by code
PATCH /api/v1/links/{code} Change the destination
DELETE /api/v1/links/{code} Delete a link

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.

curl -X POST https://pxnt.ru/api/v1/links \ -H "Authorization: Bearer $PXNT_TOKEN" \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com/очень/длинный/адрес"}'
{ "link": { "code": "aB3xK9z", "short_url": "https://pxnt.ru/aB3xK9z", "url": "https://example.com/очень/длинный/адрес", "clicks": 0, "status": "active", "created_at": "2026-09-04T18:20:11.482Z", "last_click_at": null } }
curl -X PATCH https://pxnt.ru/api/v1/links/aB3xK9z \ -H "Authorization: Bearer $PXNT_TOKEN" \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com/новый/адрес"}' curl -X DELETE https://pxnt.ru/api/v1/links/aB3xK9z \ -H "Authorization: Bearer $PXNT_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.

{ "error": "validation_error", "message": "Internal network addresses cannot be shortened" }
Status error field When
401unauthorizedThe Authorization header is missing or malformed, or the token was revoked
403forbiddenThe account is blocked
404not_foundYou have no link with this code
400validation_errorThe destination failed validation, or the request body is wrong
409conflictAnother of your links already points to this address
413payload_too_largeThe request body is larger than 32 KB
429rate_limitedThe rate limit is exceeded