TriportRPC

DELETE /v1/referrals/code — Remove custom referral slug

DELETEhttps://api.triport.io/v1/referrals/code

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

optional
No parameters. The active custom slug is resolved from your session.

Response

200 OK

okboolean
Always true 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.

CodeMeaningWhen it happens
401unauthenticatedNo valid session — not logged in, or the session cookie is missing/expired.
500internalThe 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 active

Python (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 True

Notes

  • 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/me stays active.
  • Re-enabling. To set a new custom slug (or re-take one you previously disabled, subject to availability), use POST /v1/referrals/code.