API
Version 1
Manage your links from scripts, launchers and other tools. Requests and responses are JSON.
Authentication
Create a token in the API tokens section of your account page and send it as a bearer token. A token can do anything you can do with your links, so keep it secret, and revoke it when you stop using it.
The examples below read the token from a ZMP_TOKEN environment variable. Set it once in your terminal, pasting your whole token in place of zmp_yourtoken:
export ZMP_TOKEN=zmp_yourtoken # bash, zsh set -x ZMP_TOKEN zmp_yourtoken # fish
curl https://zmp.sh/api/v1/links \ -H "Authorization: Bearer $ZMP_TOKEN"
Endpoints
- GET /api/v1/links
- All your links, by name.
- POST /api/v1/links
- Make a link from
nameandurl, with an optionalnote. - GET /api/v1/links/{name}
- One link.
- PUT /api/v1/links/{name}
- Rename or repoint a link: send both
nameandurl. Leave outnoteto keep it, or sendnullto clear it. - DELETE /api/v1/links/{name}
- Delete a link. There's no undo here.
Making a link
curl https://zmp.sh/api/v1/links \
-H "Authorization: Bearer $ZMP_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "pr", "url": "https://github.com/rust-lang/rust/pull/%s", "note": "Rust pull requests"}'
Responds 201 with the link:
{
"data": {
"name": "pr",
"url": "https://github.com/rust-lang/rust/pull/%s",
"note": "Rust pull requests",
"clicks": 0,
"last_used_at": null,
"created_at": "2026-12-05T18:30:00.000000Z",
"updated_at": "2026-12-05T18:30:00.000000Z"
}
}
Names follow the same rules as on the site: letters, numbers, - and _, not case-sensitive. Put %s in a URL where typed words should go, or %1, %2… for one word each.
Errors
- 401: the token is missing, wrong or revoked. Opening an API address in a browser tab sends no token, so it always gets this.
- 404: you have no link with that name.
- 422: the input isn't valid; the response says which field and why.
- 429: more than 120 requests in a minute. Wait and retry.