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: "audit all my landing pages and tell me which destination links are broken," or "add my new subscription link to every landing page."
Using the regular Claude or ChatGPT app rather than Claude Code? Use the MCP connector instead. You sign in to LinkHaven, with no key to handle. See Connect LinkHaven to your AI for how it works.
Getting started
Open the API & MCP screen in your dashboard menu and follow the API card. It gives you a setup prompt for your AI coding tool, then has you create a key and copy it, so your tool saves the key to a file on your computer and it never appears in the chat. If anything here differs from that screen, the screen is right.
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, including a version an assistant can read in one step.
The first call any assistant should make asks about the account behind the key. The answer names the account, 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, photo and background
- 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
Some of these are still being switched on gradually. Your dashboard and the technical reference both say which, and a key that cannot do something yet says so plainly rather than failing oddly.
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 API & MCP 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, make the change at your registrar, tell LinkHaven what you did, 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
Call limits apply to the whole account rather than to each key, and they scale with the size of your plan. 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.
Ask about keeping your API key safe next — what a key can reach, how to keep one narrow, and what to do if one leaks.