Tracking links API: create Discord verify links in code

Running a creator programme or dozens of partner deals? Clicking through the dashboard for every link gets old fast. The RestoreCord servers API does the same job from a script.

Short answer

Authenticate with a RestoreCord API key, then use GET, POST and DELETE on /api/v3/servers/{serverId}/verification-links. POST takes only a name; RestoreCord generates the code and returns the verified count plus all three shareable URLs.

When the API beats the dashboard

The dashboard is perfect for a handful of links. The API pays off when links are tied to something else you already run: a sign-up form for creators, a spreadsheet of partner servers, or a weekly report for your staff. Each new partner can get their own link the moment they are approved, and nobody has to copy anything by hand.

Authentication and permissions

Every request carries a RestoreCord API key in the Authorization header as Bearer <keyId>.<secret>. Listing links needs the READ_SERVERS permission; creating and deleting need WRITE_SERVERS. The account behind the key also needs access to the server: owners always have it, and sub-users need permission to view members to list links, or to manage settings to change them.

Keep the secret on your server or in your bot's environment. Never ship it inside a website, a public repository or a client app.

The three endpoints

RequestWhat it doesKey permission
GET /verification-linksActive links with code, name, created date, verified count and URLs, plus your plan's limitREAD_SERVERS
POST /verification-linksCreates a link from a nameWRITE_SERVERS
DELETE /verification-links/{linkId}Deletes a link; its members are keptWRITE_SERVERS

All three paths sit under /api/v3/servers/{serverId}, using the RestoreCord ID of your server.

Creating a link

Requestbash
curl -X POST "https://restorecord.com/api/v3/servers/{serverId}/verification-links" \
  -H "Authorization: Bearer <keyId>.<secret>" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Creator collab, March" }'
Response (201, example values)json
{
  "success": true,
  "link": {
    "id": 42,
    "code": "b81e4c2d907a",
    "name": "Creator collab, March",
    "verifiedCount": 0,
    "verifyUrl": "https://restorecord.com/verify/b81e4c2d907a",
    "verifyServerUrl": "https://restorecord.com/verify/Nova%20Hub?r=b81e4c2d907a",
    "authorizeUrl": "https://discord.com/oauth2/authorize?...&state=<guildId>.b81e4c2d907a"
  }
}

You never send a code. RestoreCord generates a unique one and builds the URLs for you. If your custom bot has an active domain, verifyUrl and verifyServerUrl already use it. Which URL to hand to whom is explained in the link formats guide.

Errors worth handling

StatusCodeMeaning
403RESOURCE_LIMIT_EXCEEDEDThe server has reached its plan's link limit
409DUPLICATE_RESOURCEA link with that name already exists (capitals ignored)
409OPERATION_IN_PROGRESSAnother link is being created for this server; retry shortly
404RESOURCE_NOT_FOUNDThe link doesn't exist, or the server has no bot attached

Going further than the count

Members per link

The list members endpoint, GET /api/v3/servers/{serverId}/members, accepts a link query parameter with a link code. It returns only the members who verified through that link, which is handy for thanking a partner's community or checking quality.

Analytics across servers

The analytics endpoint answers q=referrer with verified members per tracking link, including each link's name, code, server and a deleted flag. Deleted links stay in that list while they still have members, so finished campaigns don't vanish from your reports. It needs a key with READ_ANALYTICS.

A weekly report in four moves

  1. Fetch the links list once a week with a read-only key
  2. Store each link's verifiedCount alongside the date
  3. Subtract last week's number to get new verified members per placement
  4. Post the ranking to a staff channel and flag links that brought nobody

The finer points of what increments a count are in tracking link counts explained, and the dashboard flow is in the tracking links guide.

Automate your links

  1. Create an API key

    In the RestoreCord dashboard, create a key with READ_SERVERS, and WRITE_SERVERS only if the script will create or delete links.

  2. List the server's links

    Call GET /api/v3/servers/{serverId}/verification-links to get every active link with its code, name and verified count.

  3. Create links by name

    POST a JSON body with a name; the response carries the generated code and all three URLs.

  4. Store the counts

    Save verifiedCount per link on a schedule so you can chart growth over time in your own tools.

Open the dashboard

Tracking links API questions

Hand out links as fast as you sign partners

Create an API key in RestoreCord and let your own tools issue a tracked verify link for every new deal.