Forward API リファレンス。
Description
Creates a runtime environment configuration for Agent Sessions.
パス
POST /api/v1/forward/environments
リクエストヘッダー
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <PAT or SAT> |
Content-Type | Yes | application/json |
Idempotency-Key | No | Recommended for create requests. The same key and request can be retried safely. |
クエリパラメーター
| Parameter | Type | Required | Description |
|---|---|---|---|
identity_id | string | No | Identity に属するリソースを操作する場合のみ使用する任意のパラメーターです。PAT では明示的に指定でき、省略時は管理者スコープになります。SAT では Identity スコープのトークンを発行し、このパラメーターを明示的に指定しないでください。指定すると HTTP 400 が返されます。Identity の帰属. |
リクエストボディ
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Environment name. It must not be empty after trimming leading and trailing whitespace. |
description | string | No | Description. |
config | Environment config | No | Environment runtime configuration. Defaults to {"type":"cloud"} when omitted. When provided explicitly, it must not be null or an empty object. See schemas for field details. |
metadata | object | No | Environment metadata. Defaults to {} when omitted and must not be null when provided explicitly. |
config subfields (type, packages, and setup_script) and their constraints. A self_hosted Environment accepts only type and an optional setup_script; a cloud Environment can also declare packages.
リクエスト例
Request with packages and a setup script
レスポンス例
HTTP 201 Created
レスポンスフィールド
The response is an Environment object. config is normalized to its complete shape. For a cloud Environment, config.packages includes empty arrays for every reserved key in Environment packages.
エラー
| HTTP | Type | Trigger |
|---|---|---|
| 400 | invalid_request_error | name is missing or empty, the request body is not valid JSON, or config / metadata violates the constraints above. SAT が identity_id を明示的に指定した場合も返されます。 |
| 400 | invalid_request_error | If the reserved key created_by is supplied, message is metadata key "created_by" is reserved, identifying the invalid field. |
| 401 | authentication_error | The authentication token is missing or invalid. |
| 403 | permission_error | identity_id を指定しない PAT または Admin SAT で Owner mismatch が発生したか、その他の権限が不足しています。 |
| 404 | not_found_error | identity_id is invalid, disabled, or does not belong to the caller, or the target resource does not belong to the current Identity scope. |
| 409 | conflict_error | The Idempotency-Key maps to a different request, or creation is in an intermediate state that requires manual recovery. |
| 413 | invalid_request_error | The request body exceeds the service limit. |
| 429 | rate_limit_error | The caller exceeded the API rate limit. |
| 500/502/503 | api_error | Forward or a dependent service failed. |

