---
title: "Claim a custom affiliate code"
method: POST
path: "/affiliate/vanity-code/"
tags: ["affiliate"]
---

# Claim a custom affiliate code

`POST /affiliate/vanity-code/`

## Request

- Base URL: `https://api.getoneprofile.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.getoneprofile.ai/affiliate/vanity-code/`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Claim the affiliate's one custom code, the name a creator says out loud instead of a random string. First come, first served across the whole program. Requires a signed-in user rather than an API key: the code is claimed once and is the affiliate's public name.

## Request body

- VanityCodeRequestSchema: The custom code an affiliate wants to claim.
  - `code` string, required: 4-32 lowercase letters, digits or hyphens.

## Response `201`

Successful Response

- AffiliateCodeReadSchema: One of the affiliate's codes.
  - `code` string, required
  - `created_at` string, date-time, required
  - `is_vanity` boolean, required

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not enrolled.
- `422`: Invalid request made to the API.
- `500`: Internal server error.
- `502`: Bad gateway error.
- `503`: Service unavailable.

---

[API](https://skmtc.dev/getoneprofile/apis/api-reference-oneprofile.md) · [All operations](https://skmtc.dev/getoneprofile/apis/api-reference-oneprofile/llms.txt) · [OpenAPI document](https://skmtc.dev/getoneprofile/apis/api-reference-oneprofile/revisions/dc5ac3c84444?raw)
