凭据
归档凭据
通过 OMA API 归档凭据。
POST
/
v1
/
vaults
/
{vault_id}
/
credentials
/
{credential_id}
/
archive
归档凭据
curl --request POST \
--url http://localhost:38080/v1/vaults/{vault_id}/credentials/{credential_id}/archive \
--header 'X-Api-Key: <api-key>'import requests
url = "http://localhost:38080/v1/vaults/{vault_id}/credentials/{credential_id}/archive"
headers = {"X-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Api-Key': '<api-key>'}};
fetch('http://localhost:38080/v1/vaults/{vault_id}/credentials/{credential_id}/archive', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:38080/v1/vaults/{vault_id}/credentials/{credential_id}/archive"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"type": "vault_credential",
"id": "vcrd_011CZkZEMt8gZan2iYOQfSkw",
"vault_id": "vlt_011CZkZDLs7fYzm1hXNPeRjv",
"display_name": "示例凭证",
"metadata": {
"environment": "production"
},
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z",
"archived_at": null,
"auth": {
"type": "static_bearer",
"mcp_server_url": "https://example-server.modelcontextprotocol.io/sse"
}
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}每个请求都必须发送
?beta=true。授权
omaApiKeyomaBearer
OMA 工作区 API 密钥。
查询参数
为此接口启用 Beta API 合同,必须为 true。
可用选项:
true 响应
请求成功。
存储在密钥库中的凭据。敏感字段永远不会在响应中返回。
可用选项:
vault_credential 示例:
"vault_credential"
凭据的唯一标识符。
示例:
"vcrd_011CZkZEMt8gZan2iYOQfSkw"
该 credential 所属密钥库的标识符。
示例:
"vlt_011CZkZDLs7fYzm1hXNPeRjv"
附加到该凭证的任意键值元数据。
Show child attributes
Show child attributes
示例:
{ "environment": "production" }
RFC 3339 格式的时间戳
示例:
"2026-03-15T10:00:00Z"
RFC 3339 格式的时间戳
示例:
"2026-03-15T10:00:00Z"
凭证的归档时间。未归档时为 null。
示例:
null
此 credential 的认证配置。
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
示例:
{
"type": "static_bearer",
"mcp_server_url": "https://example-server.modelcontextprotocol.io/sse"
}
凭据的人类可读名称。
示例:
"示例凭证"
此页面对您有帮助吗?
⌘I
归档凭据
curl --request POST \
--url http://localhost:38080/v1/vaults/{vault_id}/credentials/{credential_id}/archive \
--header 'X-Api-Key: <api-key>'import requests
url = "http://localhost:38080/v1/vaults/{vault_id}/credentials/{credential_id}/archive"
headers = {"X-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Api-Key': '<api-key>'}};
fetch('http://localhost:38080/v1/vaults/{vault_id}/credentials/{credential_id}/archive', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:38080/v1/vaults/{vault_id}/credentials/{credential_id}/archive"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"type": "vault_credential",
"id": "vcrd_011CZkZEMt8gZan2iYOQfSkw",
"vault_id": "vlt_011CZkZDLs7fYzm1hXNPeRjv",
"display_name": "示例凭证",
"metadata": {
"environment": "production"
},
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z",
"archived_at": null,
"auth": {
"type": "static_bearer",
"mcp_server_url": "https://example-server.modelcontextprotocol.io/sse"
}
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}