Lister les services
curl --request GET \
  --url https://kennhosting.com/api/v1/services \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://kennhosting.com/api/v1/services"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://kennhosting.com/api/v1/services', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://kennhosting.com/api/v1/services",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

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

func main() {

url := "https://kennhosting.com/api/v1/services"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://kennhosting.com/api/v1/services")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://kennhosting.com/api/v1/services")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body

Requête

GET /v1/services
Authorization: Bearer kh_live_xxxx

Paramètres de query

ParamètreTypeRequisDescription
typestringNonFiltrer par plan.category
statusstringNonFiltrer par statut service
sortstringNoncreated_at, expires_at, activated_at, domain
orderstringNonasc ou desc (défaut: desc)
pageintegerNonNuméro de page

Réponse

{
  "success": true,
  "data": [
    {
      "id": 1,
      "uuid": "fd952496-bb36-4e9f-98e1-cf897b048fb0",
      "user_id": 2,
      "service_plan_id": 2,
      "order_id": 1,
      "domain": "sergiochebeu.dev",
      "status": "suspended",
      "activated_at": "2026-02-17T16:33:09.000000Z",
      "expires_at": null,
      "cancel_at": null,
      "cancellation_type": null,
      "created_at": "2026-02-17T16:33:09.000000Z",
      "updated_at": "2026-03-14T12:22:29.000000Z",
      "plan": {
        "id": 2,
        "name": "PRO",
        "slug": "pro",
        "category": "advanced",
        "price": "105000.00"
      }
    }
  ],
  "meta": {
    "total": 1,
    "per_page": 20,
    "current_page": 1
  }
}

Permissions requises

services:read