Authenticate with an API key, create branded URL short links, generate one-time passwords and validate them. More endpoints will be added as the platform expands.
All endpoints are served from a single base URL. Every request needs your API key in the x-api-key header and JSON requests use Content-Type: application/json.
https://cpt.cx
x-api-key: YOUR_API_KEY Content-Type: application/json
curl -X POST "https://cpt.cx/shortlink/public-generate" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "BBC News",
"url": "https://www.bbc.com/news",
"domain": "cpt.cx",
"tags": ["News", "BBC"]
}'Every public endpoint is authenticated with an API key sent in the x-api-key header. Keys are scoped to your account, the domains registered against it and the providers configured for your channels. Treat keys as secrets — never embed them in client-side code.
x-api-key: YOUR_API_KEY
Create branded URL short links on any domain registered to your account. Use the single endpoint for one link, or the batch endpoint to generate many in one request — ideal for SMS, RCS, WhatsApp and email campaigns.
name — string, requiredurl — string, required, must use http or httpsdomain — string, required, must be a domain registered to your accounttags — array of strings, optionalusername / password — optional, must be supplied as a pair to password-protect the link{
"name": "BBC News",
"url": "https://www.bbc.com/news",
"domain": "cpt.cx",
"tags": ["News", "BBC"]
}{
"name": "BBC News",
"shortUrl": "https://cpt.cx/RRRRRF",
"createdDate": "2025-07-02T15:38:02.95Z",
"expiryDate": "2025-08-01T15:38:02.95Z"
}Default expiry is 30 days from creation.
Send a JSON array of short-link objects. Each item uses the same fields and validation rules as the single-create endpoint. The response contains a summary plus a result for every input item.
[
{
"name": "BBC News",
"url": "https://www.bbc.com/news",
"domain": "cpt.cx"
},
{
"name": "Facebook",
"url": "https://www.facebook.com",
"domain": "cpt.cx",
"tags": ["News", "World"]
}
]{
"summary": { "successCount": 2, "failedCount": 0 },
"results": [
{
"name": "BBC News",
"shortUrl": "https://cpt.cx/RRRRRT",
"createdDate": "2025-07-02T15:42:05Z",
"expiryDate": "2025-08-01T15:42:05Z"
},
{
"name": "Facebook",
"shortUrl": "https://cpt.cx/RRRRRa",
"createdDate": "2025-07-02T15:42:05Z",
"expiryDate": "2025-08-01T15:42:05Z"
}
]
}Generate one-time passwords for SMS or email delivery and validate them later with the returned otpId. The OTP value is never returned by the API — it is delivered to the recipient and stored only as a hash with a TTL.
channel — required, email or smsprovider — required, the provider configured for that channel on your account (e.g. generic, twilio, sendgrid)destination — required, email address or E.164 phone numbertype — required, numeric or alphanumericlength — required, between 4 and 12expiresInSeconds — required, must be greater than 0{
"channel": "email",
"provider": "generic",
"destination": "test@example.com",
"type": "alphanumeric",
"length": 8,
"expiresInSeconds": 300
}{
"otpId": "51a6fcc7-efc8-4e69-8bc1-ebb999befb2c",
"destination": "test@example.com",
"createdAt": "2025-09-10T14:05:41Z",
"expiresAt": "2025-09-10T14:10:41Z"
}Send the otpId returned by /otp/generate together with the OTP value the user supplied. A successful validation consumes the OTP — codes are single-use.
{
"otpId": "c4f8814c-7a9d-4e13-b7d8-d4e66d272611",
"otp": "z4dGyBPQ"
}{
"success": true,
"message": "OTP validated successfully."
}After repeated failed attempts, validation will return Too many failed attempts. Try again later. until the temporary lock expires.
Validation errors are returned with descriptive messages such as Invalid URL format. or Provider not found for this client and channel.. The following details are not yet documented publicly — treat them as TODOs and contact us if you need a definitive answer for production use:
Files for AI agents, LLM crawlers, API client generation and technical discovery. Linked from the site's HTML head and robots.txt for reliable discoverability.
We will provision keys, register your domains and configure your providers — usually within a day.