Skip to content

Management API

View as Markdown

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.

https://app.tolinku.com/v1/manage

Every path works in two forms, which take and return exactly the same thing:

FormUse it for
/v1/manage/routesAn API key’s own Appspace, or an OAuth token granted only one Appspace.
/v1/manage/appspaces/{appspace}/routesAny 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.

Send a credential in the Authorization header with every request:

Terminal window
curl https://app.tolinku.com/v1/manage/routes \
-H "Authorization: Bearer tolk_sec_your_secret_key"

There are two kinds of credential:

  • A secret API key (tolk_sec_), as Authorization: Bearer <key> or in an X-API-Key header. 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.

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.

WhatWhere
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
Authorizationhttps://app.tolinku.com/oauth/authorize
TokenPOST https://app.tolinku.com/oauth/token
Revocation (RFC 7009)POST https://app.tolinku.com/oauth/revoke
  • PKCE with S256 is required, and clients are public (no client secret).
  • Scopes: read, write (Read and write) and full. 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 for https://app.tolinku.com works 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, or http on localhost, 127.0.0.1 or [::1] (any port).
  • Send JSON with Content-Type: application/json. Bodies can be up to 1 MB.
  • A single thing comes back in data. Changes also return warnings, a list of plain sentences worth showing to a person (for example, that an audience matched nobody lately).
  • Creating something answers 201 with a Location header where the API makes one.
  • PATCH changes 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.

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.

StatusCodeMeaning
400bad_requestThe body isn’t valid JSON, or an OAuth token reaches several Appspaces and the path didn’t name one.
401unauthorizedNo credential, or one that isn’t valid. Comes with a WWW-Authenticate header.
403forbiddenYour permission doesn’t allow this. The message says what’s needed and what you have.
403plan_limitThe plan doesn’t allow this: changes need Standard and up, or a plan limit is reached.
404not_foundNot found in this Appspace.
409conflictIt clashes with something already there, such as a path another route answers, or the same Idempotency-Key is still running.
412precondition_failedexpected_updated_at no longer matches: read it again.
413bad_requestThe body is too large.
422invalidA value isn’t valid. details.fields lists each problem by its path.
429rate_limitedToo many requests, or too many failed sign-ins from this address.
500internalSomething went wrong on Tolinku’s side. Try again in a minute.
503unavailableTolinku 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" }
]
}
}
}

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.

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: true header.
  • 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 Warning header saying the key was ignored.

Keys are kept per credential, and for OAuth per Appspace.

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.

Lists answer a page at a time:

{ "data": [ ... ], "next_cursor": "eyJ2IjoxLCJhZnRlciI6IjY3YTEifQ" }
  • limit: how many to return, 1 to 100 (default 50).
  • cursor: the next_cursor from the previous page, unchanged. Leave it out for the first page.
  • next_cursor is null on the last page.

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.

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.

  • 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 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:

GET/v1/manage/openapi.json

It 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.

Was this page helpful?