---
title: "Generate a single-use Content ID clearance code"
method: POST
path: "/api/v1/content_id/codes"
tags: ["Content ID"]
---

# Generate a single-use Content ID clearance code

`POST /api/v1/content_id/codes`

Issues a one-time-use clearance code covering the whole Melodie library
for a single YouTube video. The code is valid for 7 days from issuance
and is consumed by the first video that uses it. Have the end user paste
the code into the YouTube video description before publishing.
Optionally attach a `label` — a note for your own reference, stored in
Melodie only and never sent to the licensing provider.

## Headers

- `Authorization` string, required

## Request body

- object
  - `label` string — Optional note for your own reference (e.g. which video the code is for). Stored and shown in Melodie only — never sent to the licensing provider.

## Response `201`

Clearance code issued

- object
  - `data` ContentIdCode
    - `id` string — The clearance code.
    - `type` string
    - `attributes` object
      - `code` string
      - `status` 'active' | 'inactive' | 'expired' | 'quota_reached' — License status. quota_reached means the single-use code has been consumed.
      - `start_date` string, date
      - `expiration_date` string, date — Inclusive: the last day whose uploads are covered.
      - `label` string, nullable — Your note attached at generation time. Local to Melodie.
      - `video_id` string, nullable — The YouTube video Orfium detected using this code (set after the uploaded video is scanned). Read-only.

## Other responses

- `403` — Missing or invalid API token
- `422` — label is longer than 100 characters
- `503` — Licensing service temporarily unavailable — retry the request

---

[API](https://skmtc.net/melod/apis/melodie-api.md) · [All operations](https://skmtc.net/melod/apis/melodie-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/melod/melodie-api/revisions/06cd6e66c531/schema)
