API REFERENCEv1

Create a Short URL

POSThttps://api2.protexting.com/v1/shorturl/create
⌘

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.

original_url is required. Omit domain_id to use the saved default; domain_id=0 explicitly selects the standard domain. A custom domain must belong to your account, be selectable and have verified HTTPS. A pending default prevents generation unless you explicitly select a ready domain or standard domain. track_numbers requires the account tracking entitlement; add_number requires tracking. Repeating create allocates a new link: after an interrupted request, check the inventory before retrying.

POST /v1/shorturl/create

Create using the existing UI allocator. Omitted domain_id uses the saved default; 0 explicitly selects the standard domain. Repeated creates allocate new links; reconcile an interrupted request before retrying.

JSON body

FieldTypeDetails
original_urlstringRequired. Max 8192 characters.
titlestringOptional. Max 255 characters.
inactive_textstringOptional. Max 10000 characters.
track_numbers0/1 or booleanOptional.
add_number0/1 or booleanOptional.
no_protocol0/1 or booleanOptional.
active0/1 or booleanOptional.
exclude_optouts0/1 or booleanOptional.
domain_idintegerOptional.

Request example

Request example
# Set PROTEXTING_ACCESS_TOKEN in your environmentcurl --request POST \  "https://api2.protexting.com/v1/shorturl/create" \  --header 'Accept: application/json' \  --header "Authorization: Bearer ${PROTEXTING_ACCESS_TOKEN:?Set your API token}" \  --header 'Content-Type: application/json' \  --data '{  "original_url": "https://example.com/offer",  "title": "Example offer",  "domain_id": 0}'
Server-side exampleJSON · HTTPS

Response parameters

FieldTypeDetails
Idinteger
Track_Numbersinteger
Add_Numberinteger
No_Protocolinteger
Activeinteger
Exclude_Optoutsinteger
Custom_Urlinteger
Can_Edit_Urlinteger
Titlestring
Short_Urlstring
Original_Urlstring
Date_Createdstring
Keywordstring
Inactive_Textstring

Response example

Illustrative values only; replace IDs and URLs with your saved records.

JSON response example
{  "Id": 123,  "Title": "Example offer",  "Short_Url": "https://ptxt.io/example123",  "Original_Url": "https://example.com/offer",  "Date_Created": "2026-01-01 10:00:00",  "Track_Numbers": 0,  "Add_Number": 0,  "No_Protocol": 0,  "Active": 1,  "Exclude_Optouts": 0,  "Keyword": "example123",  "Custom_Url": 0,  "Can_Edit_Url": 1,  "Inactive_Text": "The URL is not available"}

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.