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。

リクエストボディ

フィールド必須説明
authobjectYesCredential authentication information. Supports static_bearer, mcp_oauth, and environment_variable; responses include only redacted, non-secret fields.
display_namestringいいえCompatibility field. It is not currently persisted, and Forward responses always return an empty string.
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"
  },
  "display_name": "example-mcp",
  "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_errorリクエストボディ、パスパラメーター、またはクエリパラメーターが不正です。
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_error呼び出し元にはこのリソースへのアクセス権限がありません。
404not_found_errorVault が存在しないか、参照できません。
409conflict_errorリソース状態、参照関係、または冪等性キーが競合しています。
500/502/503api_errorForward または依存サービスでエラーが発生しました。