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

# API Reference

> Integrate 9Pic event photos, search, and downloads with a single API key

The **9Pic API** is the developer surface over 9Pic AI's event memory products. With a single `X-API-Key` header you can list events, fetch event photos, run **9Pic BibTrack** searches by BIB number, run **9Pic FaceFind** selfie searches, generate **9Pic Motion** video clips, and produce presigned download links for originals.

## Base URL

```
https://api.9pic.ai
```

All endpoints are versioned under `/api/v1/ext/...`. Read the [Conventions](/api-reference/conventions) page for response envelopes, identifiers, pagination, and idempotency rules. Read the [Errors](/api-reference/errors) page for status codes.

## Quickstart

<Steps>
  <Step title="Create an API key">
    Open **Developer Zone** in the [9Pic dashboard](https://admin.9pic.ai/) sidebar and click **Create Token**. Copy the key once — it is shown only at creation time. See [Authentication](/api-reference/authentication) for token management.
  </Step>

  <Step title="Find your org_id and event_id">
    Your `org_id` is shown in the top-left organisation selector. Each `event_id` appears next to its event in the event list. You can also fetch them programmatically with [List Events](/api-reference/list-events).
  </Step>

  <Step title="Make your first request">
    [Ping](/api-reference/ping) is the safest first call — it validates your API key, host, and event mapping in one round trip.

    <CodeGroup>
      ```bash cURL theme={null}
      curl -i \
        -H "X-API-Key: <your_9pic_api_key>" \
        "https://api.9pic.ai/api/v1/ext/903/event/456/ping"
      ```

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

      response = requests.get(
          "https://api.9pic.ai/api/v1/ext/903/event/456/ping",
          headers={"X-API-Key": "<your_9pic_api_key>"},
      )
      print(response.status_code, response.json())
      ```

      ```javascript JavaScript theme={null}
      const response = await fetch(
        "https://api.9pic.ai/api/v1/ext/903/event/456/ping",
        { headers: { "X-API-Key": "<your_9pic_api_key>" } }
      );
      const data = await response.json();
      console.log(response.status, data);
      ```
    </CodeGroup>

    A successful response is `200 OK` with `{ "status": "ok", "org_id": 903, "event_id": 456 }`.
  </Step>

  <Step title="Fetch events and photos">
    Once Ping returns `200`, you can call [List Events](/api-reference/list-events), [All Photos](/api-reference/all-photos), or any of the search endpoints below.
  </Step>
</Steps>

## Start Here

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/api-reference/authentication">
    Create, manage, and rotate API keys.
  </Card>

  <Card title="Conventions" icon="compass" href="/api-reference/conventions">
    Base URL, identifiers, response envelopes, and pagination.
  </Card>

  <Card title="Errors" icon="triangle-exclamation" href="/api-reference/errors">
    Status codes, common causes, and retry guidance.
  </Card>

  <Card title="Ping" icon="heart-pulse" href="/api-reference/ping">
    Verify your integration end to end.
  </Card>
</CardGroup>

## Events

<CardGroup cols={2}>
  <Card title="List Events" icon="list" href="/api-reference/list-events">
    Paginated list of events for your organisation.
  </Card>

  <Card title="Event Details" icon="circle-info" href="/api-reference/event-details">
    Event metadata and enabled search capabilities.
  </Card>
</CardGroup>

## Memories

Photos and videos are grouped under the [Memories](/api-reference/memories) section of the API.

<CardGroup cols={2}>
  <Card title="All Photos" icon="images" href="/api-reference/all-photos">
    Paginated gallery of every photo in an event.
  </Card>

  <Card title="BIB Search" icon="hashtag" href="/api-reference/bib-search">
    Find photos by participant BIB number with **9Pic BibTrack**.
  </Card>

  <Card title="Face Search" icon="user-magnifying-glass" href="/api-reference/face-search">
    Find photos by uploading a selfie with **9Pic FaceFind**.
  </Card>

  <Card title="Video Clipping Search" icon="film" href="/api-reference/video-clipping-search">
    Generate personalised video clips with **9Pic Motion** (async).
  </Card>

  <Card title="Download Originals" icon="cloud-arrow-down" href="/api-reference/download-original-photos">
    Presigned URLs for original (unwatermarked) photos using a BIB number or a selfie `request_id`.
  </Card>
</CardGroup>

## Models

<CardGroup cols={1}>
  <Card title="API Models" icon="shapes" href="/api-reference/models">
    Shared request and response models for events, photos, search, downloads, and pagination.
  </Card>
</CardGroup>
