Skip to main content

Getting started with the API

Create your first Bytes short link via the API in under 5 minutes.

What you need

  • A Bytes account - sign up for free
  • Access to a workspace
  • A workspace API key
  • A terminal or API client such as curl, Postman, Apidog or Bruno

Step 1: Create your account and API key

  1. Sign in to your Bytes dashboard.
  2. Go to Workspace Settings -> Developer API.
  3. Select Create API key.
  4. Give it a clear name, for example Getting started test.
  5. Select Create API key.
  6. Copy the key immediately.

Your key will look like this:

YOUR_BYTES_API_KEY

Store it somewhere safe before continuing. Bytes shows the full key only once.

Paste this into your terminal, replacing YOUR_BYTES_API_KEY with the key you just copied:

curl -X POST https://api.jaww.ws/api/v1/links \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_BYTES_API_KEY" \
-d '{
"destination_url": "https://example.com",
"title": "My first API link"
}'

Step 3: Check the response

A successful response looks like this:

{
"message": "Short link created successfully.",
"link": {
"id": 1,
"slug": "ab3cd",
"destination_url": "https://example.com",
"short_url": "https://jaww.ws/s/ab3cd",
"title": "My first API link",
"is_active": true,
"click_count": 0,
"unique_click_count": 0
}
}

Your short link is live at the short_url in the response. Open it in a browser to confirm it redirects to your destination.

Step 4: Try channel and UTM fields

Bytes supports useful marketing metadata when you create a link.

curl -X POST https://api.jaww.ws/api/v1/links \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_BYTES_API_KEY" \
-d '{
"destination_url": "https://example.com/coffee-tasting",
"slug": "cops-coffee-tasting",
"title": "Cops & Coffee tasting event",
"channel": "print",
"utm_source": "flyer",
"utm_medium": "qr",
"utm_campaign": "coffee-tasting",
"utm_content": "poster-v1"
}'

Use print when a link will appear on physical material such as a poster, table talker, flyer or packaging.

You can create workspace tags and attach them to links.

Start with the Tags and Link tags guides.

Sign in to the Bytes dashboard and open Links. Your new links will appear there with live click analytics as soon as they receive their first visit.

Next steps

  • Create links - all request fields, error responses and plan limits
  • Tags - create and manage workspace tags
  • Link tags - attach and remove tags from links
  • Authentication - API key safety and base URLs
  • Errors - common error responses