{"info":{"_postman_id":"7b79b30e-2b32-4953-9548-b4517592a95e","name":"Public API Compacto","description":"<html><head></head><body><h2 id=\"endpoints\">Endpoints</h2>\n<ul>\n<li><p><a href=\"#post-shortlinkpublic-generate\">POST /shortlink/public-generate</a></p>\n</li>\n<li><p><a href=\"#post-shortlinkpublic-generate-batch\">POST /shortlink/public-generate-batch</a></p>\n</li>\n</ul>\n<hr>\n<p>Welcome to the Compacto Public API documentation.<br>Here you will find all available public endpoints for creating short links.</p>\n<p>Each endpoint includes required headers, body format, examples, and possible error messages.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"36638207","collectionId":"7b79b30e-2b32-4953-9548-b4517592a95e","publishedId":"2sB34bMjCq","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2025-07-04T16:25:59.000Z"},"item":[{"name":"Public-generate","id":"cf1b72b5-fe8a-4be5-b67c-b2a2cddef981","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"x-api-key","value":"{{YOUR_API_KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"name\": \"La nueva carrera espacial se está calentando\",\r\n  \"url\": \"https://www.xataka.com/espacio/nueva-carrera-espacial-se-esta-calentando-ahora-nasa-ha-vetado-a-ciudadanos-chinos-zoom\",\r\n  \"domain\": \"cpt.cx\",\r\n  \"tags\": [\"News\", \"BBC\"]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://cpt.cx/shortlink/public-generate","description":"<h4 id=\"description\">Description</h4>\n<p>This endpoint allows clients to create a public short link (shortened URL) by providing a minimal JSON payload. The endpoint requires an API Key and specific fields for successful processing.</p>\n<h5 id=\"authentication\">Authentication</h5>\n<p>This endpoint requires an API Key to be included in the request headers:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">x-api-key: YOUR_API_KEY\nContent-Type: application/json\n\n</code></pre>\n<h5 id=\"request-body-json\">Request Body (JSON)</h5>\n<p>Required fields:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>name</code></td>\n<td>string</td>\n<td>A descriptive name for the short link.</td>\n</tr>\n<tr>\n<td><code>url</code></td>\n<td>string</td>\n<td>The destination URL. Must be valid and use the <code>http</code> or <code>https</code> protocol.</td>\n</tr>\n<tr>\n<td><code>domain</code></td>\n<td>string</td>\n<td>A registered domain associated with the client making the request.</td>\n</tr>\n</tbody>\n</table>\n</div><p>Optional fields:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>tags</code></td>\n<td>array of strings</td>\n<td>Optional tags associated with the short link. Example: <code>[\"News\", \"Tech\"]</code>.</td>\n</tr>\n<tr>\n<td><code>username</code></td>\n<td>string</td>\n<td>Username for basic auth protection. Must be used together with <code>password</code>.</td>\n</tr>\n<tr>\n<td><code>password</code></td>\n<td>string</td>\n<td>Password for basic auth. Must be used together with <code>username</code>.</td>\n</tr>\n</tbody>\n</table>\n</div><p>Note: If <code>username</code> is provided, <code>password</code> must also be included — and vice versa.</p>\n<p>Valid Request Example:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"name\": \"BBC News\",\n  \"url\": \"https://www.bbc.com/news\",\n  \"domain\": \"cpt.cx\",\n  \"tags\": [\"News\", \"BBC\"]\n}\n\n</code></pre>\n<h4 id=\"successful-response\">Successful Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"name\": \"BBC News\",\n  \"shortUrl\": \"https://cpt.cx/RRRRRF\",\n  \"createdDate\": \"2025-07-02T15:38:02.9554085Z\",\n  \"expiryDate\": \"2025-08-01T15:38:02.9554203Z\"\n}\n\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>name</code></td>\n<td>string</td>\n<td>The name sent in the request.</td>\n</tr>\n<tr>\n<td><code>shortUrl</code></td>\n<td>string</td>\n<td>The generated short link URL.</td>\n</tr>\n<tr>\n<td><code>createdDate</code></td>\n<td>datetime</td>\n<td>Timestamp when the link was created.</td>\n</tr>\n<tr>\n<td><code>expiryDate</code></td>\n<td>datetime</td>\n<td>Date when the short link will expire.</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"invalid-cases-and-error-messages\">Invalid Cases and Error Messages</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>HTTP Code</th>\n<th>Message</th>\n<th>Reason</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td><code>\"Missing required fields: name, url, domain\"</code></td>\n<td>One or more required fields are missing.</td>\n</tr>\n<tr>\n<td>400</td>\n<td><code>\"Invalid URL format.\"</code></td>\n<td>URL format is invalid (e.g., missing protocol).</td>\n</tr>\n<tr>\n<td>400</td>\n<td><code>\"URL is not accessible.\"</code></td>\n<td>The target URL is unreachable or non-existent.</td>\n</tr>\n<tr>\n<td>400</td>\n<td><code>\"Domain is not registered for this client.\"</code></td>\n<td>The domain is not associated with the client making the request.</td>\n</tr>\n<tr>\n<td>400</td>\n<td><code>\"If a username is provided, a password must also be specified.\"</code></td>\n<td>Username is provided without a password.</td>\n</tr>\n<tr>\n<td>400</td>\n<td><code>\"If a password is provided, a username must also be specified.\"</code></td>\n<td>Password is provided without a username.</td>\n</tr>\n</tbody>\n</table>\n</div><h5 id=\"notes\">Notes</h5>\n<ul>\n<li><p>Only <code>http</code> and <code>https</code> protocols are allowed in the <code>url</code> field. Others like <code>ftp</code> are rejected.</p>\n</li>\n<li><p>If the specified domain is not associated with the client (based on the API Key), the request will be denied.</p>\n</li>\n<li><p>ShortUrl is generated automatically using the configured domain.</p>\n</li>\n<li><p>The default expiryDate is 30 days after createdDate.</p>\n</li>\n</ul>\n","urlObject":{"protocol":"https","path":["shortlink","public-generate"],"host":["cpt","cx"],"query":[],"variable":[]}},"response":[],"_postman_id":"cf1b72b5-fe8a-4be5-b67c-b2a2cddef981"},{"name":"Public-generate-batch","id":"d3cf7fd1-dbeb-483a-a18f-cb2cc3381964","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"x-api-key","value":"{{YOUR_API_KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"[\r\n  {\r\n    \"name\": \"BBC News\",\r\n    \"url\": \"https://www.bbc.com/news\",\r\n    \"domain\": \"cpt.cx\"\r\n  },\r\n  {\r\n    \"name\": \"Facebook\",\r\n    \"url\": \"https://www.facebook.com\",\r\n    \"domain\": \"cpt.cx\",\r\n    \"tags\": [\"News\", \"World\"]\r\n  }\r\n]","options":{"raw":{"language":"json"}}},"url":"https://cpt.cx/shortlink/public-generate-batch","description":"<h4 id=\"description\">Description</h4>\n<p>This endpoint allows clients to create a public short link (shortened URL) by providing a minimal JSON payload. The endpoint requires an API Key and specific fields for successful processing.</p>\n<h5 id=\"authentication\">Authentication</h5>\n<p>This endpoint requires an API Key to be included in the request headers:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">x-api-key: YOUR_API_KEY\nContent-Type: application/json\n\n</code></pre>\n<h5 id=\"request-body-json\">Request Body (JSON)</h5>\n<p>Required fields:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>name</code></td>\n<td>string</td>\n<td>A descriptive name for the short link.</td>\n</tr>\n<tr>\n<td><code>url</code></td>\n<td>string</td>\n<td>The destination URL. Must be valid and use the <code>http</code> or <code>https</code> protocol.</td>\n</tr>\n<tr>\n<td><code>domain</code></td>\n<td>string</td>\n<td>A registered domain associated with the client making the request.</td>\n</tr>\n</tbody>\n</table>\n</div><p>Optional fields:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>tags</code></td>\n<td>array of strings</td>\n<td>Optional tags associated with the short link. Example: <code>[\"News\", \"Tech\"]</code>.</td>\n</tr>\n<tr>\n<td><code>username</code></td>\n<td>string</td>\n<td>Username for basic auth protection. Must be used together with <code>password</code>.</td>\n</tr>\n<tr>\n<td><code>password</code></td>\n<td>string</td>\n<td>Password for basic auth. Must be used together with <code>username</code>.</td>\n</tr>\n</tbody>\n</table>\n</div><p>Note: If <code>username</code> is provided, <code>password</code> must also be included — and vice versa.</p>\n<p>Valid Request Example:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">[\n  {\n    \"name\": \"BBC News\",\n    \"url\": \"https://www.bbc.com/news\",\n    \"domain\": \"cpt.cx\"\n  },\n  {\n    \"name\": \"Facebook\",\n    \"url\": \"https://www.facebook.com\",\n    \"domain\": \"cpt.cx\",\n    \"tags\": [\"News\", \"World\"]\n  }\n]\n\n</code></pre>\n<h4 id=\"successful-response\">Successful Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"summary\": {\n        \"successCount\": 2,\n        \"failedCount\": 0\n    },\n    \"results\": [\n        {\n            \"name\": \"BBC News\",\n            \"shortUrl\": \"https://cpt.cx/RRRRRT\",\n            \"createdDate\": \"2025-07-02T15:42:05.2432041Z\",\n            \"expiryDate\": \"2025-08-01T15:42:05.2432043Z\"\n        },\n        {\n            \"name\": \"Facebook\",\n            \"shortUrl\": \"https://cpt.cx/RRRRRa\",\n            \"createdDate\": \"2025-07-02T15:42:05.4787264Z\",\n            \"expiryDate\": \"2025-08-01T15:42:05.4787265Z\"\n        }\n    ]\n}\n\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>name</code></td>\n<td>string</td>\n<td>The name sent in the request.</td>\n</tr>\n<tr>\n<td><code>shortUrl</code></td>\n<td>string</td>\n<td>The generated short link URL.</td>\n</tr>\n<tr>\n<td><code>createdDate</code></td>\n<td>datetime</td>\n<td>Timestamp when the link was created.</td>\n</tr>\n<tr>\n<td><code>expiryDate</code></td>\n<td>datetime</td>\n<td>Date when the short link will expire.</td>\n</tr>\n</tbody>\n</table>\n</div><h5 id=\"response-breakdown\">Response Breakdown</h5>\n<ul>\n<li><p>StartFragment<code>summary.successCount</code> — Number of successfully created short links.EndFragment</p>\n</li>\n<li><p>StartFragment<code>summary.failedCount</code> — Number of short links that failed validation.EndFragment</p>\n</li>\n<li><p>StartFragment<code>results[]</code> — List of successfully created short links (one per valid input item).EndFragment</p>\n</li>\n</ul>\n<h4 id=\"invalid-cases-and-error-messages\">Invalid Cases and Error Messages</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>HTTP Code</th>\n<th>Message</th>\n<th>Reason</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td><code>\"Missing required fields: name, url, domain\"</code></td>\n<td>One or more required fields are missing.</td>\n</tr>\n<tr>\n<td>400</td>\n<td><code>\"Invalid URL format.\"</code></td>\n<td>URL format is invalid (e.g., missing protocol).</td>\n</tr>\n<tr>\n<td>400</td>\n<td><code>\"URL is not accessible.\"</code></td>\n<td>The target URL is unreachable or non-existent.</td>\n</tr>\n<tr>\n<td>400</td>\n<td><code>\"Domain is not registered for this client.\"</code></td>\n<td>The domain is not associated with the client making the request.</td>\n</tr>\n<tr>\n<td>400</td>\n<td><code>\"If a username is provided, a password must also be specified.\"</code></td>\n<td>Username is provided without a password.</td>\n</tr>\n<tr>\n<td>400</td>\n<td><code>\"If a password is provided, a username must also be specified.\"</code></td>\n<td>Password is provided without a username.</td>\n</tr>\n</tbody>\n</table>\n</div><h5 id=\"notes\">Notes</h5>\n<ul>\n<li><p>Only <code>http</code> and <code>https</code> protocols are allowed in the <code>url</code> field. Others like <code>ftp</code> are rejected.</p>\n</li>\n<li><p>If the specified domain is not associated with the client (based on the API Key), the request will be denied.</p>\n</li>\n<li><p>ShortUrl is generated automatically using the configured domain.</p>\n</li>\n<li><p>The default expiryDate is 30 days after createdDate.</p>\n</li>\n</ul>\n","urlObject":{"protocol":"https","path":["shortlink","public-generate-batch"],"host":["cpt","cx"],"query":[],"variable":[]}},"response":[],"_postman_id":"d3cf7fd1-dbeb-483a-a18f-cb2cc3381964"}]}