> List, create and delete RestoreCord tracking links with an API key. Endpoints, permissions, errors worth handling and a weekly report recipe for partners.

Source: https://restorecord.to/tracking-links-api

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

[Open the API docs](https://restorecord.com/docs)[Back to RestoreCord Links](https://restorecord.to/)

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

| Request                             | What it does                                                                                | Key permission |
| ----------------------------------- | ------------------------------------------------------------------------------------------- | -------------- |
| GET /verification-links             | Active links with code, name, created date, verified count and URLs, plus your plan's limit | READ\_SERVERS  |
| POST /verification-links            | Creates a link from a name                                                                  | WRITE\_SERVERS |
| DELETE /verification-links/{linkId} | Deletes a link; its members are kept                                                        | WRITE\_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](https://restorecord.to/link-formats).

## Errors worth handling

| Status | Code                      | Meaning                                                      |
| ------ | ------------------------- | ------------------------------------------------------------ |
| 403    | RESOURCE\_LIMIT\_EXCEEDED | The server has reached its plan's link limit                 |
| 409    | DUPLICATE\_RESOURCE       | A link with that name already exists (capitals ignored)      |
| 409    | OPERATION\_IN\_PROGRESS   | Another link is being created for this server; retry shortly |
| 404    | RESOURCE\_NOT\_FOUND      | The 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. 1Fetch the links list once a week with a read-only key
2. 2Store each link's verifiedCount alongside the date
3. 3Subtract last week's number to get new verified members per placement
4. 4Post 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](https://restorecord.to/tracking-link-counts), and the dashboard flow is in [the tracking links guide](https://restorecord.to/tracking-links).

## Automate your links

1. 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. 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. 3  
### Create links by name  
POST a JSON body with a name; the response carries the generated code and all three URLs.
4. 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](https://restorecord.com/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.

[Create an account](https://restorecord.com/register)[API documentation](https://restorecord.com/docs)
