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

# Quickstart

> Votre premier appel API en 2 minutes

## 1. Obtenez votre cle API

Demandez a l'administrateur de la clinique de creer une cle API pour votre integration.
Il vous fournira une cle au format :

```
vk_aBcDeFgHiJkLmNoPqRsTuVwXyZ...
```

<Warning>
  La cle brute n'est affichee qu'une seule fois lors de sa creation. Stockez-la de maniere securisee.
</Warning>

## 2. Faites votre premier appel

Ajoutez la cle dans le header `X-API-Key` :

<CodeGroup>
  ```bash cURL theme={null}
  curl -H "X-API-Key: vk_votre_cle_ici" \
    https://api.treats.vet/api/v1/patients
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.treats.vet/api/v1/patients', {
    headers: {
      'X-API-Key': 'vk_votre_cle_ici'
    }
  });

  const patients = await response.json();
  console.log(patients);
  ```

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

  response = requests.get(
      'https://api.treats.vet/api/v1/patients',
      headers={'X-API-Key': 'vk_votre_cle_ici'}
  )

  patients = response.json()
  print(patients)
  ```

  ```php PHP theme={null}
  $ch = curl_init('https://api.treats.vet/api/v1/patients');
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      'X-API-Key: vk_votre_cle_ici'
  ]);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

  $response = curl_exec($ch);
  $patients = json_decode($response, true);
  ```
</CodeGroup>

## 3. Lisez la reponse

Selon le niveau d'acces configure sur votre cle, vous obtiendrez plus ou moins de champs :

<Tabs>
  <Tab title="BASIC">
    ```json theme={null}
    [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "Rex",
        "species": "Chien",
        "breed": "Golden Retriever",
        "sex": "MALE"
      }
    ]
    ```
  </Tab>

  <Tab title="STANDARD">
    ```json theme={null}
    [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "Rex",
        "species": "Chien",
        "breed": "Golden Retriever",
        "sex": "MALE",
        "clientId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
        "birthDate": "2020-03-15",
        "microchipNumber": "250269810012345",
        "createdAt": "2024-01-10T09:30:00Z"
      }
    ]
    ```
  </Tab>

  <Tab title="FULL">
    ```json theme={null}
    [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "Rex",
        "species": "Chien",
        "breed": "Golden Retriever",
        "sex": "MALE",
        "clientId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
        "birthDate": "2020-03-15",
        "microchipNumber": "250269810012345",
        "photoUrl": "https://storage.treats.vet/photos/rex.jpg",
        "createdAt": "2024-01-10T09:30:00Z",
        "updatedAt": "2025-12-01T14:22:00Z"
      }
    ]
    ```
  </Tab>
</Tabs>

## Prochaines etapes

<CardGroup cols={3}>
  <Card title="Authentification" icon="key" href="/guides/authentication">
    Details sur les cles API
  </Card>

  <Card title="Niveaux d'acces" icon="shield" href="/guides/access-levels">
    BASIC / STANDARD / FULL
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference">
    Tous les endpoints
  </Card>
</CardGroup>
