DELETE /v1/referrals/code — Remove custom referral slug
https://api.triport.io/v1/referrals/codeDisables your active custom referral slug; your permanent UID-based code keeps working.
Every account has two kinds of referral code: a permanent UID code that is
created automatically and can never be removed, and an optional custom slug
that you choose yourself (see POST /v1/referrals/code).
This endpoint disables your currently active custom slug. The slug is not hard
deleted — the server stamps it with a disabled_at timestamp so existing
links stop attributing new signups, while the historical record is preserved.
Your UID code is untouched and remains active, so referral links built from it
keep working.
Calling this endpoint when you have no active custom slug is a no-op and still returns success. There is no request body.
Parameters
This endpoint takes no path params, query params, or request body.
——optionalResponse
200 OK
okbooleantrue on success. The custom slug is now disabled; the UID code is unaffected.Errors
All errors share the standard envelope { "error": "<tag>" } — see
errors.md for the full contract.
| Code | Meaning | When it happens |
|---|---|---|
401 | unauthenticated | No valid session — not logged in, or the session cookie is missing/expired. |
500 | internal | The slug could not be disabled due to a server-side error. |
Examples
JavaScript (fetch)
const res = await fetch("https://api.triport.io/v1/referrals/code", {
method: "DELETE",
credentials: "include", // send the session cookie
});
if (!res.ok) {
const { error } = await res.json().catch(() => ({}));
throw new Error(error ?? `HTTP ${res.status}`);
}
const { ok } = await res.json(); // { ok: true }TypeScript SDK (@triport/sdk)
import { TriportClient } from "@triport/sdk";
const client = new TriportClient({ apiKey: process.env.TRIPORT_API_KEY });
const { ok } = await client.referrals.deleteCode();
// ok === true — custom slug disabled, UID code still activePython (triport-sdk)
import os
from triport import TriportClient
client = TriportClient(api_key=os.environ["TRIPORT_API_KEY"])
result = client.referrals.delete_code()
assert result["ok"] is TrueNotes
- Idempotent. Repeated calls return
{ "ok": true }even when no custom slug is active. - The UID code cannot be removed. This endpoint only affects the custom
slug; the UID code returned by
GET /v1/referrals/mestays active. - Re-enabling. To set a new custom slug (or re-take one you previously
disabled, subject to availability), use
POST /v1/referrals/code.