Skip to main content
Credentials

Credential の作成

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

パス参数

パラメーター型必須説明
idstringはいVault ID。

クエリパラメーター

ParameterTypeRequiredDescription
identity_idstringNoIdentity に属するリソースを操作する場合のみ使用する任意のパラメーターです。PAT では明示的に指定でき、省略時は管理者スコープになります。SAT では Identity スコープのトークンを発行し、このパラメーターを明示的に指定しないでください。指定すると HTTP 400 が返されます。Identity の帰属.

リクエストボディ

フィールド型必須説明
authobjectYesCredential authentication information. Supports static_bearer, mcp_oauth, and environment_variable; responses include only redacted, non-secret fields.
metadataobjectNoMetadata object. created_by is reserved and must not be supplied (supplying it returns 400).

auth フィールド

static_bearer:
フィールド型必須説明
typestringはいMust be static_bearer.
mcp_server_urlstringはいMCP Server URL.
tokenstringはいBearer token. Write-only and never returned in responses.
mcp_oauth:
フィールド型必須説明
typestringはいMust be mcp_oauth.
mcp_server_urlstringはいMCP Server URL.
access_tokenstringはいOAuth access token. Write-only and never returned in responses.
expires_atstringいいえAccess token expiration time in RFC 3339 format.
refreshobjectいいえOAuth refresh configuration. Secret fields are never returned in responses.
environment_variable:
フィールド型必須説明
typestringはいMust be environment_variable.
secret_namestringはいEnvironment variable name. Must match [A-Za-z_][A-Za-z0-9_]*.
secret_valuestringはいEnvironment variable value. Write-only and never returned in responses.
auth.protocol は Forward Credential のリクエストフィールドではなく、指定しても効果はありません。

リクエスト例

{
  "auth": {
    "type": "static_bearer",
    "mcp_server_url": "https://mcp.example.com",
    "token": "secret_token"
  },
  "metadata": {
    "source": "console"
  }
}

レスポンス例

HTTP 201 Created
{
  "id": "vcred_xxx",
  "type": "vault_credential",
  "vault_id": "vault_xxx",
  "auth": {
    "type": "static_bearer",
    "mcp_server_url": "https://mcp.example.com"
  },
  "display_name": "",
  "metadata": {
    "source": "console"
  },
  "created_at": "2026-07-23T10:00:00Z",
  "updated_at": "2026-07-23T10:00:00Z"
}

レスポンスフィールド

フィールド型説明
idstringCredential ID。
typestring固定値 vault_credential。
vault_idstringParent Vault ID。
authobjectマスクされた認証情報。
display_namestring現在は常に空文字列。
metadataobjectCredential メタデータ。
created_atstringRFC 3339 形式の作成日時。
updated_atstringRFC 3339 形式の最終更新日時。

エラー

HTTPType発生条件
400invalid_request_errorThe request body, path parameters, or query parameters are invalid. SAT が identity_id を明示的に指定した場合も返されます。
400invalid_request_errorIf the reserved key created_by is supplied, message is metadata key "created_by" is reserved, identifying the invalid field.
401authentication_error認証トークンがないか、無効です。
403permission_errorVault identity_id を指定しない PAT または Admin SAT で Owner mismatch が発生したか、その他の権限が不足しています。
404not_found_errorThe Vault does not exist or is not visible. identity_id is invalid, disabled, or does not belong to the caller, or the target resource does not belong to the current Identity scope.
409conflict_errorリソース状態、参照関係、または冪等性キーが競合しています。
500/502/503api_errorForward または依存サービスでエラーが発生しました。