Skip to main content
POST
/
v1
/
analytics
curl --request POST \
  --url https://{environment}.shortpen.com/v1/analytics \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "workspace_id": 24,
  "start": "2025-01-01",
  "end": "2025-01-07"
}
'
{
  "success": true,
  "status_code": 200,
  "data": [
    {
      "id": 7301,
      "workspace_id": 24,
      "organization_id": 3,
      "url_id": 501,
      "domain": "go.shortpen.com",
      "created_at": "2023-11-07T05:31:56Z",
      "url_slug": "summer-2025",
      "device_type": "mobile",
      "platform": "iOS",
      "browser": "Safari",
      "country": "US",
      "referrer": "https://news.example.com"
    }
  ],
  "message": ""
}
Returns raw click events for the supplied date range. Results are scoped to the organization linked to your API token and, optionally, filtered to a specific workspace or link.

Request body essentials

  • start / end — inclusive YYYY-MM-DD values defining the window to analyse.
  • workspace_id — optional workspace filter (defaults to the first workspace available to the token).
  • url_id — optional link filter to drill into a single asset.
The system normalises timestamps to the requesting user’s timezone when one is configured, otherwise UTC is used.

Response payload

Each item in data represents an individual click with the following fields:
  • id — primary key of the analytics record.
  • workspace_id / organization_id — ownership metadata.
  • url_id / url_slug / domain — link identifiers to help you join with internal datasets.
  • device_type, platform, browser — resolved client information.
  • country and referrer — geo and attribution context (when available).
  • created_at — timestamp of the event.
Use this endpoint when you need the full fidelity log of clicks (for example exporting into a warehouse).

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
start
string<date>
required

Inclusive start date for the time range.

end
string<date>
required

Inclusive end date for the time range.

workspace_id
integer

Workspace scope. Defaults to the first workspace when omitted.

url_id
integer

Optional URL ID filter to narrow analytics.

Response

Analytics events

success
boolean
required
Example:

true

status_code
integer
required
Example:

200

data
object[]
required
message
string
Example:

""