Export Short URL statistics
https://api2.protexting.com/v1/shorturl/exportUse 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
| Field | Type | Details |
|---|---|---|
| id | integer | Required. Owned public link ID (or owned domain ID on domain/view). |
| page | integer | Optional. |
| per-page | integer | Optional. |
| number | string | Optional. |
| group_campaign_id | integer | Optional. |
| from_date_time | string | Optional. Inclusive database timestamp; click time is UTC. Invalid or reversed ranges fail with 422. |
| to_date_time | string | Optional. Inclusive database timestamp; click time is UTC. Invalid or reversed ranges fail with 422. |
| ids | string | Optional. Comma-separated row IDs, 1–100 per request; ownership and report filters still apply. |
| group_by_number | integer (0, 1) | Optional. Return the latest matching human click per recipient number. Anonymous public clicks form one group. |
| city | string | Optional. |
| state | string | Optional. |
| country | string | Optional. |
| device | string | Optional. |
| clicked | integer (0, 1) | Optional. |
| type | string (clicks, recipients) | Optional. |
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}"CSV response
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,789Pagination 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.
Related Short URL reference
Reference from the ProTexting documentation catalog. Code examples are illustrative; this page does not execute API requests.