Authentication
Learn how to authenticate with the linked.is API
The linked.is API uses Bearer token authentication. You'll need to generate an API token from your account settings to make API requests.
Generating an API Token
- Log in to your linked.is account
- Navigate to Settings > API
- Click "Generate New Token"
- Copy your token and store it securely
Important: Your API token is only shown once. Make sure to copy it immediately and store it in a secure location.
Using Your Token
Include your API token in the Authorization header of every request:
<script setup lang="ts">
const fetchLinks = async () => {
const response = await fetch("https://api.linked.is/v1/links", {
method: "GET",
headers: {
Authorization: `Bearer ${YOUR_API_TOKEN}`,
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);
return data;
};
</script>
<template>
<div>
<button @click="fetchLinks">Fetch Links</button>
</div>
</template>
import requests
headers = {
'Authorization': f'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.get('https://api.linked.is/v1/links', headers=headers)
data = response.json()
print(data)
curl -X GET "https://api.linked.is/v1/links" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Token Permissions
API tokens have full access to your account resources. You can:
- Create, read, update, and delete links
- Manage bio profiles and blocks
- Access analytics data
Token Security
Security Best Practices:
- Never share your API token
- Don't commit tokens to version control
- Use environment variables to store tokens
- Regenerate tokens periodically
- Revoke tokens that may have been compromised ::
Revoking Tokens
To revoke an API token:- Go to Settings > API
- Find the token you want to revoke
- Click the "Revoke" button
Authentication Errors
When authentication fails, the API will return a401 Unauthorized status code with one of the following error responses:<script setup lang="ts">
const invalidTokenError = {
success: false,
error: {
code: "INVALID_TOKEN",
message: "The provided API token is invalid"
}
};
</script>
<template>
<pre>{{ JSON.stringify(invalidTokenError, null, 2) }}</pre>
</template>
<script setup lang="ts">
const expiredTokenError = {
success: false,
error: {
code: "TOKEN_EXPIRED",
message: "The API token has expired"
}
};
</script>
<template>
<pre>{{ JSON.stringify(expiredTokenError, null, 2) }}</pre>
</template>
<script setup lang="ts">
const missingTokenError = {
success: false,
error: {
code: "MISSING_TOKEN",
message: "Authorization header is required"
}
};
</script>
<template>
<pre>{{ JSON.stringify(missingTokenError, null, 2) }}</pre>
</template>