API 參考
本頁列出 TCS 公開的所有公開和管理端點。服務間內部通訊使用的端點不包含在內。所有服務均提供健康檢查端點(GET /health),但不列入本參考文件。
各端點的身份驗證詳情,請參閱身份驗證參考文件。
OpenAPI 規格
Section titled “OpenAPI 規格”若你需要 machine-readable spec 來產生 SDK 或自動化工具,請聯繫 TCS 團隊。
基礎 URL:https://auth.turingspace.co
Authorization Server 處理 OAuth 2.0 token 發行、DPoP 驗證和授權碼流程。它依照 RFC 8414 發布探索元資料。
| 方法 | 路徑 | 說明 | 驗證 |
|---|---|---|---|
| GET | /.well-known/oauth-authorization-server | RFC 8414 探索文件。回傳 issuer、token_endpoint、pushed_authorization_request_endpoint 和 dpop_signing_alg_values_supported 等欄位。 | 公開 |
| POST | /v1/token | 以預授權碼或授權碼換取 access token。 | 公開 |
| POST | /v1/par | 建立 Pushed Authorization Request session(RFC 9126)。 | 公開 |
授權端點(GET /v1/authorize)、登入表單提交(POST /v1/authorize/submit)以及登出端點(GET /end_session)皆為瀏覽器導引(browser-driven),不屬於整合 API 表面。為符合規範,它們仍會出現在 discovery 文件中。
GET /.well-known/oauth-authorization-server — RFC 8414 AS 元資料探索
回傳 Authorization Server 元資料文件。錢包和客戶端在啟動時取得此文件,以探索端點 URL、支援的授權類型、DPoP 演算法和客戶端 attestation 要求。
驗證: 公開 · Content-Type: N/A(GET)
Response 200
{ "issuer": "https://auth.turingspace.co", "authorization_endpoint": "https://auth.turingspace.co/v1/authorize", "token_endpoint": "https://auth.turingspace.co/v1/token", "pushed_authorization_request_endpoint": "https://auth.turingspace.co/v1/par", "end_session_endpoint": "https://auth.turingspace.co/end_session", "response_types_supported": ["code"], "grant_types_supported": [ "authorization_code", "urn:ietf:params:oauth:grant-type:pre-authorized_code" ], "code_challenge_methods_supported": ["S256"], "token_endpoint_auth_methods_supported": ["attest_jwt_client_auth"], "client_attestation_signing_alg_values_supported": ["ES256", "EdDSA"], "client_attestation_pop_signing_alg_values_supported": ["ES256", "EdDSA"], "dpop_signing_alg_values_supported": ["ES256", "EdDSA"], "authorization_details_types_supported": ["openid_credential"], "authorization_response_iss_parameter_supported": true, "id_token_signing_alg_values_supported": ["ES256"]}錯誤 — 正常操作下不預期有錯誤。永遠回傳 200。
另見: 身份驗證參考
POST /v1/par — 建立 PAR session(RFC 9126)
將授權請求推送至 AS 並取得 request_uri 憑證。錢包接著將使用者重新導向至 AS 的授權端點並帶上此憑證。這是授權碼發行流程的第一步;pre-authorized_code 流程完全略過 PAR。
驗證: 公開 · Content-Type: application/x-www-form-urlencoded
預設要求客戶端 attestation。 AS 的
CLIENT_ATTESTATION_REQUIRED_AUTH_CODE=true。請在請求中加入OAuth-Client-Attestation+OAuth-Client-Attestation-PoP標頭,否則會以401拒絕。詳情請見身份驗證。
請求參數
response_type(required, string)— 必須為code。client_id(required, string)— 客戶端識別符,例如test-wallet。redirect_uri(required, URL)— 授權碼傳遞 URL,例如https://wallet.example.com/callback。code_challenge(required, string)— PKCE challenge:base64url(SHA-256(code_verifier)),例如E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM。code_challenge_method(required, string)— 必須為S256。scope(optional, string)— 依 HAIP §4.3 的 Credential configuration ID,例如TuringCerts_Standard_Credential_v2_sd_jwt。issuer_state(optional, UUID)— 從憑證 offer 的authorization_code.issuer_state帶入。authorization_details(optional, JSON array)— RFC 9396 / OID4VCI §5.1.1,例如[{"type":"openid_credential","credential_configuration_id":"UniversityDegree"}]。state(optional, string ≤ 4096 chars)— 錢包 CSRF token。request_uri— PAR body 中禁止使用(RFC 9126 §2.1);以invalid_request拒絕。
Response 201
{ "request_uri": "urn:ietf:params:oauth:request-uri:bwc4JZ-ESnd0kX1aIAr5pg", "expires_in": 60}錯誤 — { "error": "...", "error_description": "..." }(RFC 6749 §5.2)
400 invalid_request— 缺少必要欄位、body 中帶有request_uri,或issuer_state不是合法 UUID。
另見: 錢包協議 — 憑證發行流程
POST /v1/token — 以授權碼換取 access token
以預授權碼(pre-authorized_code grant)或授權碼(authorization_code grant)換取 access token。Token 回應攜帶 Bearer 或 DPoP 綁定的 access token,用於憑證端點。
驗證: 公開 · Content-Type: application/x-www-form-urlencoded
請求參數 — pre-authorized_code grant
grant_type(required, string)—urn:ietf:params:oauth:grant-type:pre-authorized_code。pre-authorized_code(required, string)— 來自憑證 offer 的授權碼,例如SplxlOBeZQQYbYS6WxSbIA。tx_code(conditional, string)— 若 offer 中帶有tx_code,則需提供交易碼(使用者 PIN),例如123456。
請求參數 — authorization_code grant
grant_type(required, string)—authorization_code。code(required, string)— 來自重新導向回呼的授權碼。code_verifier(required, string)— PKCE verifier,例如dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk。redirect_uri(required, string)— 必須與 PAR session 中的 URI 相符。client_id(required, string)— 客戶端識別符。
Response 200
{ "access_token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9...", "token_type": "DPoP", "expires_in": 3600}token_type 在請求包含 DPoP 標頭時為 DPoP,否則為 Bearer。
錯誤 — { "error": "...", "error_description": "..." }(RFC 6749 §5.2)
400 invalid_grant— 預授權碼已過期或已使用。400 unsupported_grant_type— 未知的grant_type值。400 use_dpop_nonce— AS 要求新的 DPoP nonce;請重試並帶上DPoP-Nonce標頭。400 invalid_dpop_proof— DPoP proof JWT 格式錯誤或已過期。
另見: 錢包協議 — token 換取
基礎 URL:https://issuer.turingspace.co
Credential Issuer 管理憑證 offer、提供發行方元資料供錢包探索,並在 token 驗證的請求下發行 SD-JWT VC。
| 方法 | 路徑 | 說明 | 驗證 |
|---|---|---|---|
| POST | /v1/offers | 建立憑證 offer。請參閱步驟一:建立憑證 offer。 | API Key |
| GET | /v1/offers/:offerId | 取得 OID4VCI 格式的憑證 offer 詳情。由錢包在掃描 offer URI 後呼叫。 | 公開 |
| POST | /v1/nonce | 取得憑證請求 proof 用的新 c_nonce(OID4VCI 第 7 節)。請參閱步驟三:取得 c_nonce。 | 公開 |
| POST | /credential | 發行 SD-JWT VC,支援 Bearer 和 DPoP token。請參閱步驟五:請求憑證。 | Bearer / DPoP |
| GET | /.well-known/openid-credential-issuer/:tenant | OID4VCI 第 11 節發行方元資料。回傳 credential_endpoint、credential_configurations_supported、authorization_servers 和 nonce_endpoint。 | 公開 |
| GET | /:tenant | 含發行方資訊和元資料連結的租戶登陸頁面。 | 公開 |
POST /v1/offers — 建立憑證 offer
建立憑證 offer,編碼可用的憑證類型,以及錢包應如何取得憑證(pre-authorized_code 或 authorization_code 流程)。回傳 deep_link(openid-credential-offer://),以 QR code 或直接連結的形式提供給持有者。
驗證: API Key · Content-Type: application/json
請求參數
credential(required, object)— 憑證規格:config_id(required, string)— OID4VCIcredential_configuration_id的 TCS 簡稱,例如UniversityDegree。claims(required, object)— 要包含的聲明鍵值對,例如{"degree": "Bachelor of Science", "major": "Computer Science"}。
flow(required, string)—pre-authorized或authorization-code。issuer_did(optional, string)— 用於 DID 簽章的憑證發行方 DID,例如did:iota:issuer-ntu-001。提供時同樣需要issuer_private_key。issuer_private_key(optional, string)— Ed25519:base64url 編碼的 seed;ES256:PKCS#8 PEM。提供issuer_did時必填。holder_did(optional, string)— 用於憑證綁定的持有者 DID,例如did:iota:holder-xyz。expires_in(optional, integer, 60–86400)— Offer 有效期(秒),預設 3600。require_transaction_code(optional, boolean)— 是否要求tx_codePIN(預設false)。設為true目前在公開端點會被以400拒絕;auth server 端的驗證已就緒,但發行端的啟用(tx_code 產生 + 使用者通知)需在 onboarding 階段與 TCS 團隊協調。自助發行請保留false或省略。
簽章模式: 同時提供 issuer_did + issuer_private_key 時,使用 DID 簽章。兩者都省略時,使用 X.509 伺服器端簽章。只提供其中一個會回傳 400 驗證錯誤。
Response 201
{ "offer_id": "550e8400-e29b-41d4-a716-446655440000", "credential_offer_uri": "https://issuer.turingspace.co/v1/offers/550e8400-e29b-41d4-a716-446655440000", "deep_link": "openid-credential-offer://?credential_offer_uri=https%3A%2F%2Fissuer.turingspace.co%2Fv1%2Foffers%2F550e8400-e29b-41d4-a716-446655440000", "expires_at": "2024-12-31T12:00:00.000Z"}錯誤
400 Bad Request— 缺少必要欄位、DID 格式無效,或issuer_did/issuer_private_key不匹配。401 Unauthorized— 缺少或無效的 API Key。
另見: Issuer — 發行憑證
GET /v1/offers/:offerId — 取得憑證 offer(錢包端點)
回傳給定 offer ID 的 OID4VCI CredentialOffer 物件。錢包在解析 deep link 或 QR code 中的 credential_offer_uri 後呼叫此 URL。
驗證: 公開 · Content-Type: N/A(GET)
路徑參數
offerId(required, UUID)— 來自POST /v1/offers的 offer 識別符。
Response 200
{ "credential_issuer": "https://issuer.turingspace.co/turing", "credential_configuration_ids": ["UniversityDegree"], "grants": { "urn:ietf:params:oauth:grant-type:pre-authorized_code": { "pre-authorized_code": "oaKazRN8I0IbtZ0C7JuMn5", "tx_code": { "input_mode": "numeric", "length": 6, "description": "Please enter the transaction code sent to your email" } } }, "expires_at": "2024-12-31T12:00:00.000Z"}當 offer 建立時帶有 require_transaction_code: true,回應中會包含 tx_code 物件 — 錢包提示使用者輸入交易碼,然後將其作為 tx_code 欄位送至 POST /v1/token,auth server 比對 hash 驗證。require_transaction_code: true 的啟用會在 onboarding 階段與 TCS 團隊協調;目前公開的 POST /v1/offers 在協調完成前會拒絕 true。授權碼流程的 offer 中,grants.authorization_code 會取代 pre-authorized_code,並可包含可選的 issuer_state 欄位。
錯誤
400 Bad Request—offerId路徑參數的 UUID 格式無效。404 Not Found— Offer 不存在。410 Gone— Offer 已過期。
另見: 錢包協議 — 解析 offer
POST /v1/nonce — 取得新的 c_nonce
回傳 c_nonce challenge,錢包必須將其包含在與憑證請求一起發送的 proof-of-possession JWT 中。依 OID4VCI §7(Nonce Endpoint)要求用於金鑰綁定。
驗證: 公開 · Content-Type: application/json(接受空 body)
Response 200
{ "c_nonce": "tZignsnFbp"}錯誤 — 正常操作下不預期有錯誤。
POST /credential — 發行 SD-JWT VC
向已驗證的錢包發行 SD-JWT VC(dc+sd-jwt 格式)。錢包提供從 token 端點取得的 access token(Bearer 或 DPoP 綁定),以及可選的持有者金鑰 proof of possession。
驗證: Bearer 或 DPoP access token(透過 Authorization 標頭) · Content-Type: application/json
請求參數
credential_configuration_id(conditional, string)— 來自發行方元資料的 ID,例如UniversityDegree。未使用credential_identifier時必填。credential_identifier(conditional, string)— OID4VCI §7.2 中credential_configuration_id的替代方案;互斥。proofs(optional, object)— 用於金鑰綁定的 proof of possession:jwt(required withinproofs, array of strings)— 一個或多個包含c_nonce和持有者 DID 或金鑰的 JWT proof。
is_on_chain(optional, boolean, 預設false)— 在 IOTA 區塊鏈上發布憑證。
Response 200
{ "credentials": [ { "credential": "eyJhbGciOiJFZERTQSIsInR5cCI6InZjK3NkLWp3dCJ9.eyJ2YyI6eyJjcmVkZW50aWFsU3ViamVjdCI6e319fQ~...", "reference": { "chain": "iota", "object_id": "0x1234567890abcdef..." } } ]}reference 僅在 is_on_chain=true 時存在。
錯誤
400 invalid_credential_request— 同時提供了credential_configuration_id和credential_identifier,或僅使用credential_identifier的請求(尚不支援)。401 Unauthorized— 缺少或無效的 access token。400 invalid_proof— Proof JWT 格式錯誤、nonce 不符,或簽章無效。
另見: 錢包協議 — 請求憑證
GET /.well-known/openid-credential-issuer/:tenant — OID4VCI 發行方元資料
回傳指定租戶的 OID4VCI Credential Issuer Metadata 文件。錢包透過在 offer 中的 credential_issuer URL 後附加 /.well-known/openid-credential-issuer/{tenant} 自動取得此文件。
驗證: 公開 · Content-Type: N/A(GET)
路徑參數
tenant(required, string)— 租戶識別符,例如turing。
Response 200
{ "credential_issuer": "https://issuer.turingspace.co/turing", "authorization_servers": ["https://auth.turingspace.co"], "credential_endpoint": "https://issuer.turingspace.co/credential", "nonce_endpoint": "https://issuer.turingspace.co/v1/nonce", "credential_configurations_supported": { "UniversityDegree": { "format": "dc+sd-jwt", "scope": "TuringCerts_Standard_Credential_v2_sd_jwt", "vct": "https://schema-registry.turingspace.co/UniversityDegree/v1.0", "credential_signing_alg_values_supported": ["EdDSA"], "cryptographic_binding_methods_supported": ["did"], "proof_types_supported": { "jwt": { "proof_signing_alg_values_supported": ["ES256", "EdDSA"] } } } }}錯誤
404 Not Found— 租戶不存在。
另見: 探索憑證類型
GET /:tenant — 租戶登陸頁面
回傳租戶憑證發行方的人類可讀 HTML 頁面。適用於開發者驗證和除錯 — 確認租戶已設定,並提供指向發行方元資料端點的連結。
驗證: 公開 · Content-Type: N/A(GET,回傳 HTML)
路徑參數
tenant(required, string)— 租戶識別符,例如turing。
Response 200 — 含發行方識別符、元資料端點 URL 和除錯連結的 HTML 頁面。
錯誤
404 Not Found— 租戶不存在。
另見: 前述 GET /.well-known/openid-credential-issuer/:tenant 區塊取得 issuer 元資料。
基礎 URL:https://verifier.turingspace.co
Verifier Service 實作 OID4VP 進行憑證驗證。驗證方客戶端建立授權請求,錢包取得已簽名的請求物件並提交 VP Token,客戶端輪詢驗證結果。
| 方法 | 路徑 | 說明 | 驗證 |
|---|---|---|---|
| POST | /v1/verifier/authorization-request | 建立 OID4VP 授權請求。請參閱步驟一:建立授權請求。 | API Key |
| GET | /v1/verifier/request/:requestUriId | 取得已簽名的 JAR 請求物件(錢包端點)。請參閱步驟二:解析請求 URI。 | 公開 |
| POST | /v1/verifier/presentation | 透過 direct_post 提交 VP Token 進行驗證。請參閱步驟六:提交回應。 | 公開 |
| GET | /v1/verifier/result/:sessionId | 查詢驗證 session 狀態和結果。請參閱步驟三:輪詢結果。 | API Key |
POST /v1/verifier/authorization-request — 建立 OID4VP 授權請求
建立驗證 session 並回傳已簽名的 JAR request_uri,驗證方客戶端將其編碼為 QR code 或 deep link(openid4vp://)。錢包掃描此 URI、取得已簽名的請求物件,並提交 VP Token。
驗證: API Key · Content-Type: application/json
請求參數
dcql_query(required, object)— 指定所需憑證的 DCQL 查詢:credentials(required, array)— 一個或多個憑證查詢物件:id(required, string)— 查詢識別符,例如identity_credential。format(required, string)— 憑證格式,例如dc+sd-jwt。meta(required, object)— 格式特定的元資料:vct_values(optional, array of strings)—dc+sd-jwt格式允許的 VCT URI。
claims(optional, array)— 請求的聲明,帶有path(JSON pointer 陣列)和可選的values。multiple(optional, boolean)— 允許多個匹配憑證(預設false)。require_cryptographic_holder_binding(optional, boolean, 預設true)— 要求 Key Binding JWT。trusted_authorities(optional, array)— 可信任的發行方清單:[{"type": "did", "values": ["did:..."]}]。
verifier_private_key(required, string)— Base64url 編碼的 Ed25519 私鑰(32 bytes),用於 JAR 簽章。verifier_client_id(required, string)— 驗證方 DID 或 URL,例如did:example:verifier123。response_mode(optional, string)—direct_post(預設)或direct_post.jwt(加密)。client_metadata(optional, object)— 錢包 UI 的顯示資訊:client_name、logo_uri、policy_uri、tos_uri。redirect_uri(optional, URL)— 同裝置流程的驗證方回呼;提交後接收?session_id=...。expires_in(optional, integer, 60–3600)— Session 有效期(秒),預設 300。
Response 201
{ "session_id": "sess_1a2b3c4d5e", "request_uri": "https://verifier.turingspace.co/v1/verifier/request/req_xyz789", "authorization_request": "openid4vp://?client_id=did%3Aexample%3Averifier123&request_uri=https%3A%2F%2Fverifier.turingspace.co%2Fv1%2Fverifier%2Frequest%2Freq_xyz789", "expires_at": "2025-12-31T10:15:00Z"}錯誤
400 Bad Request— DCQL 查詢缺少或無效;credentials陣列為空。401 Unauthorized— 缺少或無效的 API Key。
另見: Verifier — 驗證憑證
GET /v1/verifier/request/:requestUriId — 取得已簽名的 JAR 請求物件(錢包端點)
回傳給定請求 URI ID 的已簽名 JWT Authorization Request(JAR)。錢包在解析 openid4vp:// deep link 中的 request_uri 後呼叫此 URL。回應是由驗證方私鑰簽名的 compact JWT。
驗證: 公開 · Content-Type: N/A(GET)
路徑參數
requestUriId(required, string)— 來自authorization_request回應的請求 URI ID。
Response 200 — JWT 字串(Content-Type:application/oauth-authz-req+jwt)。解碼後的 payload 包含:
{ "iss": "did:example:verifier123", "aud": "https://self-issued.me/v2", "client_id": "https://verifier.turingspace.co", "response_type": "vp_token", "response_mode": "direct_post", "response_uri": "https://verifier.turingspace.co/v1/verifier/presentation", "dcql_query": { "credentials": [ { "id": "identity_credential", "format": "dc+sd-jwt", "meta": { "vct_values": ["https://schema-registry.turingspace.co/IdentityCredential/v1"] }, "claims": [{ "path": ["family_name"] }] } ] }, "nonce": "550e8400-e29b-41d4-a716-446655440000", "state": "660e8400-e29b-41d4-a716-446655440001", "iat": 1735552800, "exp": 1735553100}錯誤
404 Not Found— 請求 URI ID 不存在或已過期。
另見: 錢包協議 — 解析請求 URI
POST /v1/verifier/presentation — 提交 VP Token(錢包端點)
透過 direct_post(或加密的 direct_post.jwt)接收錢包的 VP Token 提交。對 DCQL 查詢驗證 SD-JWT VC presentation,並將結果記錄在 session 中。
驗證: 公開 · Content-Type: application/x-www-form-urlencoded
請求參數
vp_token(conditional, string)— VP Token JSON 物件,將憑證查詢 ID 映射到 SD-JWT presentation 陣列,例如{"identity_credential":["eyJhbGciOiJFUzI1NiIs..."]}。direct_post模式必填。state(required, string)— 來自 JAR 請求物件的 session state。response(conditional, string)— 包含vp_token的加密 JWE。direct_post.jwt模式必填。presentation_submission(optional, string)— DIF Presentation Exchange descriptor map JSON。verification_mode(optional, string)—fail_fast(遇第一個失敗即停止)或run_all(執行所有檢查)。預設:fail_fast。
Response 200
{ "redirect_uri": "https://verifier-client.example.com/callback?session_id=660e8400-e29b-41d4-a716-446655440001"}redirect_uri 僅在驗證方於 session 建立時提供 redirect_uri 時存在。session_id 查詢參數與 POST /v1/verifier/authorization-request 中的 session UUID 一致。
錯誤
400 Bad Request— 缺少state、vp_token/response均缺少,或 session 不存在/已過期(invalid_request)。
另見: 錢包協議 — 提交回應
GET /v1/verifier/result/:sessionId — 查詢驗證結果
輪詢驗證 session 狀態。錢包尚未提交 VP Token 時狀態為 pending;提交並處理後轉換為 completed 或 failed。已過期的 session 回傳 expired。
驗證: API Key · Content-Type: N/A(GET)
路徑參數
sessionId(required, string)— 來自POST /v1/verifier/authorization-request的 session ID。
Response 200
{ "session_id": "sess_1a2b3c4d5e", "status": "completed", "created_at": "2025-12-31T10:00:00Z", "expires_at": "2025-12-31T10:05:00Z", "verified_at": "2025-12-31T10:01:30Z", "verification_mode": "fail_fast", "check_results": [ { "check": "credential_format", "status": "success", "reason_code": "credential_format_valid", "message": "Credential format is valid" } ], "presentation_metadata": { "claims": { "family_name": "Doe", "given_name": "Jane" }, "credential_metadata": [ { "issuer": "did:iota:0x1234...", "credential_type": ["VerifiableCredential", "IdentityCredential"], "issued_at": "2025-01-01T00:00:00Z", "expires_at": "2026-01-01T00:00:00Z" } ] }}status 值:pending | in_progress | completed | failed | expired。presentation_metadata 僅在 status=completed 時存在。error 物件(含 code 和 message)僅在 status=expired 時存在。
錯誤
401 Unauthorized— 缺少或無效的 API Key。404 Not Found— Session 不存在。
另見: Verifier — 輪詢結果
基礎 URL:https://holder.turingspace.co
Holder Service 提供保管錢包,含使用者帳號管理、DID 操作、憑證儲存,以及 OID4VCI/OID4VP 客戶端功能。
| 方法 | 路徑 | 說明 | 驗證 |
|---|---|---|---|
| POST | /v1/user/register | 註冊新的持有者帳號。請參閱註冊終端使用者。 | 公開 |
| POST | /v1/user/login | 身份驗證並取得 JWT access token。請參閱使用者登入。 | 公開 |
POST /v1/user/register — 註冊新的持有者帳號
建立新的保管錢包帳號。回傳使用者必須儲存的 UUID — 登入時需要用到。
驗證: 公開 · Content-Type: application/json
請求參數
password(required, string, min 8 chars)— 帳號密碼,例如SecureP@ss123。name(optional, string, max 100 chars)— 顯示名稱,例如John Doe。
Response 201
{ "uuid": "550e8400-e29b-41d4-a716-446655440000", "name": "John Doe", "created_at": "2026-01-28T10:00:00.000Z"}錯誤
400 Bad Request— 密碼過短。
另見: Holder — 管理錢包
POST /v1/user/login — 驗證身份並取得 JWT
以 UUID 和密碼驗證身份,並回傳用於後續請求的 Bearer JWT。
驗證: 公開 · Content-Type: application/json
請求參數
uuid(required, UUID v4)— 來自註冊的使用者 UUID,例如550e8400-e29b-41d4-a716-446655440000。password(required, string)— 帳號密碼。
Response 200
{ "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "token_type": "Bearer", "expires_in": 86400, "user": { "uuid": "550e8400-e29b-41d4-a716-446655440000", "name": "John Doe" }}錯誤
400 Bad Request— UUID 格式無效。401 Unauthorized— UUID 或密碼錯誤。
另見: Holder — 使用者登入
| 方法 | 路徑 | 說明 | 驗證 |
|---|---|---|---|
| GET | /v1/vc | 列出已驗證持有者的所有憑證。請參閱列出使用者的憑證。 | Bearer JWT |
| GET | /v1/vc/:id | 取得憑證詳情,包含聲明和原始 SD-JWT。請參閱取得單一憑證。 | Bearer JWT |
| DELETE | /v1/vc/:id | 軟刪除憑證。請參閱刪除憑證。 | Bearer JWT |
GET /v1/vc — 列出憑證
回傳已驗證持有者所有儲存的憑證。
驗證: Bearer JWT · Content-Type: N/A(GET)
Response 200
{ "credentials": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "vct": "https://credentials.example.com/identity", "issuer_did": "did:iota:testnet:0x1234567890abcdef...", "holder_did": "did:iota:testnet:0x5678901234abcdef...", "issued_at": "2026-02-03T10:00:00.000Z", "expires_at": "2027-02-03T10:00:00.000Z", "status": "active", "created_at": "2026-02-03T10:00:00.000Z" } ]}錯誤
401 Unauthorized— 缺少或無效的 JWT。
另見: Holder — 列出憑證
GET /v1/vc/:id — 取得憑證詳情
回傳完整憑證詳情,包含解碼後的聲明物件和原始 SD-JWT 字串。
驗證: Bearer JWT · Content-Type: N/A(GET)
路徑參數
id(required, UUID)— 憑證 ID。
Response 200
{ "id": "550e8400-e29b-41d4-a716-446655440000", "vct": "https://credentials.example.com/identity", "issuer_did": "did:iota:testnet:0x1234...", "holder_did": "did:iota:testnet:0x5678...", "issued_at": "2026-02-03T10:00:00.000Z", "expires_at": "2027-02-03T10:00:00.000Z", "status": "active", "created_at": "2026-02-03T10:00:00.000Z", "claims": { "name": "John Doe", "degree": "Bachelor of Science" }, "raw_credential": "eyJ...", "reference": { "block_chain": "IOTA", "object_id": "0x1234567890abcdef..." }}reference 僅對鏈上憑證存在。
錯誤
401 Unauthorized— 缺少或無效的 JWT。404 Not Found— 憑證不存在或屬於其他持有者。
另見: Holder — 取得單一憑證
DELETE /v1/vc/:id — 刪除憑證
從持有者錢包軟刪除憑證。原始 SD-JWT 不會被銷毀,但憑證將從活躍清單中移除。
驗證: Bearer JWT · Content-Type: N/A
路徑參數
id(required, UUID)— 憑證 ID。
Response 204 No Content — 無回應 body。
錯誤
401 Unauthorized— 缺少或無效的 JWT。404 Not Found— 憑證不存在或屬於其他持有者。
另見: Holder — 刪除憑證
DID 管理
Section titled “DID 管理”| 方法 | 路徑 | 說明 | 驗證 |
|---|---|---|---|
| POST | /v1/did | 建立新的 IOTA DID(私鑰僅回傳一次)。請參閱為使用者建立 DID。 | Bearer JWT |
| POST | /v1/did/import | 匯入含擁有權驗證的現有 IOTA DID。請參閱列出或刪除使用者的 DID。 | Bearer JWT |
| GET | /v1/did | 列出已驗證持有者的所有 DID。請參閱列出或刪除使用者的 DID。 | Bearer JWT |
| DELETE | /v1/did/:did | 刪除 DID(路徑中使用 URL 編碼的 DID URL)。請參閱列出或刪除使用者的 DID。 | Bearer JWT |
POST /v1/did — 建立新的 DID
在 IOTA 網路上建立新的 DID,並回傳 DID URL 和私鑰。私鑰僅回傳一次 — 持有者必須安全儲存。
驗證: Bearer JWT · Content-Type: application/json
請求參數
method(required, string)— DID 方法。目前支援IOTA。
Response 201
{ "did": "did:iota:testnet:0x7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b", "private_key": "nwKZ3iFzL7pZJK5pPJ-8k9vXcL2vL7pZJK5pPJ-8k9vXcL2vL7pZJK5pPJ-8k9vXcL2vL7pZJK"}private_key 僅回傳一次。 請立即儲存 — 沒有恢復途徑。
錯誤
401 Unauthorized— 缺少或無效的 JWT。400 Bad Request— 不支援的method值。
另見: Holder — 建立 DID
POST /v1/did/import — 匯入現有 DID
透過私鑰驗證擁有權,將現有 IOTA DID 與已驗證的持有者關聯。
驗證: Bearer JWT · Content-Type: application/json
請求參數
did(required, string)— IOTA DID URL,必須以did:iota:開頭,例如did:iota:testnet:0x7a8b9c...。private_key(required, string)— 用於擁有權驗證的 Base64url 編碼 Ed25519 私鑰。
Response 201
{ "did": "did:iota:testnet:0x7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b", "method": "IOTA", "status": "active"}錯誤
400 Bad Request— DID 不以did:iota:開頭,或私鑰驗證失敗。401 Unauthorized— 缺少或無效的 JWT。
另見: Holder — 管理 DID
GET /v1/did — 列出 DID
回傳已驗證持有者下所有已註冊的 DID。
驗證: Bearer JWT · Content-Type: N/A(GET)
Response 200
{ "dids": [ { "did": "did:iota:testnet:0x7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b", "method": "IOTA", "status": "active", "created_at": "2026-01-30T10:30:00.000Z" } ]}錯誤
401 Unauthorized— 缺少或無效的 JWT。
另見: Holder — 管理 DID
DELETE /v1/did/:did — 刪除 DID
從持有者錢包移除 DID。DID URL 必須在路徑參數中進行 URL 編碼。
驗證: Bearer JWT · Content-Type: N/A
路徑參數
did(required, string)— URL 編碼的 DID URL,例如did%3Aiota%3Atestnet%3A0x7a8b...。
Response 204 No Content — 無回應 body。
錯誤
401 Unauthorized— 缺少或無效的 JWT。404 Not Found— DID 不存在或屬於其他持有者。
另見: Holder — 管理 DID
OID4VCI 客戶端
Section titled “OID4VCI 客戶端”| 方法 | 路徑 | 說明 | 驗證 |
|---|---|---|---|
| POST | /v1/oid4vci/offer-details | 解析憑證 offer URI 並取得 offer 詳情。請參閱選用:預覽 offer。 | Bearer JWT |
| POST | /v1/oid4vci/receive | 執行 OID4VCI 流程以接收憑證。請參閱接受 offer。 | Bearer JWT |
POST /v1/oid4vci/offer-details — 預覽憑證 offer
解析 credential_offer_uri deep link、取得 OID4VCI offer 和發行方元資料,並回傳結構化的 offer 詳情,供持有者在接受前審閱。
驗證: Bearer JWT · Content-Type: application/json
請求參數
credential_offer_uri(required, string)—openid-credential-offer://deep link,例如openid-credential-offer://?credential_offer_uri=https://issuer.example.com/v1/offers/abc123。
Response 200
{ "issuer": "https://issuer.turingspace.co/turing", "issuer_name": "Turing Space", "issuer_logo_uri": "https://issuer.turingspace.co/logo.png", "credential_configurations": [ { "id": "UniversityDegree", "format": "dc+sd-jwt", "vct": "https://schema-registry.turingspace.co/UniversityDegree/v1.0", "display": { "name": "University Degree", "locale": "en" } } ], "pre_authorized_code_grant": { "pre_authorized_code": "oaKazRN8I0IbtZ0C7JuMn5", "user_pin_required": false }, "expires_at": "2024-12-31T12:00:00.000Z"}錯誤
400 Bad Request— 無效或已過期的 offer URI。401 Unauthorized— 缺少或無效的 JWT。
POST /v1/oid4vci/receive — 執行 OID4VCI 以接收憑證
代表持有者執行完整的 OID4VCI 發行流程:解析 offer、以預授權碼換取 token、取得 c_nonce、產生 proof of possession、請求憑證並儲存。
驗證: Bearer JWT · Content-Type: application/json
請求參數
credential_offer_uri(required, string)—openid-credential-offer://deep link。holder_did(required, string)— 用於金鑰綁定的持有者 DID URL,例如did:iota:testnet:0x5678...。private_key(required, string)— Base64url 編碼的持有者私鑰。did:iota使用 Ed25519;did:key使用 ES256 P-256 rawd。credential_configuration_id(optional, string)— 當 offer 包含多個設定時,選擇特定設定。user_pin(optional, string)— 若發行方要求交易碼時提供。notarize_on_iota(optional, boolean, 預設true)— 在 IOTA 上發布 JWT payload 進行鏈上公證。
Response 201
{ "credential_id": "550e8400-e29b-41d4-a716-446655440000", "vct": "https://schema-registry.turingspace.co/UniversityDegree/v1.0", "issuer_did": "did:iota:issuer-ntu-001", "holder_did": "did:iota:testnet:0x5678...", "raw_credential": "eyJhbGciOiJFZERTQSIsInR5cCI6InZjK3NkLWp3dCJ9...", "issued_at": "2026-02-03T10:00:00.000Z", "expires_at": "2027-02-03T10:00:00.000Z", "status": "active"}錯誤
400 Bad Request— offer 無效、預授權碼已過期,或 proof 驗證失敗。401 Unauthorized— 缺少或無效的 JWT。
OID4VP 客戶端
Section titled “OID4VP 客戶端”| 方法 | 路徑 | 說明 | 驗證 |
|---|---|---|---|
| POST | /v1/oid4vp/request-details | 解析 OID4VP 授權請求 URI、取得並驗證請求物件、比對憑證。請參閱解析驗證方的請求。 | Bearer JWT |
| POST | /v1/oid4vp/presentation | 建立並提交含選擇性揭露和 Key Binding JWT 的 VP Token。請參閱提交簡報。 | Bearer JWT |
POST /v1/oid4vp/request-details — 解析 OID4VP 授權請求
解析 openid4vp:// URI、取得並驗證已簽名的 JAR 請求物件,並對持有者儲存的憑證比對 DCQL 憑證查詢。回傳解析後的請求詳情和匹配憑證清單。
驗證: Bearer JWT · Content-Type: application/json
請求參數
authorization_request_uri(required, string)—openid4vp://deep link,例如openid4vp://?client_id=did:iota:testnet:0x1234...&request_uri=https://verifier.example.com/v1/verifier/request/abc123。
Response 200
{ "client_id": "did:example:verifier123", "client_metadata": { "client_name": "Example Service", "logo_uri": "https://example.com/logo.png" }, "dcql_query": { "credentials": [ { "id": "identity_credential", "format": "dc+sd-jwt", "meta": { "vct_values": ["https://schema-registry.turingspace.co/IdentityCredential/v1"] }, "claims": [{ "path": ["family_name"] }] } ] }, "matching_credentials": [ { "credential_id": "550e8400-e29b-41d4-a716-446655440000", "query_id": "identity_credential", "vct": "https://schema-registry.turingspace.co/IdentityCredential/v1", "claims": { "family_name": "Doe", "given_name": "Jane" } } ], "nonce": "550e8400-e29b-41d4-a716-446655440000", "state": "660e8400-e29b-41d4-a716-446655440001", "response_mode": "direct_post", "response_uri": "https://verifier.turingspace.co/v1/verifier/presentation", "expires_at": "2025-12-31T10:05:00Z"}錯誤
400 Bad Request— 無效或已過期的請求 URI、JAR 簽章驗證失敗。401 Unauthorized— 缺少或無效的 JWT。
POST /v1/oid4vp/presentation — 提交 VP Token 簡報
為選定的憑證建立含選擇性揭露和 Key Binding JWT 的 VP Token,然後透過 direct_post 提交至驗證方的 response_uri。
驗證: Bearer JWT · Content-Type: application/json
請求參數
authorization_request_uri(required, string)— 在request-details中使用的相同openid4vp://URI。selected_credentials(required, array)— 要出示的憑證:credential_id(required, UUID)— 來自持有者儲存的 ID。query_id(required, string)— 此憑證所滿足的 DCQL 憑證查詢 ID。disclosed_claims(optional, array of strings)— 要選擇性揭露的聲明名稱。若省略,則揭露所有聲明。
holder_did(required, string)— 用於 Key Binding JWT 簽章的持有者 DID URL。private_key(required, string)— Base64url 編碼的持有者私鑰。did:iota使用 Ed25519;did:key使用 ES256 P-256 rawd或 PEM。
Response 200
{ "success": true, "redirect_uri": "https://verifier-client.example.com/callback?session_id=660e8400-e29b-41d4-a716-446655440001"}redirect_uri 僅在驗證方於 session 建立時提供時存在。
錯誤
400 Bad Request— 無匹配憑證、session 已過期,或 Key Binding JWT 簽章失敗。401 Unauthorized— 缺少或無效的 JWT。
另見: Holder — 提交簡報
基礎 URL:https://trust-registry.turingspace.co
Trust Registry 管理組織 onboarding、DID 建立,以及網域連結的 DID Configuration Resources。
| 方法 | 路徑 | 說明 | 驗證 |
|---|---|---|---|
| POST | /v1/auth/login | 以 UUID 和密碼驗證身份取得 JWT token。請參閱步驟二:登入。 | 公開 |
| POST | /v1/did | 為已驗證的組織建立 IOTA DID。請參閱步驟三:建立 DID。 | Bearer JWT |
| POST | /v1/did/import | 匯入含擁有權驗證的現有 IOTA DID。請參閱步驟四:匯入現有 DID。 | Bearer JWT |
| GET | /.well-known/did-configuration.json/:tenant | DIF Well-Known DID Configuration Resource,用於網域連結驗證。請參閱 DID Configuration。 | 公開 |
POST /v1/auth/login — 以 Trust Registry 組織身份驗證
以指定的 UUID 和密碼驗證已核准的組織。回傳用於後續 DID 管理操作的 Bearer JWT。
驗證: 公開 · Content-Type: application/json
請求參數
uuid(required, UUID v4)— TCS 指派的組織 UUID,例如a1b2c3d4-e5f6-7890-abcd-ef1234567890。password(required, string, min 8 chars)— 必須至少包含一個大寫字母、一個小寫字母和一個數字,例如Password123。
Response 200
{ "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "expires_in": 3600}錯誤
400 Bad Request— UUID 格式無效或密碼不符合規範。401 Unauthorized— UUID 或密碼錯誤。
POST /v1/did — 為你的組織建立 IOTA DID
代表已驗證的組織建立新的 IOTA DID,並回傳 DID URL、金鑰 ID、公鑰 JWK 和私鑰。私鑰僅回傳一次。
驗證: Bearer JWT · Content-Type: application/json(接受空 body)
Response 201
{ "did": "did:iota:0x1234567890abcdef...", "key_id": "did:iota:0x1234567890abcdef...#abc123", "public_key_jwk": { "kty": "OKP", "use": "sig", "key_ops": ["sign", "verify"], "alg": "EdDSA", "kid": "abc123", "crv": "Ed25519", "x": "abc123..." }, "private_key": "abc123..."}private_key 僅回傳一次。 請立即儲存。
錯誤
401 Unauthorized— 缺少或無效的 JWT。
POST /v1/did/import — 匯入現有 IOTA DID
透過私鑰擁有權驗證,將現有 IOTA DID 與已驗證的組織關聯。
驗證: Bearer JWT · Content-Type: application/json
請求參數
did(required, string)— IOTA DID URL,必須以did:iota:開頭,例如did:iota:testnet:0x7a8b9c...。private_key(required, string)— 用於擁有權驗證的 Base64url 編碼 Ed25519 私鑰。
Response 201
{ "did": "did:iota:testnet:0x7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b", "method": "IOTA", "status": "active"}錯誤
400 Bad Request— DID 不以did:iota:開頭,或私鑰驗證失敗。401 Unauthorized— 缺少或無效的 JWT。
GET /.well-known/did-configuration.json/:tenant — DIF Well-Known DID Configuration Resource
回傳指定租戶的 DIF Well-Known DID Configuration Resource。網域連結驗證方取得此文件,以確認網域由 DID 擁有者控制。回應包含 linked_dids 陣列,內含網域連結憑證 JWT。
驗證: 公開 · Content-Type: N/A(GET)
路徑參數
tenant(required, string)— 租戶識別符,例如turing。
Response 200
{ "@context": "https://identity.foundation/.well-known/did-configuration/v1", "linked_dids": [ "eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDppb3RhOjB4MTIzNC4uLiNrZXktMSJ9..." ]}linked_dids 中的每個條目都是已簽名的 Domain Linkage Credential JWT,將租戶的 DID 綁定至此網域。
錯誤 — 無預期錯誤。若租戶沒有已註冊的 DID,linked_dids 為空陣列(非 404)。
基礎 URL:https://schema-registry.turingspace.co
Schema Registry 提供 VCT(Verifiable Credential Type)元資料文件,供錢包和驗證方探索憑證類型資訊。
| 方法 | 路徑 | 說明 | 驗證 |
|---|---|---|---|
| GET | /schemas | 列出所有 VCT schema(paginated)。請參閱探索憑證類型。 | 公開 |
| GET | /schemas/:type/:version | 指定憑證類型與版本的 VCT Type Metadata Document(SD-JWT VC VCT)。請參閱探索憑證類型。 | 公開 |
| GET | /v1/schemas/:type/:version | 取得 VCT Type Metadata Document(已棄用 — 重新導向至無版本路徑) | 公開 |
GET /schemas — 列出 VCT schema(paginated)
回傳所有已發布 VCT schema 的分頁清單。支援依狀態、類型名稱和顯示名稱篩選。
驗證: 公開 · Content-Type: N/A(GET)
查詢參數
status(optional, string)— 依生命週期狀態篩選,例如active。type(optional, string)— 憑證類型的部分不區分大小寫比對,例如University。name(optional, string)— 顯示名稱的部分不區分大小寫比對,例如University Degree。sort_by(optional, string)—updated_at(預設)或created_at。offset(optional, integer)— 要跳過的記錄數(預設 0)。limit(optional, integer)— 最多回傳的記錄數。
Response 200
{ "data": [ { "name": "University Degree", "type": "UniversityDegree", "version": "v1", "status": "active", "updated_at": "2026-01-15T08:00:00.000Z" } ], "meta": { "offset": 0, "limit": 20, "total": 28 }}錯誤 — 正常操作下不預期有錯誤。
GET /schemas/:type/:version — VCT Type Metadata Document
回傳給定憑證類型和版本的 SD-JWT VC Type Metadata Document。錢包和驗證方從發行憑證的 vct 聲明中找到此 URL,並取得以進行 schema 驗證和顯示元資料。
驗證: 公開 · Content-Type: N/A(GET)
路徑參數
type(required, string)— 憑證類型識別符,例如UniversityDegree。version(required, string)— Schema 版本,例如v1。
Response 200
{ "vct": "https://schema-registry.turingspace.co/schemas/UniversityDegree/v1", "name": "University Degree", "description": "A credential issued by a university upon degree completion.", "schema": { "type": "object", "properties": { "degree": { "type": "string" }, "major": { "type": "string" } } }, "status": "active", "use_case": ["professional_qualification", "corporate_compliance"], "updated_at": "2026-01-15T08:00:00.000Z"}錯誤
404 Not Found— VCT 類型或版本不存在。
GET /v1/schemas/:type/:version — VCT Type Metadata Document(已棄用)
GET /schemas/:type/:version 的已棄用別名。回傳 HTTP 重新導向(302)至標準的無版本路徑。請直接使用 GET /schemas/:type/:version。
驗證: 公開 · Content-Type: N/A(GET)
Response 302 — 無條件重新導向至 /schemas/:type/:version(不檢查是否存在)。
錯誤 — 無。重新導向無論 schema 是否存在都會觸發;若重新導向目標不存在,則可能出現 404。
另見: 前述 GET /schemas/:type/:version 區塊(建議的非棄用端點)。