# Bitly Integration via LowCodeAPI
**Last Updated**: February 10, 2026
## Overview
Bitly is a URL shortening and link management platform that allows you to create short links, track clicks, and manage campaigns. Use this API to programmatically shorten URLs, manage links, track analytics, and organize your links with tags and campaigns.
**Categories:**
- Utilities
## Base Endpoint
https://api.lowcodeapi.com/bitly
**Important**: Always include the provider name in the URL path after `api.lowcodeapi.com/`
## Authentication
**Type:** TOKEN
To authenticate with Bitly API:
1. Create a Bitly account or log in at https://bitly.com
2. Navigate to the OAuth Apps section: https://bitly.com/a/oauth_apps
3. Generate a Generic Access Token
4. Configure the access token in LowCodeAPI dashboard
**Get Credentials:** https://bitly.com/a/oauth_apps
**Official Documentation:** https://dev.bitly.com/api-reference
## URL Format (Important)
LowCodeAPI supports two URL formats. **Always try the New Format first**, then fall back to Old Format if needed.
### New Format (Priority)
- Path parameters stay in the URL path
- Do NOT include path parameters as query parameters
- Example: `https://api.lowcodeapi.com/{provider}/resource/{id}?api_token=XXX`
### Old Format (Fallback)
- Path parameters become query parameters
- Example: `https://api.lowcodeapi.com/{provider}/resource/id?id={id}&api_token=XXX`
### Decision Flow for AI Agents
1. Always use **New Format** first - keep path parameters in the URL path
2. If you get a 404 or error, try **Old Format** with sanitized path
3. Log which format worked for future requests to this provider
## API Categories
- **Bitlinks** - Create, update, delete, and retrieve shortened links
- **Custom Bitlinks** - Manage custom domain links
- **Campaigns** - Organize links with campaigns and channels
- **Groups** - Manage link groups and analytics
- **BSDs** - Branded Short Domain management
- **Apps** - OAuth application management
## Common Endpoints
### Shorten a Link
**Method:** POST
**LowCodeAPI Path:** /v4/shorten
**New Format URL:**
```
https://api.lowcodeapi.com/bitly/v4/shorten?api_token=YOUR_API_TOKEN
```
**Old Format URL:**
```
https://api.lowcodeapi.com/bitly/v4/shorten?api_token=YOUR_API_TOKEN
```
**Request Body:**
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| long_url | string | Yes | The long URL to shorten |
| group_guid | string | No | The GUID of the group to associate with the link |
| domain | string | No | The domain to use for the short link |
**Example Request (New Format):**
```bash
curl -X POST 'https://api.lowcodeapi.com/bitly/v4/shorten?api_token=YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"long_url": "https://example.com/very/long/url/that/needs/to/be/shortened",
"group_guid": "GROUP_GUID",
"domain": "bit.ly"
}'
```
**Example Response:**
```json
{
"data": {
"link": "https://bit.ly/abc123",
"id": "bit.ly/abc123",
"long_url": "https://example.com/very/long/url/that/needs/to/be/shortened",
"created_at": "2024-01-15T10:30:00Z"
}
}
```
**Official Documentation:** https://dev.bitly.com/api-reference/createBitlink
### Create a Bitlink
**Method:** POST
**LowCodeAPI Path:** /v4/bitlinks
**New Format URL:**
```
https://api.lowcodeapi.com/bitly/v4/bitlinks?api_token=YOUR_API_TOKEN
```
**Old Format URL:**
```
https://api.lowcodeapi.com/bitly/v4/bitlinks?api_token=YOUR_API_TOKEN
```
**Request Body:**
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| long_url | string | Yes | The long URL to shorten |
| title | string | No | A title for the link |
| tags | array | No | An array of tags to associate with the link |
| deeplinks | array | No | An array of deeplink objects |
| domain | string | No | The domain to use for the short link |
| group_guid | string | No | Always include a specific group and custom domain in your shorten calls |
**Example Request (New Format):**
```bash
curl -X POST 'https://api.lowcodeapi.com/bitly/v4/bitlinks?api_token=YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"long_url": "https://www.example.com/product-page",
"title": "Product Page",
"tags": ["marketing", "q1-campaign"],
"group_guid": "GROUP_GUID",
"domain": "bit.ly"
}'
```
**Official Documentation:** https://dev.bitly.com/api-reference/createBitlink
### Retrieve a Bitlink
**Method:** GET
**LowCodeAPI Path:** /v4/bitlinks/{bitlink}
**New Format URL:**
```
https://api.lowcodeapi.com/bitly/v4/bitlinks/{bitlink}?api_token=YOUR_API_TOKEN
```
**Old Format URL:**
```
https://api.lowcodeapi.com/bitly/v4/bitlinks/bitlink?bitlink={bitlink}&api_token=YOUR_API_TOKEN
```
**Path Parameters:**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| bitlink | string | Yes | A Bitlink made of domain and hash (e.g., "bit.ly/abc123") |
**Example Request (New Format):**
```bash
# Use the full Bitlink URL or just the domain/hash (e.g., bit.ly/abc123)
curl -X GET 'https://api.lowcodeapi.com/bitly/v4/bitlinks/bit.ly/abc123?api_token=YOUR_API_TOKEN'
```
**Example Response:**
```json
{
"data": {
"id": "bit.ly/abc123",
"link": "https://bit.ly/abc123",
"long_url": "https://www.example.com/product-page",
"title": "Product Page",
"created_at": "2024-01-15T10:30:00Z",
"tags": ["marketing", "q1-campaign"]
}
}
```
**Official Documentation:** https://dev.bitly.com/api-reference/getBitlink
### Update a Bitlink
**Method:** PATCH
**LowCodeAPI Path:** /v4/bitlinks/{bitlink}
**New Format URL:**
```
https://api.lowcodeapi.com/bitly/v4/bitlinks/{bitlink}?api_token=YOUR_API_TOKEN
```
**Old Format URL:**
```
https://api.lowcodeapi.com/bitly/v4/bitlinks/bitlink?bitlink={bitlink}&api_token=YOUR_API_TOKEN
```
**Path Parameters:**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| bitlink | string | Yes | A Bitlink made of domain and hash |
**Request Body:**
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| title | string | No | Update the title of the link |
| tags | array | No | Update the tags associated with the link |
| archived | boolean | No | Archive or unarchive the link |
| deeplinks | array | No | Update deeplinks configuration |
**Example Request (New Format):**
```bash
# Use the Bitlink (e.g., bit.ly/abc123)
curl -X PATCH 'https://api.lowcodeapi.com/bitly/v4/bitlinks/bit.ly/abc123?api_token=YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"title": "Updated Product Page Title",
"tags": ["marketing", "q1-campaign", "updated"]
}'
```
**Official Documentation:** https://dev.bitly.com/api-reference/updateBitlink
### Delete a Bitlink
**Method:** DELETE
**LowCodeAPI Path:** /v4/bitlinks/{bitlink}
**New Format URL:**
```
https://api.lowcodeapi.com/bitly/v4/bitlinks/{bitlink}?api_token=YOUR_API_TOKEN
```
**Old Format URL:**
```
https://api.lowcodeapi.com/bitly/v4/bitlinks/bitlink?bitlink={bitlink}&api_token=YOUR_API_TOKEN
```
**Path Parameters:**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| bitlink | string | Yes | A Bitlink made of domain and hash |
**Example Request (New Format):**
```bash
curl -X DELETE 'https://api.lowcodeapi.com/bitly/v4/bitlinks/bit.ly/abc123?api_token=YOUR_API_TOKEN'
```
**Official Documentation:** https://dev.bitly.com/api-reference/deleteBitlink
### Expand a Bitlink
**Method:** POST
**LowCodeAPI Path:** /v4/expand
**New Format URL:**
```
https://api.lowcodeapi.com/bitly/v4/expand?api_token=YOUR_API_TOKEN
```
**Old Format URL:**
```
https://api.lowcodeapi.com/bitly/v4/expand?api_token=YOUR_API_TOKEN
```
**Request Body:**
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| bitlink_id | string | No | The Bitlink ID to expand (format: domain/hash) |
**Example Request (New Format):**
```bash
curl -X POST 'https://api.lowcodeapi.com/bitly/v4/expand?api_token=YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"bitlink_id": "bit.ly/abc123"
}'
```
**Example Response:**
```json
{
"data": {
"link": "https://bit.ly/abc123",
"long_url": "https://www.example.com/product-page"
}
}
```
**Official Documentation:** https://dev.bitly.com/api-reference/expandBitlink
### Get Clicks Summary for a Bitlink
**Method:** GET
**LowCodeAPI Path:** /v4/bitlinks/{bitlink}/clicks/summary
**New Format URL:**
```
https://api.lowcodeapi.com/bitly/v4/bitlinks/{bitlink}/clicks/summary?api_token=YOUR_API_TOKEN
```
**Old Format URL:**
```
https://api.lowcodeapi.com/bitly/v4/bitlinks/bitlink/clicks/summary?bitlink={bitlink}&api_token=YOUR_API_TOKEN
```
**Path Parameters:**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| bitlink | string | Yes | A Bitlink made of domain and hash |
**Query Parameters:**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| unit | string | Yes | A unit of time (e.g., "day", "week", "month", "hour") |
| units | integer | Yes | Number of time units to query data for |
| unit_reference | string | No | ISO-8601 timestamp indicating most recent time for metrics |
**Example Request (New Format):**
```bash
# Get clicks summary for the last 7 days
curl -X GET 'https://api.lowcodeapi.com/bitly/v4/bitlinks/bit.ly/abc123/clicks/summary?unit=day&units=7&api_token=YOUR_API_TOKEN'
```
**Example Response:**
```json
{
"data": {
"total_clicks": 1234,
"link_clicks": 1200,
"units": "day",
"unit": 7
}
}
```
**Official Documentation:** https://dev.bitly.com/api-reference/getBitlinkClicksSummary
### Get Bitlinks by Group
**Method:** GET
**LowCodeAPI Path:** /v4/groups/{group_guid}/bitlinks
**New Format URL:**
```
https://api.lowcodeapi.com/bitly/v4/groups/{group_guid}/bitlinks?api_token=YOUR_API_TOKEN
```
**Old Format URL:**
```
https://api.lowcodeapi.com/bitly/v4/groups/groupguid/bitlinks?group_guid={group_guid}&api_token=YOUR_API_TOKEN
```
**Path Parameters:**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| group_guid | string | Yes | A GUID for a Bitly group |
**Query Parameters:**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| size | integer | No | The quantity of items to return (default: 50) |
| query | string | No | Search query to filter links |
| tags | array | No | Filter by given tags |
| archived | string | No | Whether to include archived links ("true" or "false") |
| created_after | integer | No | Timestamp as unix epoch |
| created_before | integer | No | Timestamp as unix epoch |
| search_after | string | No | Token to paginate to the next page |
**Example Request (New Format):**
```bash
# Get bitlinks for a specific group (use GROUP_GUID from Step 1)
curl -X GET 'https://api.lowcodeapi.com/bitly/v4/groups/GROUP_GUID/bitlinks?size=50&api_token=YOUR_API_TOKEN'
```
**Official Documentation:** https://dev.bitly.com/api-reference/getGroupBitlinks
### Create a QR Code for a Bitlink
**Method:** POST
**LowCodeAPI Path:** /v4/bitlinks/{bitlink}/qr
**New Format URL:**
```
https://api.lowcodeapi.com/bitly/v4/bitlinks/{bitlink}/qr?api_token=YOUR_API_TOKEN
```
**Old Format URL:**
```
https://api.lowcodeapi.com/bitly/v4/bitlinks/bitlink/qr?bitlink={bitlink}&api_token=YOUR_API_TOKEN
```
**Path Parameters:**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| bitlink | string | Yes | A Bitlink made of domain and hash |
**Request Body:**
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| image_format | string | No | Image format of the QR code (e.g., "png", "svg", "jpg") |
| color | string | No | Color in hexadecimal format (e.g., "#FF0000") |
| exclude_bitly_logo | boolean | No | Remove Bitly logo from center of QR code |
| logo_image_guid | string | No | Custom logo GUID (must be uploaded via Bitly dashboard first) |
| is_hidden | boolean | No | Determine whether to hide the QR code |
**Example Request (New Format):**
```bash
# Create a custom QR code for a bitlink
curl -X POST 'https://api.lowcodeapi.com/bitly/v4/bitlinks/bit.ly/abc123/qr?api_token=YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"image_format": "png",
"color": "#FF0000",
"exclude_bitly_logo": true
}'
```
**Example Response:**
```json
{
"data": {
"qr_code": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"image_url": "https://qr.bitly.com/abc123.png"
}
}
```
**Official Documentation:** https://dev.bitly.com/api-reference/createQRCode
### Get User Information
**Method:** GET
**LowCodeAPI Path:** /v4/user
**New Format URL:**
```
https://api.lowcodeapi.com/bitly/v4/user?api_token=YOUR_API_TOKEN
```
**Old Format URL:**
```
https://api.lowcodeapi.com/bitly/v4/user?api_token=YOUR_API_TOKEN
```
**Example Request (New Format):**
```bash
curl -X GET 'https://api.lowcodeapi.com/bitly/v4/user?api_token=YOUR_API_TOKEN'
```
**Example Response:**
```json
{
"data": {
"login": "username",
"name": "User Name",
"emails": ["[email protected]"],
"created_at": "2023-01-15T10:30:00Z",
"default_group_guid": "GROUP_GUID"
}
}
```
**Official Documentation:** https://dev.bitly.com/api-reference/getUser
## Complete Endpoint Reference
### Bitlink Management
| Endpoint | Method | Category | Description |
|----------|--------|----------|-------------|
| Shorten Link | POST | Bitlinks | Quick link shortening |
| Create Bitlink | POST | Bitlinks | Create with full metadata |
| Retrieve Bitlink | GET | Bitlinks | Get link details |
| Update Bitlink | PATCH | Bitlinks | Modify link metadata |
| Delete Bitlink | DELETE | Bitlinks | Remove a link |
| Expand Bitlink | POST | Bitlinks | Get long URL from short link |
| Retrieve Bitlinks by Group | GET | Bitlinks | Get all links in a group |
| Retrieve Sorted Bitlinks | GET | Bitlinks | Get sorted links for group |
| Bulk Update Bitlinks | PATCH | Bitlinks | Update multiple links at once |
### Analytics & Metrics
| Endpoint | Method | Category | Description |
|----------|--------|----------|-------------|
| Get Clicks Summary | GET | Bitlinks | Summary click counts |
| Get Clicks | GET | Bitlinks | Clicks by date |
| Get Metrics by Country | GET | Bitlinks | Country breakdown |
| Get Metrics by City | GET | Bitlinks | City breakdown |
| Get Metrics by Device | GET | Bitlinks | Device type breakdown |
| Get Referrers | GET | Bitlinks | Referrer breakdown |
| Get Referring Domains | GET | Bitlinks | Referring domain breakdown |
### QR Codes
| Endpoint | Method | Category | Description |
|----------|--------|----------|-------------|
| Create QR Code | POST | Bitlinks | Generate new QR code |
| Retrieve QR Code | GET | Bitlinks | Get existing QR code |
| Update QR Code | PATCH | Bitlinks | Modify QR code settings |
### Custom Bitlinks
| Endpoint | Method | Category | Description |
|----------|--------|----------|-------------|
| Add Custom Bitlink | POST | Custom Bitlinks | Add keyword to Bitlink |
| Retrieve Custom Bitlink | GET | Custom Bitlinks | Get custom link details |
| Update Custom Bitlink | PATCH | Custom Bitlinks | Move keyword to different link |
| Get Custom Bitlink Clicks | GET | Custom Bitlinks | Clicks for custom link |
| Get Clicks by Destination | GET | Custom Bitlinks | Metrics by destination |
### Campaigns & Channels
| Endpoint | Method | Category | Description |
|----------|--------|----------|-------------|
| Retrieve Campaigns | GET | Campaigns | List all campaigns |
| Create Campaign | POST | Campaigns | Create new campaign |
| Retrieve Campaign | GET | Campaigns | Get campaign details |
| Update Campaign | PATCH | Campaigns | Modify campaign |
| Retrieve Channels | GET | Campaigns | List channels |
| Create Channel | POST | Campaigns | Create new channel |
| Get Channel | GET | Campaigns | Get channel details |
| Update Channel | PATCH | Campaigns | Modify channel |
### Groups
| Endpoint | Method | Category | Description |
|----------|--------|----------|-------------|
| Get Clicks by Group | GET | Groups | Click counts for group |
| Get Metrics by Country | GET | Groups | Country breakdown for group |
| Get Metrics by Device | GET | Groups | Device breakdown for group |
| Get Referring Networks | GET | Groups | Network referrers |
### Branded Short Domains (BSDs)
| Endpoint | Method | Category | Description |
|----------|--------|----------|-------------|
| Get BSDs | GET | BSDs | Fetch all branded domains |
| Group Overrides | GET | BSDs | Get account overrides |
| Retrieve OAuth App | GET | Apps | Get OAuth app details |
## API Definition Endpoints
You can fetch the complete API specification for this provider:
**New Format (OpenAPI spec):**
```bash
curl 'https://backend.lowcodeapi.com/bitly/openapi'
```
**Old Format (API definition):**
```bash
curl 'https://backend.lowcodeapi.com/bitly/definition'
```
## Usage Examples
### Example 1: Create and Track a Short Link
```bash
# Step 1: Get user information to find default GROUP_GUID
curl -X GET 'https://api.lowcodeapi.com/bitly/v4/user?api_token=YOUR_API_TOKEN'
# Response: {"data": {"default_group_guid": "GROUP_GUID", ...}}
# Step 2: Create a short link with tags (use GROUP_GUID from Step 1)
curl -X POST 'https://api.lowcodeapi.com/bitly/v4/shorten?api_token=YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"long_url": "https://www.example.com/launch-event",
"group_guid": "GROUP_GUID",
"tags": ["launch", "q1-2024"]
}'
# Response: {"data": {"link": "https://bit.ly/abc123", ...}}
# Step 3: Get click summary for the link (no IDs needed - use full bitlink URL)
curl -X GET 'https://api.lowcodeapi.com/bitly/v4/bitlinks/bit.ly/abc123/clicks/summary?unit=day&units=7&api_token=YOUR_API_TOKEN'
```
### Example 2: Manage Links with Tags
```bash
# Step 1: Create multiple tagged links
curl -X POST 'https://api.lowcodeapi.com/bitly/v4/bitlinks?api_token=YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"long_url": "https://www.example.com/product-a",
"title": "Product A",
"tags": ["product", "q1-2024"],
"group_guid": "GROUP_GUID"
}'
# Step 2: Filter links by tags (use GROUP_GUID from user info)
curl -X GET 'https://api.lowcodeapi.com/bitly/v4/groups/GROUP_GUID/bitlinks?tags=["product","q1-2024"]&api_token=YOUR_API_TOKEN'
# Step 3: Bulk update tags for multiple links
curl -X PATCH 'https://api.lowcodeapi.com/bitly/v4/groups/GROUP_GUID/bitlinks?api_token=YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"action": "edit_tags",
"links": ["bit.ly/abc123", "bit.ly/def456"],
"add_tags": ["featured"],
"remove_tags": ["q1-2024"]
}'
```
### Example 3: Generate QR Codes for Links
```bash
# Step 1: Create a bitlink (no ID needed initially)
curl -X POST 'https://api.lowcodeapi.com/bitly/v4/shorten?api_token=YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"long_url": "https://www.example.com/landing-page",
"group_guid": "GROUP_GUID"
}'
# Response: {"data": {"link": "https://bit.ly/xyz789", ...}}
# Step 2: Generate a QR code (use bitlink from Step 1)
curl -X POST 'https://api.lowcodeapi.com/bitly/v4/bitlinks/bit.ly/xyz789/qr?api_token=YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"image_format": "png",
"color": "#FF6600",
"exclude_bitly_logo": true
}'
# Step 3: Retrieve the QR code image (use bitlink from Step 1)
curl -X GET 'https://api.lowcodeapi.com/bitly/v4/bitlinks/bit.ly/xyz789/qr?image_format=png&api_token=YOUR_API_TOKEN'
```
### Example 4: Campaign Organization
```bash
# Step 1: Create a campaign
curl -X POST 'https://api.lowcodeapi.com/bitly/v4/campaigns?api_token=YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "Summer Sale 2024",
"description": "Summer promotion campaign",
"group_guid": "GROUP_GUID"
}'
# Response: {"data": {"guid": "CAMPAIGN_GUID", ...}}
# Step 2: Create a channel for the campaign (use CAMPAIGN_GUID from Step 1)
curl -X POST 'https://api.lowcodeapi.com/bitly/v4/channels?api_token=YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"campaign_guid": "CAMPAIGN_GUID",
"group_guid": "GROUP_GUID"
}'
# Step 3: Create links associated with the campaign
curl -X POST 'https://api.lowcodeapi.com/bitly/v4/bitlinks?api_token=YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"long_url": "https://www.example.com/summer-sale",
"title": "Summer Sale",
"tags": ["summer-2024"],
"group_guid": "GROUP_GUID"
}'
```
## Response Format
All responses are wrapped in a `data` key:
```json
{
"data": {
// Actual response from Bitly (object or array)
}
}
```
## Error Handling
Common HTTP status codes:
- **200**: Success - Operation completed successfully
- **201**: Created - Resource created (for POST operations)
- **400**: Bad Request - Invalid parameters or request format
- **401**: Unauthorized - Invalid or missing access token
- **403**: Forbidden - Insufficient permissions
- **404**: Not Found - Resource not found (e.g., invalid Bitlink ID)
- **429**: Too Many Requests - Rate limit exceeded
- **500**: Internal Server Error - Bitly service error
## Important Notes
1. **Bitlink Format**: Bitlinks are composed of domain and hash (e.g., "bit.ly/abc123"). Always include both in API calls.
2. **Group GUIDs**: Most operations require a group GUID. Get your default group from the user endpoint.
3. **Tag Organization**: Use tags to organize and filter links. Tags are arrays in the API.
4. **Rate Limiting**: Bitly has rate limits. Check response headers for rate limit information.
5. **Custom Domains**: Use the `domain` parameter to specify custom branded domains.
6. **QR Codes**: QR codes are base64-encoded in responses or returned as image URLs.
7. **Archiving**: Use the `archived` field to archive links instead of deleting them.
8. **Bulk Operations**: Use bulk update endpoints to modify multiple links at once (max 100).
9. **Pagination**: Use `search_after` tokens for paginated results.
10. **Time Units**: Analytics endpoints require `unit` (e.g., "day", "hour") and `units` (number) parameters.