Skip to main content

Authentication

The Tether API uses API keys for authentication. All requests must include your key in the Authorization header.

Generating an API key

API keys are scoped to a specific product in your Tether account. To create one:

  1. Go to Settings → Products and select a product.
  2. Scroll to the API section.
  3. Click Generate API Key.
  4. Copy the key — it will only be shown once.

Because keys are product-scoped, every request made with a key is automatically restricted to that product's data. You cannot use a key to access customers or data belonging to a different product.

Authenticating requests

Pass your API key as a Bearer token in the Authorization header of every request:

Authorization: Bearer YOUR_API_KEY

Example

import { useEffect, useState } from "react";

export function useData() {
  const [data, setData] = useState(null);
  const [loading, setLoading] = useState(true);

  useEffect(() => {
    fetch("https://usetether.io/api/v1/customers", {
      headers: {
        Authorization: `Bearer ${import.meta.env.VITE_TETHER_API_KEY}`,
      },
    })
      .then((res) => res.json())
      .then((json) => { setData(json); setLoading(false); });
  }, []);

  return { data, loading };
}

Request headers

NameTypeRequiredDescription
AuthorizationstringrequiredBearer token. Format: "Bearer YOUR_API_KEY".
Content-TypestringoptionalRequired for POST and PATCH requests with a JSON body. Use "application/json".

Errors

If authentication fails, the API returns a 401 response:

1{
2  "error": "Unauthorized",
3  "code": "UNAUTHORIZED"
4}

Common causes:

  • Missing Authorization header
  • Malformed token (must be Bearer <key>, not just the key)
  • Key has been revoked — generate a new one in Settings