プロジェクトサービス アカウントの作成

POST /api/v1/projects/{id}/service-accounts

プロジェクト範囲のカスタマーサービス アカウントを作成し、そのシークレットを 1 回返します。ロールは、PROJECT_OWNER、PROJECT_READ_ONLY、または Agent_DELEOPER という名前の 1 つの名前のみを受け入れます。 Project_MEMBER は引き続き受け入れられます。 role_assignments は保存されたエージェント エンジン ロールを反復します。 PROJECT_OWNER が必要です。所有する組織の ORM_ADMIN も渡します。

path パラメータ

  • id string 必須

    プロジェクトID

application/ JSON

body 必須

リクエストを作成

  • 説明 string

    最大長は 500 です。

  • ip_access_list array[string]

    任意のIP/CIDR 許可リスト。空または省略すると、制限されていないことを意味します。最大で 100 エントリ。

    100 要素以下

  • name string 必須

    最大長は 100 です。

  • 役割 array[string] 必須

    ロールは初期ロールセットです。必要なロールは 1 つだけです。組織アカウントは OG_GROUP_CREATOR または ORM_READ_ONLY を受け入れます。プロジェクト アカウントは、PROJECT_OWNER、PROJECT_READ_ONLY、または AGENT_DELEOPER を受け入れます。レガシーエージェント エンジン名(ORG_ADMIN、ORG_MEMBER、PROJECT_MEMBER)は引き続き使用できます。 role_assignments は、保存されたエージェント エンジンのロールを、名前を解決します。

    以上かつ 1 以上、1 以下の要素。

  • secret_expires_ after_hours integer

    任意のシークレット TTL(単位は時間)。省略した場合、デフォルトは 2160(90 日)になります。

応答

  • サポートされていないAPIバージョンまたは不正な 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ステータス理由フレーズ。

  • 201

    作成済み

    応答属性の非表示 応答属性の表示 オブジェクト
    • client_secret string
    • service_Account オブジェクト
      service_Account 属性を非表示にする service_Account 属性の表示 オブジェクト
      • Active_secret オブジェクト
        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_active ブール値
      • is_system_managed ブール値
      • name string
      • org_id string
      • 所有者 string
      • project_id string
      • role_assignments array[オブジェクト]
        role_assignments 属性を非表示にする role_assignments 属性の表示 オブジェクト
        • org_id string
        • project_id string
        • ロール string
      • タイプ string
      • Updated_at string
    応答属性の非表示 応答属性の表示 オブジェクト
    • client_secret string
    • service_Account オブジェクト
      service_Account 属性を非表示にする service_Account 属性の表示 オブジェクト
      • Active_secret オブジェクト
        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_active ブール値
      • is_system_managed ブール値
      • name string
      • org_id string
      • 所有者 string
      • project_id string
      • role_assignments array[オブジェクト]
        role_assignments 属性を非表示にする 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
    • 成功 ブール値
  • 競合

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

    リクエストが多すぎる

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

      再試行する前に待機する秒数

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

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

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

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

      再試行する前に待機する秒数

    応答属性の非表示 応答属性の表示 オブジェクト
    • コード string
    • エラー string
    • 成功 ブール値
    応答属性の非表示 応答属性の表示 オブジェクト
    • コード string
    • エラー string
    • 成功 ブール値
POST /api/v1 /projects/{id}/service-accounts
curl \
 --request POST 'https://agentengine.mongodb.com/api/v1/projects/{id}/service-accounts' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{
  "description": "string",
  "ip_access_list": [
    "string"
  ],
  "name": "string",
  "roles": [
    "string"
  ],
  "secret_expires_after_hours": 42
}'
リクエスト例
{
  "description": "string",
  "ip_access_list": [
    "string"
  ],
  "name": "string",
  "roles": [
    "string"
  ],
  "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"
}
応答の例(201)
{
  "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"
  }
}
応答の例(201)
{
  "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
}
応答の例(409)
{
  "code": "string",
  "error": "string",
  "success": true
}
応答の例(409)
{
  "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
}