---
title: "Create a code"
method: POST
path: "/codes"
tags: ["codes"]
---

# Create a code

`POST /codes`

## Request

- Base URL: `https://qrflow.codes/api/v1`
- URL: `https://qrflow.codes/api/v1/codes`
- Auth: HTTP bearer

## Request body

- CreateCode
  - `type` 'url' | 'text' | 'wifi' | 'vcard' | 'email' | 'phone' | 'sms' | 'location', required
  - `destination_data` object, required: The fields for the type; add `subtype` (from /catalog) for a specific kind such as instagram or googlereview
  - `label` string
  - `fg_color` string
  - `bg_color` string
  - `frame_style` string
  - `frame_caption` string
  - `frame_caption2` string
  - `domain_id` string, uuid, nullable

## Response `201`

Created

- object
  - `code` Code
    - `id` string, uuid
    - `label` string, nullable
    - `kind` string
    - `kind_label` string
    - `type` string
    - `destination_data` object
    - `destination` string
    - `dynamic` boolean
    - `dynamic_capable` boolean
    - `short_code` string
    - `short_url` string: What to print for a dynamic code
    - `domain_id` string, nullable
    - `fg_color` string
    - `bg_color` string
    - `has_logo` boolean
    - `frame_style` string, nullable
    - `frame_caption` string, nullable
    - `scans` integer
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `manage_url` string
    - `image_url` string: Print-ready SVG; needs the Authorization header
    - `svg_download_url` string: Same SVG through a signed link that works for 24 hours with no header
    - `png_download_url` string: Plain PNG (no frame or logo) through a signed 24-hour link
    - `download_expires_at` string, date-time

## Other responses

- `400`: Invalid fields or destination, or the saved-codes ceiling
- `402`: The plan does not include this kind

---

[API](https://skmtc.dev/qrflow/apis/qrflow-codes-api.md) · [All operations](https://skmtc.dev/qrflow/apis/qrflow-codes-api/llms.txt) · [OpenAPI document](https://skmtc.dev/qrflow/apis/qrflow-codes-api/revisions/76e294bbe2b6?raw)
