プロジェクト サービス アカウント シークレットのローテーション

POST /api/v1/%E3%83%97%E3%83%AD%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88/{id}/%E3%82%B5%E3%83%BC%E3%83%93%E3%82%B9%E3%82%A2%E3%82%AB%E3%82%A6%E3%83%B3%E3%83%88/{client_id}/%E3%83%AD%E3%83%BC%E3%83%86%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3

プロジェクトにスコープされたカスタマー サービス アカウント向けに新しいシークレットを生成します。前のシークレットは、7 日間まで、または、それより早い場合は有効期限が切れるまで引き続き機能します。このため、呼び出し元はダウンタイムなしで切り替えることができます。Body と secret_expires_after_hours は任意です。省略された値はデフォルトで 2160 (90 日間) になります。PROJECT_OWNER が必要です。または、所属オーガニゼーションの ORG_ADMIN も有効です。

path パラメータ

  • id string 必須

    プロジェクトID

  • client_id string 必須

    サービス アカウント クライアント ID (ae_sa_id_* 、レガシー agp_sa_id_*)

application/ JSON

body

任意のローテート リクエスト。省略された場合は、シークレットの有効期限はデフォルトで 90 日間になります。

  • secret_expires_after_hours integer

    任意のシークレット TTL (時間単位)省略された場合、空のローテートボディを含め、デフォルトは 2160 (90 日間)です。

応答

  • 未対応または形式が不正な API バージョン、選択した公開されたコントラクトでは利用できない操作、または受け入れられない表現 (未対応のメディアタイプ パラメータまたは除外された SSE を含む)。既存の認証、承認、およびレート制限の失敗が優先されます。

    応答属性の非表示 応答属性の表示 オブジェクト
    • validRequestDetail オブジェクト

      標準エラースキーマで定義された任意の検証詳細。ただし、API 交渉エラーではこのフィールドは出力されません。

      validRequestDetail 属性を非表示にする validRequestDetail 属性の表示 オブジェクト
      • フィールド array[オブジェクト]

        検証エラーのあるフィールド。

        フィールド属性を非表示にする フィールド属性の表示 オブジェクト

        フィールドとその検証の失敗。

        • 説明 string 必須

          人間が判読できる検証の失敗。

        • フィールド string 必須

          無効なリクエストフィールドの名前またはパス。

    • 詳細 string 必須

      読みやすいエラー詳細。

    • エラー integer 必須

      HTTP status code.

    • errorCode string 必須

      機械可読形式のエラーコード。

    • パラメーター array[string]

      エラーに関連するリクエスト パラメータ名。適用するものがない場合は省略されます。

    • 理由 string 必須

      HTTP ステータス理由フレーズ。

    応答属性の非表示 応答属性の表示 オブジェクト
    • validRequestDetail オブジェクト

      標準エラースキーマで定義された任意の検証詳細。ただし、API 交渉エラーではこのフィールドは出力されません。

      validRequestDetail 属性を非表示にする validRequestDetail 属性の表示 オブジェクト
      • フィールド array[オブジェクト]

        検証エラーのあるフィールド。

        フィールド属性を非表示にする フィールド属性の表示 オブジェクト

        フィールドとその検証の失敗。

        • 説明 string 必須

          人間が判読できる検証の失敗。

        • フィールド string 必須

          無効なリクエストフィールドの名前またはパス。

    • 詳細 string 必須

      読みやすいエラー詳細。

    • エラー integer 必須

      HTTP status code.

    • errorCode string 必須

      機械可読形式のエラーコード。

    • パラメーター array[string]

      エラーに関連するリクエスト パラメータ名。適用するものがない場合は省略されます。

    • 理由 string 必須

      HTTP ステータス理由フレーズ。

  • 200

    OK

    応答属性の非表示 応答属性の表示 オブジェクト
    • client_secret string
    • service_account オブジェクト
      サービス アカウント属性を隠す service_account 属性の表示 オブジェクト
      • アクティブ・シークレット オブジェクト
        active_secret 属性を隠す active_secret 属性を表示 オブジェクト
        • created_at string
        • expires_at string
        • last_used_at string
        • masked_value string
      • client_id string
      • created_at string
      • 説明 string
      • id string
      • ip_access_list array[string]
      • 有効 ブール値
      • is_system_managed ブール値
      • name string
      • org_id string
      • 所有者 string
      • project_id string
      • role_assignments array[オブジェクト]
        ロール割り当ての属性の非表示 role_assignments 属性の表示 オブジェクト
        • org_id string
        • project_id string
        • ロール string
      • タイプ string
      • Updated_at string
    応答属性の非表示 応答属性の表示 オブジェクト
    • client_secret string
    • service_account オブジェクト
      サービス アカウント属性を隠す service_account 属性の表示 オブジェクト
      • アクティブ・シークレット オブジェクト
        active_secret 属性を隠す active_secret 属性を表示 オブジェクト
        • created_at string
        • expires_at string
        • last_used_at string
        • masked_value string
      • client_id string
      • created_at string
      • 説明 string
      • id string
      • ip_access_list array[string]
      • 有効 ブール値
      • is_system_managed ブール値
      • name string
      • org_id string
      • 所有者 string
      • project_id string
      • role_assignments array[オブジェクト]
        ロール割り当ての属性の非表示 role_assignments 属性の表示 オブジェクト
        • org_id string
        • project_id string
        • ロール string
      • タイプ string
      • Updated_at string
  • 無効なリクエスト

    応答属性の非表示 応答属性の表示 オブジェクト
    • コード string
    • エラー string
    • 成功 ブール値
    応答属性の非表示 応答属性の表示 オブジェクト
    • コード string
    • エラー string
    • 成功 ブール値
  • Forbidden

    応答属性の非表示 応答属性の表示 オブジェクト
    • コード string
    • エラー string
    • 成功 ブール値
    応答属性の非表示 応答属性の表示 オブジェクト
    • コード string
    • エラー string
    • 成功 ブール値
  • 見つかりません

    応答属性の非表示 応答属性の表示 オブジェクト
    • コード string
    • エラー string
    • 成功 ブール値
    応答属性の非表示 応答属性の表示 オブジェクト
    • コード string
    • エラー string
    • 成功 ブール値
  • 429

    リクエストが多すぎます

    ヘッダーを非表示にする属性 headers 属性を表示
    • 再試行後 string

      再試行までの待機秒数

    応答属性の非表示 応答属性の表示 オブジェクト
    • コード string
    • エラー string
    • 成功 ブール値
    応答属性の非表示 応答属性の表示 オブジェクト
    • コード string
    • エラー string
    • 成功 ブール値
  • 内部サーバーエラー

    応答属性の非表示 応答属性の表示 オブジェクト
    • コード string
    • エラー string
    • 成功 ブール値
    応答属性の非表示 応答属性の表示 オブジェクト
    • コード string
    • エラー string
    • 成功 ブール値
  • 503

    サービスは利用できません

    ヘッダーを非表示にする属性 headers 属性を表示
    • 再試行後 string

      再試行までの待機秒数

    応答属性の非表示 応答属性の表示 オブジェクト
    • コード string
    • エラー string
    • 成功 ブール値
    応答属性の非表示 応答属性の表示 オブジェクト
    • コード string
    • エラー string
    • 成功 ブール値
書き込み /api/v1/プロジェクト/{id}/サービスアカウント/{client_id}/ローテーション
curl \
 --request POST 'https://agentengine.mongodb.com/api/v1/projects/{id}/service-accounts/{client_id}/rotate' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{
  "secret_expires_after_hours": 42
}'
リクエスト例
{
  "secret_expires_after_hours": 42
}
応答の例(406)
{
  "detail": "This operation is not available in API version 2026-09-20-preview.",
  "error": 406,
  "errorCode": "OPERATION_NOT_IN_API_VERSION",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
{
  "detail": "This operation supports text/event-stream, which the Accept header excludes. Remove unsupported media-type parameters or accept this type with a positive q value.",
  "error": 406,
  "errorCode": "UNACCEPTABLE_MEDIA_TYPE",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
{
  "detail": "The requested API version is not supported. Supported versions: 2026-09-20-preview.",
  "error": 406,
  "errorCode": "UNSUPPORTED_API_VERSION",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
応答の例(406)
{
  "detail": "This operation is not available in API version 2026-09-20-preview.",
  "error": 406,
  "errorCode": "OPERATION_NOT_IN_API_VERSION",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
応答の例(200)
{
  "client_secret": "string",
  "service_account": {
    "active_secret": {
      "created_at": "string",
      "expires_at": "string",
      "last_used_at": "string",
      "masked_value": "string"
    },
    "client_id": "string",
    "created_at": "string",
    "description": "string",
    "id": "string",
    "ip_access_list": [
      "string"
    ],
    "is_active": true,
    "is_system_managed": true,
    "name": "string",
    "org_id": "string",
    "owner": "string",
    "project_id": "string",
    "role_assignments": [
      {
        "org_id": "string",
        "project_id": "string",
        "role": "string"
      }
    ],
    "type": "string",
    "updated_at": "string"
  }
}
応答の例(200)
{
  "client_secret": "string",
  "service_account": {
    "active_secret": {
      "created_at": "string",
      "expires_at": "string",
      "last_used_at": "string",
      "masked_value": "string"
    },
    "client_id": "string",
    "created_at": "string",
    "description": "string",
    "id": "string",
    "ip_access_list": [
      "string"
    ],
    "is_active": true,
    "is_system_managed": true,
    "name": "string",
    "org_id": "string",
    "owner": "string",
    "project_id": "string",
    "role_assignments": [
      {
        "org_id": "string",
        "project_id": "string",
        "role": "string"
      }
    ],
    "type": "string",
    "updated_at": "string"
  }
}
応答の例(400)
{
  "code": "string",
  "error": "string",
  "success": true
}
応答の例(400)
{
  "code": "string",
  "error": "string",
  "success": true
}
応答の例(403)
{
  "code": "string",
  "error": "string",
  "success": true
}
応答の例(403)
{
  "code": "string",
  "error": "string",
  "success": true
}
応答の例(404)
{
  "code": "string",
  "error": "string",
  "success": true
}
応答の例(404)
{
  "code": "string",
  "error": "string",
  "success": true
}
応答の例(429)
# Headers
Retry-After: string

# Payload
{
  "code": "string",
  "error": "string",
  "success": true
}
応答の例(429)
# Headers
Retry-After: string

# Payload
{
  "code": "string",
  "error": "string",
  "success": true
}
応答の例(500)
{
  "code": "string",
  "error": "string",
  "success": true
}
応答の例(500)
{
  "code": "string",
  "error": "string",
  "success": true
}
応答の例(503)
# Headers
Retry-After: string

# Payload
{
  "code": "string",
  "error": "string",
  "success": true
}
応答の例(503)
# Headers
Retry-After: string

# Payload
{
  "code": "string",
  "error": "string",
  "success": true
}