Forward API リファレンス。
Description
Creates a Credential in the specified Vault. Sensitive authentication fields are never echoed in the response.
パス
POST /api/v1/forward/vaults/{id}/credentials
リクエストヘッダー
| ヘッダー | 必須 | 説明 |
|---|---|---|
Authorization | はい | Bearer <PAT または SAT> |
Idempotency-Key | いいえ | 作成リクエスト用の任意の冪等性キーです。同じキーは同一リクエストにのみ使用できます。 |
Content-Type | はい | application/json |
パス参数
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | はい | Vault ID。 |
リクエストボディ
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
auth | object | Yes | Credential authentication information. Supports static_bearer, mcp_oauth, and environment_variable; responses include only redacted, non-secret fields. |
display_name | string | いいえ | Compatibility field. It is not currently persisted, and Forward responses always return an empty string. |
metadata | object | No | Metadata object. created_by is reserved and must not be supplied (supplying it returns 400). |
auth フィールド
static_bearer:
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
type | string | はい | Must be static_bearer. |
mcp_server_url | string | はい | MCP Server URL. |
token | string | はい | Bearer token. Write-only and never returned in responses. |
mcp_oauth:
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
type | string | はい | Must be mcp_oauth. |
mcp_server_url | string | はい | MCP Server URL. |
access_token | string | はい | OAuth access token. Write-only and never returned in responses. |
expires_at | string | いいえ | Access token expiration time in RFC 3339 format. |
refresh | object | いいえ | OAuth refresh configuration. Secret fields are never returned in responses. |
environment_variable:
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
type | string | はい | Must be environment_variable. |
secret_name | string | はい | Environment variable name. Must match [A-Za-z_][A-Za-z0-9_]*. |
secret_value | string | はい | Environment variable value. Write-only and never returned in responses. |
auth.protocol は Forward Credential のリクエストフィールドではなく、指定しても効果はありません。
リクエスト例
レスポンス例
HTTP 201 Created
レスポンスフィールド
| フィールド | 型 | 説明 |
|---|---|---|
id | string | Credential ID。 |
type | string | 固定値 vault_credential。 |
vault_id | string | Parent Vault ID。 |
auth | object | マスクされた認証情報。 |
display_name | string | 現在は常に空文字列。 |
metadata | object | Credential メタデータ。 |
created_at | string | RFC 3339 形式の作成日時。 |
updated_at | string | RFC 3339 形式の最終更新日時。 |
エラー
| HTTP | Type | 発生条件 |
|---|---|---|
| 400 | invalid_request_error | リクエストボディ、パスパラメーター、またはクエリパラメーターが不正です。 |
| 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 | 認証トークンがないか、無効です。 |
| 403 | permission_error | 呼び出し元にはこのリソースへのアクセス権限がありません。 |
| 404 | not_found_error | Vault が存在しないか、参照できません。 |
| 409 | conflict_error | リソース状態、参照関係、または冪等性キーが競合しています。 |
| 500/502/503 | api_error | Forward または依存サービスでエラーが発生しました。 |