Using the LinkHaven API
Let a Script — or an AI Assistant — Run Your Account
The LinkHaven API is a second door into your account. Almost everything you do by clicking around your dashboard — reading analytics, editing links, restyling a page, connecting a domain you own — can also be done by a program.
In practice, that program is usually an AI assistant you already use. You do not need to be a developer. You do not write the code; the assistant does. Your job is to create a key, hand it over, and say what you want in plain English: "every Monday, list each creator's visitors and link clicks for the past week next to the week before," or "connect the domain I bought somewhere else to Alex's landing page and tell me which DNS records to add."
Using Claude, ChatGPT, Claude Code or Codex in a chat? Start with MCP instead. You sign in to LinkHaven, with no key to handle, and it has the same actions as the API. The API is for automations: your own scripts, scheduled jobs, big batch changes and uploading files straight from your computer. See MCP or API: which should I use?.
Getting started
Open the MCP & API screen in your dashboard menu and follow the steps on the API card. Your AI coding tool saves the key to a file on your computer, so it never appears in the chat.
The key is shown to you exactly once. Copy it when it appears; we cannot show it to you again. If you lose it, revoke it and create another.
The technical reference is at linkhaven.ai/docs/api. With a key, an assistant can read all of it in one request from linkhaven.ai/api/v1/openapi.json.
The first call any assistant should make asks about the account behind the key. The answer identifies the account and its plan, how many creator seats are in use against the seats your plan includes, which permissions are live, and which are switched off. When an assistant later says it cannot do something, that answer is usually why.
What an assistant can do with a key
- Read your landing pages, their destination links and their analytics (the API calls each landing page a "creator")
- Add, edit, reorder and remove destination links
- Restyle a landing page — theme, colors, fonts, button style and photo
- Create, duplicate and delete landing pages. Creating one starts a new creator and uses one of the seats your plan already includes; duplicating one keeps it under the same creator and uses no seat. The API also shows which landing pages belong to the same creator
- Connect a domain you already own, and watch its progress
- Manage team invites and manager permissions, if the key belongs to the account owner
What no key can ever do
Three things stay on the dashboard on purpose, because they are decisions a person should make:
- Grow your plan. A key can fill a creator seat you already pay for; it can never add one. On a full account, creating a page stops with a clear message naming how many seats are in use and how many your plan includes, and points you at the dashboard.
- Buy anything. Buying a domain or credits, adding seats and changing plans are dashboard-only. A key can spend AI credits you've already bought, but only if you tick that permission.
- Make keys. Only a person makes keys: on the MCP & API screen, or by connecting an AI app and approving it. A key can't make another key, not even a weaker one.
If an assistant tells you it needs one of those, it has hit the wall on purpose. Do it yourself in the dashboard and let it carry on.
Connecting a domain
An assistant holding both your registrar login and a LinkHaven key can connect a domain you already own end to end. The loop is always the same: ask LinkHaven which method suits that particular domain, tell LinkHaven to connect it, make the changes its answer lists at your registrar, then watch until it reports live.
The records to create always come from LinkHaven's own answer — never from a recipe an assistant remembers, and never hardcoded, because those values change over time. Your dashboard's connect screen shows the same values, and if an assistant ever tells you something different from that screen, the screen is right. Doing it by hand instead? See How to Connect a Domain You Already Own.
Asking our support assistant through the API
You can also ask our support assistant a question through the API, with a key that has the support permission ticked. It is the same assistant as the chat in your dashboard. It answers from this help centre only: it reads none of your account data and takes no actions on your behalf.
When something goes wrong
Errors on this API are written to be acted on, not decoded. Every one carries a stable code, a plain-English line saying what to do about it, a link to the matching part of the technical reference, and a request id. Most assistants recover on their own — waiting when told to wait, and re-reading and re-applying when something changed underneath them.
Two refusals need you rather than the assistant: running out of creator seats, and being denied a permission the key was never given. Both are dashboard decisions on purpose, so an assistant reporting either has hit the wall correctly — sort it in the dashboard and let it carry on.
If you need us, quote the request id from the failing response along with what you were trying to do. That takes us straight to the exact call.
Pacing and limits
Each key has its own per-minute call limit. Uploads, domain connections, AI avatars and support questions also have limits for the whole account, and most of those grow with your seat count. When a limit is reached the API says so and states how long to wait; a well-behaved assistant waits and carries on. Heavy, steady automation is expected here — you will not be penalised for using what you bought.
Next: Keeping Your API Key Safe: what a key can reach, how to keep one narrow, and what to do if one leaks.