PUT/api/orgs/{org_id}/retention

既定の有効期限を設定する

保存済みの内容は、保存からこの日数(1〜3,650)で期限切れになります。nullの場合は保存がオンの間保持します。短くした設定は保存済みの内容にも適用されます。組織の管理者と組織自身のキーが実行できます。

認証: AuthorizationヘッダーにBearer形式のAPIキー

パスパラメーター

  • org_idstring必須

    お客様の組織ID(uuid)。GET /api/whoamiで取得できます。

リクエストボディ

  • default_daysinteger | null必須

    1〜3,650、またはnull。

レスポンス

  • 200

    設定。

    レスポンス
    • storage_onboolean

      組織がプロンプトと応答を保存しているかどうか。

    • default_daysinteger | null

      保存済みの内容が期限切れになるまでの日数。nullの場合は保存がオンの間保持します。

    • min_daysinteger
    • plan_max_daysinteger | null

      プランで設定できる最長の有効期限。上限がない場合はnull。

    • planstring
    • paid_retentionobject
      paid_retention
      • activeboolean
      • upgrade_max_daysinteger | null
      • upgrade_hrefstring
    • fixed_retention_daysinteger | null

      書面の契約で有効期限が固定されている場合に設定されます。その場合、他の設定は読み取り専用です。

    • overridesarray<object>
      overrides
      • idstring
      • scopeenum
        "project""request_tag""trace_tag"
      • targetstring
      • target_labelstring
      • daysinteger
      • created_atstring
    • key_capsinteger

      独自の有効期限の上限が設定されたキーの数。

    • keepsobject
      keeps
      • requestsinteger
      • sessionsinteger
    • archiveobject

      Experientialが自社で利用するための内容のアーカイブ。まだ提供されていません。

      archive
      • offeredboolean
      • opted_inboolean
      • excluded_becausearray<string>
      • default_onboolean
  • 401

    APIキーがない、不明、または失効しています。

    レスポンス
    • errorstring必須

      人が読めるメッセージ。

    • codestring

      エンドポイントが定義している場合の、安定した機械可読の理由(例:pro_required)。

    • actionstring

      エンドポイントが定義している場合の、安定した対処アクション。

    • detailsobject

      呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。

  • 403

    キーは有効ですが、この操作は許可されていません(例:プロビジョニングキー用エンドポイントでの推論キー、プラン対象外の機能)。

    レスポンス
    • errorstring必須

      人が読めるメッセージ。

    • codestring

      エンドポイントが定義している場合の、安定した機械可読の理由(例:pro_required)。

    • actionstring

      エンドポイントが定義している場合の、安定した対処アクション。

    • detailsobject

      呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。

  • 404

    リソースが存在しないか、他の組織に属しています。

    レスポンス
    • errorstring必須

      人が読めるメッセージ。

    • codestring

      エンドポイントが定義している場合の、安定した機械可読の理由(例:pro_required)。

    • actionstring

      エンドポイントが定義している場合の、安定した対処アクション。

    • detailsobject

      呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。

  • 409

    書面の保持契約により、この組織の有効期限は固定されています(fixed_retention)。

    レスポンス
    • errorstring必須

      人が読めるメッセージ。

    • codestring

      エンドポイントが定義している場合の、安定した機械可読の理由(例:pro_required)。

    • actionstring

      エンドポイントが定義している場合の、安定した対処アクション。

    • detailsobject

      呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。

  • 422

    日数が範囲外か(days_out_of_range)、プランの上限を超えています(expiry_exceeds_plan)。

    レスポンス
    • errorstring必須

      人が読めるメッセージ。

    • codestring

      エンドポイントが定義している場合の、安定した機械可読の理由(例:pro_required)。

    • actionstring

      エンドポイントが定義している場合の、安定した対処アクション。

    • detailsobject

      呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。

リクエスト

curl -X PUT 'https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/retention' \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "default_days": 30
}'

レスポンス

{
  "storage_on": true,
  "default_days": 30,
  "min_days": 1,
  "plan_max_days": null,
  "plan": "pro",
  "paid_retention": {
    "active": true,
    "upgrade_max_days": null,
    "upgrade_href": "/credits?upgrade=pro"
  },
  "fixed_retention_days": null,
  "overrides": [
    {
      "id": "e1d2c3b4-a5f6-4e7d-8c9b-0a1f2e3d4c5b",
      "scope": "project",
      "target": "evals",
      "target_label": "evals",
      "days": 7,
      "created_at": "2026-11-18T14:32:07Z"
    }
  ],
  "key_caps": 1,
  "keeps": {
    "requests": 3,
    "sessions": 1
  },
  "archive": {
    "offered": false,
    "opted_in": false,
    "excluded_because": [],
    "default_on": false
  }
}

https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/retention