> ## Documentation Index
> Fetch the complete documentation index at: https://dev.kloo.li/llms.txt
> Use this file to discover all available pages before exploring further.

# Créer

> Codes QR — Créer. `POST /qr-codes`

Playground interactif pour `POST /qr-codes`.

<Tip>
  Collez votre clé API dans le champ Authorization : `Bearer {api_key}`.
</Tip>

<RequestExample dropdown>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.kloo.li/v1/qr-codes' \
    --header 'Authorization: Bearer {api_key}' \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    --data 'example=value'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.kloo.li/v1/qr-codes', {
    method: 'POST',
    headers: {
      Authorization: 'Bearer {api_key}',
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    body: 'example=value'
  });
  const data = await response.json();
  console.log(data);
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.kloo.li/v1/qr-codes', {
    method: 'POST',
    headers: {
      Authorization: 'Bearer {api_key}',
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    body: 'example=value'
  });
  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  url = 'https://api.kloo.li/v1/qr-codes'
  headers = {'Authorization': 'Bearer {api_key}'}
  data = {'example': 'value'}
  response = requests.request('POST', url, headers=headers, data=data)
  print(response.json())
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://api.kloo.li/v1/qr-codes');
  curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer {api_key}'],
    CURLOPT_POSTFIELDS => http_build_query(['example' => 'value']),
  ]);
  echo curl_exec($ch);
  curl_close($ch);
  ```

  ```go Go theme={null}
  package main

  import (
    "fmt"
    "io"
    "net/http"
    "strings"
  )

  func main() {
    body := strings.NewReader("example=value")
    req, _ := http.NewRequest("POST", "https://api.kloo.li/v1/qr-codes", body)
    req.Header.Set("Authorization", "Bearer {api_key}")
    req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
    data, _ := io.ReadAll(res.Body)
    fmt.Println(string(data))
  }
  ```

  ```java Java theme={null}
  HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.kloo.li/v1/qr-codes"))
    .header("Authorization", "Bearer {api_key}")
    .method("POST", HttpRequest.BodyPublishers.ofString("example=value"))
    .build();
  HttpResponse<String> response = HttpClient.newHttpClient()
    .send(request, HttpResponse.BodyHandlers.ofString());
  System.out.println(response.body());
  ```

  ```csharp C# theme={null}
  using var client = new HttpClient();
  client.DefaultRequestHeaders.Add("Authorization", "Bearer {api_key}");
  var content = new FormUrlEncodedContent(new Dictionary<string, string> { { "example", "value" } });
  var request = new HttpRequestMessage(HttpMethod.Post, "https://api.kloo.li/v1/qr-codes") { Content = content };
  var response = await client.SendAsync(request);
  Console.WriteLine(await response.Content.ReadAsStringAsync());
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'uri'

  uri = URI('https://api.kloo.li/v1/qr-codes')
  req = Net::HTTP::Post.new(uri)
  req['Authorization'] = 'Bearer {api_key}'
  req.set_form_data('example' => 'value')
  res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
  puts res.body
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "data": {
      "id": 1
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi.fr.yaml POST /qr-codes
openapi: 3.0.3
info:
  title: API publique Kloo
  version: 1.0.0
  description: API utilisateur Kloo — liens courts, codes QR, domaines, équipes, analytics.
servers:
  - url: https://api.kloo.li/v1
security:
  - bearerAuth: []
paths:
  /qr-codes:
    post:
      tags:
        - Codes QR
      summary: Créer (codes QR)
      operationId: qr_codes_create_post_qr_codes
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                project_id:
                  type: integer
                  description: Filter by project id.
                name:
                  type: string
                  description: name
                type:
                  type: string
                  enum:
                    - email
                    - webhook
                    - slack
                    - discord
                    - telegram
                    - microsoft_teams
                    - twilio
                    - twilio_call
                    - whatsapp
                    - x
                    - google_chat
                    - push_subscriber_id
                  description: >-
                    Valeurs autorisées : `text`, `url`, `phone`, `sms`, `email`,
                    `whatsapp`, `facetime`, `location`, `wifi`, `event`,
                    `vcard`, `crypto`, `paypal`, `upi`, `epc`, `pix`.
                is_bulk:
                  type: boolean
                  description: 'Disponible quand : type = text'
                style:
                  type: string
                  enum:
                    - square
                    - dot
                    - rounded
                    - diamond
                    - flower
                    - leaf
                  description: >-
                    Valeurs autorisées : `square`, `dot`, `rounded`, `diamond`,
                    `flower`, `leaf`
                outer_eye_style:
                  type: string
                  enum:
                    - square
                    - circle
                    - rounded
                    - flower
                    - leaf
                  description: >-
                    Valeurs autorisées : `square`, `circle`, `rounded`,
                    `flower`, `leaf`
                foreground_type:
                  type: string
                  enum:
                    - color
                    - gradient
                  description: 'Valeurs autorisées : `color`, `gradient`'
                foreground_color:
                  type: string
                  description: 'Disponible quand : foreground_type = color'
                foreground_gradient_style:
                  type: string
                  enum:
                    - vertical
                    - horizontal
                    - diagonal
                    - inverse_diagonal
                    - radial
                  description: >-
                    Valeurs autorisées : `vertical`, `horizontal`, `diagonal`,
                    `inverse_diagonal`, `radial`
                foreground_gradient_one:
                  type: string
                  description: 'Disponible quand : foreground_type = gradient'
                foreground_gradient_two:
                  type: string
                  description: 'Disponible quand : foreground_type = gradient'
                background_color:
                  type: string
                  description: background_color
                background_color_transparency:
                  type: integer
                  description: background_color_transparency
                custom_eyes_color:
                  type: boolean
                  description: custom_eyes_color
                eyes_inner_color:
                  type: string
                  description: 'Disponible quand : custom_eyes_color = 1'
                eyes_outer_color:
                  type: string
                  description: 'Disponible quand : custom_eyes_color = 1'
                qr_code_logo:
                  type: string
                  format: binary
                  description: qr_code_logo
                qr_code_logo_size:
                  type: integer
                  description: 5-35
                qr_code_background:
                  type: string
                  format: binary
                  description: qr_code_background
                qr_code_background_transparency:
                  type: integer
                  description: 0-100
                qr_code_foreground:
                  type: string
                  format: binary
                  description: qr_code_foreground
                qr_code_foreground_transparency:
                  type: integer
                  description: 0-100
                frame:
                  type: string
                  description: 'Valeurs autorisées :'
                frame_text:
                  type: string
                  description: frame_text
                frame_text_size:
                  type: integer
                  description: '-5 - 5'
                frame_text_font:
                  type: string
                  description: >-
                    Valeurs autorisées : `sora`, `times_new_roman`, `georgia`,
                    `courier`, `arial`, `helvetica`, `verdana`, `tahoma`.
                frame_custom_colors:
                  type: boolean
                  description: frame_custom_colors
                frame_color:
                  type: string
                  description: 'Disponible quand : frame_custom_colors = 1'
                frame_text_color:
                  type: string
                  description: 'Disponible quand : frame_custom_colors = 1'
                size:
                  type: integer
                  description: 50-2000
                margin:
                  type: integer
                  description: 0-25
                ecc:
                  type: string
                  enum:
                    - L
                    - M
                    - Q
                    - H
                  description: 'Valeurs autorisées : `L`, `M`, `Q`, `H`'
                text:
                  type: string
                  description: 'Disponible quand : type = text'
                url:
                  type: string
                  description: 'Disponible quand : type = url'
                phone:
                  type: string
                  description: 'Disponible quand : type = phone'
                sms:
                  type: string
                  description: 'Disponible quand : type = sms'
                email:
                  type: string
                  description: 'Disponible quand : type = email'
                whatsapp:
                  type: string
                  description: 'Disponible quand : type = whatsapp'
                facetime:
                  type: string
                  description: 'Disponible quand : type = facetime'
                location:
                  type: string
                  description: location
                wifi:
                  type: string
                  description: wifi
                event:
                  type: string
                  description: 'Disponible quand : type = event'
                crypto:
                  type: string
                  description: crypto
                vcard:
                  type: string
                  description: vcard
                paypal:
                  type: string
                  description: paypal
                upi:
                  type: string
                  description: upi
                epc:
                  type: string
                  description: epc
                pix:
                  type: string
                  description: pix
              required:
                - name
                - type
      responses:
        '200':
          description: Succès
        '201':
          description: Créé
        '400':
          description: Requête invalide
        '401':
          description: Non autorisé
        '404':
          description: Introuvable
        '429':
          description: Limite de débit
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: '{api_key}'
      x-default: '{api_key}'
      description: >-
        Récupérez votre clé API sur https://kloo.li/account-api. Utilisez
        `Authorization: Bearer {api_key}`.

````