Skip to main content

Getting started

From zero to a verified API call in about a minute.

1. Create a token​

In the lsg.bio dashboard, open Settings → API and click Create token.

  1. Name it for where it will be used — "Zapier", "newsletter automation". The name is how you will recognize the token later.
  2. Pick scopes: only what the integration needs. A read-only dashboard script needs links:read, nothing else.
  3. Click Create token.

The full token is shown once:

lsgbio_hKq4mN2pR8sT1vW3xY5zA7bC9dE0fG2hI4jK6lM8nO

Copy it immediately and store it somewhere safe — a password manager or your deployment platform's secret store. If you lose it, create a new one; there is no recovery.

API access is a Pro feature

Token creation requires the Pro plan. Other plans see the API panel locked with an upgrade link.

2. Verify it​

curl https://lsg.bio/api/v1/whoami \
-H "Authorization: Bearer lsgbio_YOUR_TOKEN"

A working credential answers with its own metadata:

{
"user_id": "5f0b4d2e-9c1a-4a7e-b3f2-8f6c2d1e0a55",
"token": {
"id": "91c2f7d4-33ab-4f6e-9d20-c4b7e8a11f02",
"name": "Zapier",
"prefix": "lsgbio_a1b2c3d4e",
"scopes": ["links:read", "links:write"]
}
}

3. Keep it safe​

  • Never commit tokens to source control.
  • Store them as environment variables (LSGBIO_API_TOKEN=...).
  • Grant the narrowest scopes that work.
  • Revoke from Settings → API the moment a token is no longer needed — revocation is immediate.

Three methods, same tagging underneath:

REST. POST /links (short or affiliate) and POST /choice-pages plus destinations — see Endpoints. Use it from any backend; responses carry the public path to publish.

curl https://lsg.bio/api/v1/links \
-H "Authorization: Bearer $LSGBIO_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"destination_url": "https://www.amazon.com/dp/B08N5WRWNW", "kind": "affiliate"}'

Quick build. No token, no row: point any supported product link through the tagging hop directly from your own templates (PHP, .NET, plain JS). Only direct-retailer hosts are accepted — anything else is a 400, so the endpoint cannot launder arbitrary URLs:

https://lsg.bio/a?u=YOUR_HANDLE&to=https%3A%2F%2Fwww.amazon.com%2Fdp%2FB08N5WRWNW

Hops are uncounted (there is no link row to count against): use links or Choice Pages wherever numbers matter.

Site snippet. One tag converts a whole archive in place — see Settings → Affiliate networks → On your site. Same hop underneath, same tagging, same gates.

Next steps​