Links
GET
http://localhost:4000/api/v1 /links List short links with their clicks, newest first
Page with limit and offset.
Parameters
postIdstring
query
limitinteger
query
offsetinteger
query
Code samples
cURL
curl -X GET "http://localhost:4000/api/v1/links" \
-H "Authorization: Bearer $API_KEY"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 OK
Example
[
{
"id": "string",
"slug": "string",
"url": "string",
"utm": {},
"postId": "string",
"channelId": "string",
"createdAt": "2024-01-01T00:00:00Z",
"clicks": 0,
"shortUrl": "string"
}
]Schema
idstring
required
slugstring
required
urlstring
required
utmrequired
postIdstring
required
channelIdstring
required
createdAtstring
required
clicksnumber
required
shortUrlstring
required
POST
http://localhost:4000/api/v1 /links Create a short link that is not tied to a post
Request body
application/json
urlstring
required
slugstring
utmobject
Show child parameters
sourcestring
mediumstring
campaignstring
termstring
contentstring
{
"url": "string",
"slug": "string",
"utm": {
"source": "string",
"medium": "string",
"campaign": "string",
"term": "string",
"content": "string"
}
}Code samples
cURL
curl -X POST "http://localhost:4000/api/v1/links" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"string","slug":"string","utm":{"source":"string","medium":"string","campaign":"string","term":"string","content":"string"}}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 OK
Example
{}Option 1
{}Option 2
{}DELETE
http://localhost:4000/api/v1 /links/{id} Delete a short link
Parameters
idstring
path
required
Code samples
cURL
curl -X DELETE "http://localhost:4000/api/v1/links/{id}" \
-H "Authorization: Bearer $API_KEY"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 OK
Example
{}Option 1
{}Option 2
{}GET
http://localhost:4000/api/v1 /links/stats Clicks per day and referrer, for one link or all of them
Parameters
idstring
query
fromstring
query
required
tostring
query
required
Code samples
cURL
curl -X GET "http://localhost:4000/api/v1/links/stats?from=<from>&to=<to>" \
-H "Authorization: Bearer $API_KEY"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 OK
Example
{}Option 1
{}Option 2
{}Updated