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

# Kom hurtigt i gang

> Lav dit første kald til Aniva Partner API på få minutter: find en testlokation, opret en profil, og book en blodprøvetagning.

Denne guide fører dig gennem kerneflowet: at finde et teststed, oprette en patientprofil, booke en tid og bekræfte en blodprøvetagning.

## Forudsætninger

Du skal bruge en partner-API-nøgle udstedt af Aniva.

> [!NOTE]
>
> Hvis du ikke har en API-nøgle endnu, så kontakt Aniva for at få udstedt en til din partnerkonto.

## Trin

**1. Vis tilgængelige teststeder**

Hent listen over teststeder for at finde et `location_id` til den tid, du vil booke.

```bash theme={null}
curl https://anivahealth.com/api/v1/locations \
  -H "x-api-key: YOUR_API_KEY"
```

**Eksempel på svar**

```json theme={null}
[
  {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "name": "Aniva Berlin Mitte",
    "company_name": "Aniva GmbH",
    "street": "Unter den Linden",
    "house_number": "42",
    "address_line_2": null,
    "city": "Berlin",
    "state": "Berlin",
    "postal_code": "10117",
    "country_name": "Germany",
    "country_code": "DE",
    "timezone": "Europe/Berlin",
    "contact_phone": "+4930987654321",
    "email": "berlin-mitte@anivahealth.com",
    "website": "https://anivahealth.com",
    "google_maps_url": null,
    "image_url": null,
    "open_hours": {
      "monday": [{ "open": "08:00", "close": "18:00" }],
      "tuesday": [{ "open": "08:00", "close": "18:00" }],
      "wednesday": [{ "open": "08:00", "close": "18:00" }],
      "thursday": [{ "open": "08:00", "close": "18:00" }],
      "friday": [{ "open": "08:00", "close": "16:00" }],
      "saturday": [],
      "sunday": []
    }
  }
]
```

Noter `id` på det teststed, du vil bruge. Du skal bruge det i trin 3.

**2. Opret en profil**

Opret en patientprofil ved at sende patientens demografiske data. `profile_group` knytter profilen til din partnerkonto — det accepterer enten gruppens uforanderlige UUID eller dens læsbare slug.

```bash theme={null}
curl -X POST https://anivahealth.com/api/v1/profiles \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "first_name": "Jordan",
    "last_name": "Rivera",
    "sex": 1,
    "date_of_birth": "1990-04-15",
    "profile_group": "your-profile-group"
  }'
```

**Felter i request body**

| Felt | Type | Påkrævet | Beskrivelse |
| - | - | - | - |
| `first_name` | string | Ja | Patientens fornavn |
| `last_name` | string | Ja | Patientens efternavn |
| `sex` | integer | Ja\*\* | `1` = mand, `2` = kvinde (ISO/IEC 5218) |
| `date_of_birth` | string | Ja\*\* | Fødselsdato i formatet `YYYY-MM-DD`. Skal ligge i fortiden, ikke før 1900, og give en alder på 16–100 år. |
| `profile_group` | string | Ja\* | UUID eller slug for din partnerprofilgruppe. UUID er den stabile reference; slug accepteres også. |
| `profile_group_slug` | string | Nej | **Udfaset.** Slug-alias for `profile_group`. Enten `profile_group` eller `profile_group_slug` er påkrævet. |
| `email` | string | Nej | Patientens e-mail. Genereres automatisk, hvis den udelades. |
| `language` | string | Nej | `en`, `de` eller `fi`. Standard er `en`. |
| `phone` | string | Nej | Telefonnummer i E.164-format, f.eks. `+4915123456789`. |
| `height` | number | Nej | Højde i centimeter. |
| `weight` | number | Nej | Vægt i kilogram. |
| `transactional_emails_enabled` | boolean | Nej | Tilsidesætter profilgruppens standard for driftsmails. |
| `marketing_emails_enabled` | boolean | Nej | Tilsidesætter profilgruppens standard for markedsføringsmails. |

\*\* Valgfrit, når din profilgruppe lader patienten indtaste begge dele på siden til aktivering af kittet. Se
[Profiler](https://docs.anivahealth.com/da/concepts/profiles.md#lad-patienten-indtaste-fodselsdato-og-kon).

**Eksempel på svar (201 Created)**

```json theme={null}
{
  "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "handle": null,
  "first_name": "Jordan",
  "last_name": "Rivera",
  "email": "jordan.rivera@example.com",
  "phone": null,
  "sex": 1,
  "date_of_birth": "1990-04-15",
  "height": null,
  "weight": null,
  "language": "en",
  "transactional_emails_enabled": null,
  "created_at": "2026-04-01T10:00:00Z",
  "updated_at": null
}
```

Noter `id` fra svaret. Du skal bruge det som `profile_id` i næste trin.

**3. Book en tid**

Opret en tid med `profile_id` fra trin 2 og `location_id` fra trin 1. Sæt `scheduled_at` til starttidspunktet for et tidsrum, som [Hent ledighed](https://docs.anivahealth.com/da/api/locations/get-availability.md) returnerer for teststedet. API'et afviser et tidspunkt, der ikke ligger på et fast tidsrum.

```bash theme={null}
curl -X POST https://anivahealth.com/api/v1/appointments \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "profile_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "location_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "scheduled_at": "2026-04-10T09:00:00Z"
  }'
```

**Eksempel på svar (201 Created)**

```json theme={null}
{
  "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
  "profile_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "location_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "scheduled_at": "2026-04-10T09:00:00Z",
  "status": "confirmed",
  "cancellation_reason": null,
  "results_ready_emails": [],
  "created_at": "2026-04-01T10:05:00Z",
  "updated_at": null,
  "profile": {
    "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "handle": null,
    "first_name": "Jordan",
    "last_name": "Rivera",
    "email": "jordan.rivera@example.com",
    "phone": null,
    "sex": 1,
    "date_of_birth": "1990-04-15",
    "height": null,
    "weight": null,
    "language": "en",
    "transactional_emails_enabled": null,
    "created_at": "2026-04-01T10:00:00Z",
    "updated_at": null
  },
  "panels": [],
  "individual_biomarkers": [],
  "shipments": [],
  "lab_codes": []
}
```

Noter tidens `id`. Du skal bruge det til at bekræfte blodprøvetagningen.

**4. Bekræft blodprøvetagningen**

Når blodprøvetagningen er gennemført, indsender du laboratoriekoden (stregkoden på prøveglasset) for at bekræfte blodprøvetagningen og udløse pipelinen til laboratoriebestillinger. Ved en blodprøvetagning, hvor prøveglassene har flere koder, sendes `lab_codes` i stedet — se [Bekræft blodprøvetagning](https://docs.anivahealth.com/da/api/appointments/confirm-blood-draw.md).

```bash theme={null}
curl -X POST https://anivahealth.com/api/v1/appointments/c3d4e5f6-a7b8-9012-cdef-123456789012/confirm \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "lab_code": "7642001234"
  }'
```

**Eksempel på svar (200 OK)**

```json theme={null}
{
  "success": true
}
```

Når den er bekræftet, udløses pipelinen til laboratoriebestillinger. Du kan hente tiden for at bekræfte, at dens status er ændret til `"blood_drawn"`.

## Næste trin

* [Tilføj paneler til en tid](https://docs.anivahealth.com/da/api/appointments/add-panels.md) for at angive, hvilke laboratorietests der skal udføres.
* [Opdater en tid](https://docs.anivahealth.com/da/api/appointments/update-appointment.md) for at ændre tidspunkt eller sted før blodprøvetagningen.
* [Aflys en tid](https://docs.anivahealth.com/da/api/appointments/cancel-appointment.md), hvis den ikke længere er nødvendig.
* [Hent laboratorieresultater](https://docs.anivahealth.com/da/api/appointments/get-results.md) for at indhente kliniske og genetiske resultater efter analyse.
* [Download dokumenter](https://docs.anivahealth.com/da/api/documents/download-document.md) for at hente laboratorierapporter som PDF.
* [Hent en profil](https://docs.anivahealth.com/da/api/profiles/get-profile.md) for at tjekke eller vise patientdata.
* Gennemgå hele [API-referencen](https://docs.anivahealth.com/da/api/profiles/create-profile.md) for alle tilgængelige endpoints og parametre.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.