API REFERENCEv1

Export Short URL statistics

GEThttps://api2.protexting.com/v1/shorturl/export
⌘

Use Authorization: Bearer with your server-side token. Legacy access_token URLs remain supported. Replace sample values with your own. Authentication & setup →

Use your existing OAuth access_token query parameter, with the Short URL API app active. Send Accept: application/json and Content-Type: application/json for JSON writes. Action-scoped tokens can call only the permitted action. Every link action is limited to your owned, public, non-deleted parent links. Smart URLs is a separate system.

CSV contains one bounded page of clicks or recipients. Follow all pagination headers to export the complete result. type defaults to clicks; type=recipients uses the recipient filters and date semantics. ids exports selected rows only. group_by_number applies to click exports. Ownership, human classification and opt-out policy are identical to the JSON reports. Potential spreadsheet formulas are escaped. A CSV response uses text/csv rather than JSON.

GET /v1/shorturl/export

Export one bounded CSV page. Fetch all pages using pagination headers. Shares human and opt-out policy with details and recipients; spreadsheet formulas are escaped.

Request parameters

FieldTypeDetails
idintegerRequired. Owned public link ID (or owned domain ID on domain/view).
pageintegerOptional.
per-pageintegerOptional.
numberstringOptional.
group_campaign_idintegerOptional.
from_date_timestringOptional. Inclusive database timestamp; click time is UTC. Invalid or reversed ranges fail with 422.
to_date_timestringOptional. Inclusive database timestamp; click time is UTC. Invalid or reversed ranges fail with 422.
idsstringOptional. Comma-separated row IDs, 1–100 per request; ownership and report filters still apply.
group_by_numberinteger (0, 1)Optional. Return the latest matching human click per recipient number. Anonymous public clicks form one group.
citystringOptional.
statestringOptional.
countrystringOptional.
devicestringOptional.
clickedinteger (0, 1)Optional.
typestring (clicks, recipients)Optional.

Request example

Request example
# Set PROTEXTING_ACCESS_TOKEN in your environmentcurl --request GET \  "https://api2.protexting.com/v1/shorturl/export?id=123&type=clicks" \  --header 'Accept: application/json' \  --header "Authorization: Bearer ${PROTEXTING_ACCESS_TOKEN:?Set your API token}"
Server-side exampleJSON · HTTPS

CSV response

Example
Id,Number,DateTime,City,State,Country,Country_Code,Device,Short_Url,Referrer,IP_Address,Campaign_Id456,12025550123,2026-01-02 12:00:00,Example city,Example region,United States,US,phone,https://ptxt.io/example456,,192.0.2.1,789

Pagination and dates

Use one-based page and per-page (1–100, default 100). Follow X-Pagination-Total-Count, X-Pagination-Page-Count, X-Pagination-Current-Page and X-Pagination-Per-Page. CSV returns one page, not an unbounded export. from_date_time/to_date_time use exact YYYY-MM-DD HH:MM:SS inclusive database timestamps; click timestamps are UTC. Invalid or reversed ranges return 422. Phone numbers are strings.

HTTP status codes

200 success; create/add return 201; link deletion returns 204 without a body. 401: missing/invalid token or disabled API app. 403: denied scope or tracking entitlement. 404: unavailable link or disabled domain feature. 405: wrong HTTP method. 409: reset already in progress. 422: invalid input, invalid dates or unavailable/foreign domain. 503: allocation/custom-deletion failure or unavailable reset signing. Other database/provider failures remain server errors.

Reference from the ProTexting documentation catalog. Code examples are illustrative; this page does not execute API requests.