技能 编程开发 解决Persona API常见错误

解决Persona API常见错误

v20260423
persona-common-errors
本指南提供了解决与Persona身份验证API交互时常见错误代码的完整解决方案。内容涵盖了401未授权密钥、422模板错误、Webhook签名不匹配、429速率限制等关键技术问题。适用于身份验证流程调试和优化,确保系统稳定运行。
获取技能
73 次下载
概览

persona common errors | sed 's/\b\(.\)/\u\1/g'

Overview

401 invalid key, 422 invalid template, webhook HMAC mismatch, inquiry already completed, rate limit 429.

Prerequisites

  • Completed persona-install-auth setup
  • Valid Persona API key (sandbox or production)

Instructions

Error 1: 401 Unauthorized

{"errors":[{"status":"401","title":"Not Authorized"}]}

Fix: Verify API key starts with persona_sandbox_ or persona_production_. Check Authorization: Bearer <key> header format.

Error 2: 422 Invalid Inquiry Template

{"errors":[{"status":"422","title":"Invalid inquiry-template-id"}]}

Fix: Verify template ID format is itmpl_*. Templates are environment-specific (sandbox templates only work with sandbox keys).

Error 3: Webhook Signature Mismatch

HMAC verification failed — expected abc123, got def456

Fix: Ensure you're using the raw request body (not parsed JSON) for HMAC computation. Use express.raw() middleware.

Error 4: 429 Rate Limited

{"errors":[{"status":"429","title":"Rate limit exceeded"}]}

Fix: Implement exponential backoff. Check Retry-After header. See persona-rate-limits.

Error 5: Inquiry Already Completed

{"errors":[{"status":"409","title":"Inquiry is already in a terminal state"}]}

Fix: Check inquiry status before attempting operations. Use the resume endpoint only for created or pending inquiries.

Error 6: 404 Inquiry Not Found

{"errors":[{"status":"404","title":"Not Found"}]}

Fix: Verify inquiry ID format is inq_*. Sandbox inquiries are not accessible with production keys.

Output

  • Error identified from API response
  • Targeted fix applied
  • Verified resolution

Error Handling

HTTP CodeMeaningRetryable
400Bad requestNo
401Invalid API keyNo — fix key
404Resource not foundNo
409Conflict (terminal state)No
422Validation errorNo — fix request
429Rate limitedYes
500+Server errorYes

Resources

Next Steps

For debugging, see persona-debug-bundle.

信息
分类 编程开发
名称 persona-common-errors
版本 v20260423
大小 2.66KB
更新时间 2026-04-28
语言