Management API
The management API lets your own code set up and change an Appspace: routes, app details, smart banners, in-app messages, landing and bio pages, audiences, A/B tests, domains, webhooks, settings and the referral programme. It runs the same rules as the dashboard, and its changes show in the same Activity log.
It’s the API behind the Tolinku MCP server, and you can use it directly for scripts, CI and your own tools. For tracking events, resolving links and reading analytics from your app, use the rest of the API reference instead.
Base URL
Section titled “Base URL”https://app.tolinku.com/v1/manageEvery path works in two forms, which take and return exactly the same thing:
| Form | Use it for |
|---|---|
/v1/manage/routes | An API key’s own Appspace, or an OAuth token granted only one Appspace. |
/v1/manage/appspaces/{appspace}/routes | Any Appspace you can reach, named by its ID or slug. Needed when an OAuth token reaches more than one. |
GET /v1/manage/appspaces lists the Appspaces you can reach, with your permission in each.
Signing in
Section titled “Signing in”Send a credential in the Authorization header with every request:
curl https://app.tolinku.com/v1/manage/routes \ -H "Authorization: Bearer tolk_sec_your_secret_key"const res = await fetch('https://app.tolinku.com/v1/manage/routes', { headers: { Authorization: `Bearer ${process.env.TOLINKU_SECRET_KEY}` },});const { data, next_cursor } = await res.json();import os, requests
res = requests.get( "https://app.tolinku.com/v1/manage/routes", headers={"Authorization": f"Bearer {os.environ['TOLINKU_SECRET_KEY']}"},)data = res.json()["data"]There are two kinds of credential:
- A secret API key (
tolk_sec_), asAuthorization: Bearer <key>or in anX-API-Keyheader. It reaches its own Appspace, with the permission set on the key. Create one under API keys in the dashboard and choose its permission (see API Keys). Publishable keys (tolk_pub_) are always refused. - An OAuth access token (
tolk_oat_), for apps that act for a person. The person signs in, picks Appspaces and a permission, and your app gets a token held to their role in each Appspace. See OAuth.
Permissions
Section titled “Permissions”Each endpoint needs one of three permissions, shown on its page: Read, Read and write, or Full. A key has the permission set on it. An OAuth token has the lower of what was granted and what the person’s role allows (Owner and Admin: Full; Editor: Read and write; Viewer: Read). See Security and permissions.
Tolinku is an OAuth 2.1 authorization server. Clients that support MCP-style discovery find everything from a 401 answer, whose WWW-Authenticate header points to the metadata.
| What | Where |
|---|---|
| Server metadata (RFC 8414) | https://app.tolinku.com/.well-known/oauth-authorization-server |
| Resource metadata (RFC 9728) | https://app.tolinku.com/.well-known/oauth-protected-resource/v1/manage |
| Client registration (RFC 7591) | POST https://app.tolinku.com/oauth/register |
| Authorization | https://app.tolinku.com/oauth/authorize |
| Token | POST https://app.tolinku.com/oauth/token |
| Revocation (RFC 7009) | POST https://app.tolinku.com/oauth/revoke |
- PKCE with
S256is required, and clients are public (no client secret). - Scopes:
read,write(Read and write) andfull. The scope you ask for caps what the approval screen offers; the person picks the permission. - Ask for
resource=https://app.tolinku.com/v1/manage. A token forhttps://app.tolinku.comworks on both the management API and the MCP server. - Access tokens last an hour. Refresh tokens last 60 days and each works once: a refresh returns a new pair.
- Redirect addresses must be
https, orhttponlocalhost,127.0.0.1or[::1](any port).
Requests and responses
Section titled “Requests and responses”- Send JSON with
Content-Type: application/json. Bodies can be up to 1 MB. - A single thing comes back in
data. Changes also returnwarnings, a list of plain sentences worth showing to a person (for example, that an audience matched nobody lately). - Creating something answers
201with aLocationheader where the API makes one. PATCHchanges only the fields you send.- Any endpoint taking an ID in the path also accepts the thing’s name where the endpoint says so, such as a route’s prefix or short code.
Errors
Section titled “Errors”Every error has the same shape:
{ "error": { "code": "conflict", "message": "The route \"Product pages\" already answers that path.", "details": { "route": "Product pages", "prefix": "product" } }}The message is plain English, written so a person or an AI can act on it. Use code in your code.
| Status | Code | Meaning |
|---|---|---|
400 | bad_request | The body isn’t valid JSON, or an OAuth token reaches several Appspaces and the path didn’t name one. |
401 | unauthorized | No credential, or one that isn’t valid. Comes with a WWW-Authenticate header. |
403 | forbidden | Your permission doesn’t allow this. The message says what’s needed and what you have. |
403 | plan_limit | The plan doesn’t allow this: changes need Standard and up, or a plan limit is reached. |
404 | not_found | Not found in this Appspace. |
409 | conflict | It clashes with something already there, such as a path another route answers, or the same Idempotency-Key is still running. |
412 | precondition_failed | expected_updated_at no longer matches: read it again. |
413 | bad_request | The body is too large. |
422 | invalid | A value isn’t valid. details.fields lists each problem by its path. |
429 | rate_limited | Too many requests, or too many failed sign-ins from this address. |
500 | internal | Something went wrong on Tolinku’s side. Try again in a minute. |
503 | unavailable | Tolinku is temporarily unavailable. Try again in a minute. |
An invalid error lists each problem in details.fields, by the field’s path:
{ "error": { "code": "invalid", "message": "Select a landing page for the Custom template, or choose Generic or None.", "details": { "fields": [ { "path": "landing_page_id", "message": "Required for the custom template" } ] } }}Dry runs
Section titled “Dry runs”Every change accepts "dry_run": true in the body (or ?dry_run=true). The API checks everything, then answers with what would change, without saving anything:
{ "dry_run": true, "before": { "name": "Product pages", "universal_links": true }, "after": { "name": "Product pages", "universal_links": false }, "changes": ["universal_links"], "warnings": []}before is null when creating, and after is null when deleting. Errors come back exactly as they would for the real change, so a dry run is a safe way to check a request.
Idempotency-Key
Section titled “Idempotency-Key”Send an Idempotency-Key header (any unique string up to 255 characters, such as a UUID) with a change, so a retry never does it twice:
- The same key with the same request, within 24 hours, replays the first answer, with an
Idempotent-Replayed: trueheader. - The same key with a different request is refused with
422. - While the first request is still running, a second one gets
409. - Server errors and rate limits aren’t remembered, so a retry after one runs again.
- If replay protection is unavailable for a moment, the request runs normally with a
Warningheader saying the key was ignored.
Keys are kept per credential, and for OAuth per Appspace.
No lost updates
Section titled “No lost updates”Things you can change return an updated_at. Send it back as expected_updated_at when you change the thing. If someone changed it in the meantime, nothing is saved and the answer is 412 precondition_failed: read it again and retry.
Paging
Section titled “Paging”Lists answer a page at a time:
{ "data": [ ... ], "next_cursor": "eyJ2IjoxLCJhZnRlciI6IjY3YTEifQ" }limit: how many to return, 1 to 100 (default 50).cursor: thenext_cursorfrom the previous page, unchanged. Leave it out for the first page.next_cursorisnullon the last page.
Rate limits
Section titled “Rate limits”120 requests a minute for each key, or for each connected app with OAuth. This is separate from the limit on the public API and your SDKs’ traffic, so automation can’t slow down your links. Answers carry RateLimit and RateLimit-Policy headers; past the limit you get 429 rate_limited.
After too many failed sign-ins from one address, more failed attempts from that address are refused with 429 rate_limited and a Retry-After header for 10 minutes. A valid key or token always works, even from that address.
The trash
Section titled “The trash”Deleting a route, banner, in-app message, landing page, bio page, audience, A/B test or webhook moves it to the trash for 30 days. The delete’s answer gives restorable_until and the trash entry’s ID. Restore it with the area’s own restore endpoint, or with POST /trash/{id}/restore, and it comes back with the same ID. A restore is refused with 409 conflict if something that must be unique, such as a route’s path, has been taken since.
Removing a domain can’t be undone, so it isn’t in the trash. When links may depend on the domain, the request must repeat it in confirm.
Plans and usage
Section titled “Plans and usage”- Every plan, including Free: reading.
- Standard and up, and during the free trial: changes. On Free, a change answers
403 plan_limit. - Each call counts as one API call towards the Appspace’s usage.
The OpenAPI document
Section titled “The OpenAPI document”The whole API is described in an OpenAPI 3.1 document, generated from the same code that runs each endpoint, so it can’t fall out of step:
/v1/manage/openapi.jsonIt needs no key: open https://app.tolinku.com/v1/manage/openapi.json. Each operation has its permission in x-tolinku-permission (read, read_write or full), and every request and response schema with its field descriptions.
Use it to:
-
Explore the API: import it into Postman, Insomnia, Bruno or any OpenAPI viewer.
-
Generate a client: for example with OpenAPI Generator:
Terminal window npx @openapitools/openapi-generator-cli generate \-i https://app.tolinku.com/v1/manage/openapi.json \-g typescript-fetch -o ./tolinku-client -
Give it to an AI: point a coding assistant at the document so it writes calls with the right fields. Or connect the MCP server, which uses the same rules.
The document lists each path once, with two servers for the two URL forms above.