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

# Mettre à jour

> Canaux de notification — Mettre à jour. `POST /notification-handlers/{notification_handler_id}`

Playground interactif pour `POST /notification-handlers/{notification_handler_id}`.

<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/notification-handlers/{notification_handler_id}' \
    --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/notification-handlers/{notification_handler_id}', {
    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/notification-handlers/{notification_handler_id}', {
    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/notification-handlers/{notification_handler_id}'
  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/notification-handlers/{notification_handler_id}');
  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/notification-handlers/{notification_handler_id}", 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/notification-handlers/{notification_handler_id}"))
    .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/notification-handlers/{notification_handler_id}") { 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/notification-handlers/{notification_handler_id}')
  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 200 theme={null}
  {
    "data": {
      "id": 1
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi.fr.yaml POST /notification-handlers/{notification_handler_id}
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:
  /notification-handlers/{notification_handler_id}:
    post:
      tags:
        - Canaux de notification
      summary: Mettre à jour (canaux de notification)
      operationId: >-
        notification_handlers_update_post_notification_handlers_notification_handler_id_
      parameters:
        - name: notification_handler_id
          in: path
          required: true
          schema:
            type: string
          description: Resource identifier
      requestBody:
        required: false
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                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 : `email`, `webhook`, `slack`, `discord`,
                    `telegram`, `microsoft_teams`, `twilio`, `twilio_call`,
                    `whatsapp`, `x`, `google_chat`, `push_subscriber_id`.
                email:
                  type: string
                  description: 'Disponible quand : type = email'
                webhook:
                  type: string
                  description: 'Disponible quand : type = webhook'
                slack:
                  type: string
                  description: 'Disponible quand : type = slack'
                discord:
                  type: string
                  description: 'Disponible quand : type = discord'
                telegram:
                  type: string
                  description: 'Disponible quand : type = telegram'
                telegram_chat_id:
                  type: string
                  description: 'Disponible quand : type = telegram'
                microsoft_teams:
                  type: string
                  description: 'Disponible quand : type = microsoft_teams'
                google_chat:
                  type: string
                  description: 'Disponible quand : type = google_chat'
                x_consumer_key:
                  type: string
                  description: 'Disponible quand : type = x'
                x_consumer_secret:
                  type: string
                  description: 'Disponible quand : type = x'
                x_access_token:
                  type: string
                  description: 'Disponible quand : type = x'
                x_access_token_secret:
                  type: string
                  description: 'Disponible quand : type = x'
                push_subscriber_id:
                  type: string
                  description: 'Disponible quand : type = push_subscriber_id'
                twilio:
                  type: string
                  description: 'Disponible quand : type = twilio'
                twilio_call:
                  type: string
                  description: 'Disponible quand : type = twilio_call'
                whatsapp:
                  type: string
                  description: 'Disponible quand : type = whatsapp'
                is_enabled:
                  type: boolean
                  description: is_enabled
      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}`.

````