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

# Developer API

> 以程式化方式存取貴組織的訓練資料，範圍限定於所屬機構。

NexRex Developer API 讓教練機構能夠以程式化方式存取他們在 NexRex 中管理的
訓練資料——運動員（Athletes）、活動（Activities）、訓練計畫（Training Plans）、群組（Groups）——
並可隨時執行**資料匯出**。這是我們[資料可攜承諾](https://nexrex.ai/data-portability)背後的 API：
你的訓練資料屬於你，可自由讀取、搬移與建構。

<Note>
  這是一個**唯讀與匯出**的 API，不會修改運動員資料。寫入操作
  （提議課表調整或計畫修訂）透過 NexRex 的教練審核工作流程處理，不透過此 API。
</Note>

## 適用對象

開發者在教練機構資料上建構工具——分析儀表板、學員名單報告、平台間的資料遷移，
或彙整團隊狀態的 AI 助理。存取範圍**限定於機構（org-scoped）**：由機構核發的金鑰
只能存取該機構的資料。

## Base URL

```
https://api.nexrex.ai/api/v1/developer/v1
```

本文件中的所有路徑皆相對於此 base URL。例如，
`GET /org` 即為 `https://api.nexrex.ai/api/v1/developer/v1/org`。

## 版本控制

API 以日期作為版本號。目前版本為 **`2026-07-01`**，每個回應的 `X-API-Version` 標頭皆會回傳此版本。
重大變更至少提前 90 天公告——詳見[棄用政策](/zh-Hant/api-reference/deprecation-policy)。

## 機器可讀規格

完整的 API 合約以 OpenAPI 3.1 文件形式發布並即時提供：

```
GET https://api.nexrex.ai/api/v1/developer/v1/openapi.json
```

將此 URL 指向你的程式碼產生器、Postman 或 IDE，即可直接生成型別與請求。

## 開始使用

<Steps>
  <Step title="啟用 Developer API">
    Developer API 存取權為 **Club** 方案的一部分。若你的機構已訂閱 Club 方案，此功能即已啟用。
  </Step>

  <Step title="建立 API 金鑰">
    由主教練或機構管理員在 Coach Console 的 **Settings → Security** 下建立金鑰。
    詳見[認證](/zh-Hant/api-reference/authentication)。
  </Step>

  <Step title="選擇存取範圍與到期日">
    僅授予你的整合所需的[存取範圍（Scopes）](/zh-Hant/api-reference/scopes)，並設定到期日（預設為 90 天）。
  </Step>

  <Step title="發出第一個請求">
    ```bash theme={null}
    curl https://api.nexrex.ai/api/v1/developer/v1/org \
      -H "Authorization: Bearer nrx_prod_your_key_here"
    ```
  </Step>
</Steps>

<CardGroup cols={2}>
  <Card title="認證" icon="key" href="/zh-Hant/api-reference/authentication">
    建立金鑰、設定到期日，並在請求中傳送金鑰。
  </Card>

  <Card title="存取範圍" icon="lock" href="/zh-Hant/api-reference/scopes">
    七種權限及舊版金鑰的對應方式。
  </Card>

  <Card title="匯出" icon="file-export" href="/zh-Hant/api-reference/exports">
    執行非同步資料匯出並下載結果。
  </Card>

  <Card title="錯誤" icon="triangle-exclamation" href="/zh-Hant/api-reference/errors">
    錯誤信封格式與所有機器可讀的錯誤代碼。
  </Card>
</CardGroup>
