Skip to content

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

  1. Log in to your linked.is account
  2. Navigate to Settings > API
  3. Click "Generate New Token"
  4. 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>

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:
  1. Go to Settings > API
  2. Find the token you want to revoke
  3. Click the "Revoke" button
Revoked tokens will immediately stop working for all API requests.

Authentication Errors

When authentication fails, the API will return a 401 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>