Idempotency Key Reused
idempotency-key-reused · 422
جاء الـ Idempotency-Key من قبل مع جسم طلب مختلف، فلم تكرر الـ API جوابا محفوظا ولم تشغل أي شيء.
كل الصفحات
الجواب المحفوظ يعاد فقط للجسم الذي حفظ لأجله، والعملية الجديدة لا تعمل أبدا تحت مفتاح قديم. والمفاتيح تحفظ 24 ساعة عادة.
إضافة إلى الحقول التي في كل خطأ، يضيف هذا النوع idempotencyKey، endpoint و errors.
- أعيد استعمال مفتاح للعملية التالية بدل إنشاء مفتاح جديد.
- غيرت إعادة المحاولة الجسم: اسم أنشئ من جديد، أو وقت جديد، أو حقل تغير محتواه.
- لكي تكرر العملية الأولى، أرسل جسمها كما هو تماما مع المفتاح نفسه. يعود الجواب المحفوظ ومعه
Idempotency-Replayed: true. - ولعملية جديدة، أنشئ مفتاحا جديدا.
- احفظ كل مفتاح مع جسمه، لكي لا تخلط إعادة المحاولة أحدهما بالآخر.
json
{
"type": "idempotency-key-reused",
"title": "Idempotency Key Reused",
"detail": "The Idempotency-Key '0199e0a3-6f21-7c4a-9d18-2b7c5f3ad401' was already used for a different request. Send a new key for a new operation, or resend the original payload to replay the stored response.",
"idempotencyKey": "0199e0a3-6f21-7c4a-9d18-2b7c5f3ad401",
"endpoint": "POST /v1/projects/:projectId/services",
"errors": [
{
"field": "Idempotency-Key",
"message": "already used with a different request payload",
"value": "0199e0a3-6f21-7c4a-9d18-2b7c5f3ad401"
}
],
"requestId": "req-1785231000000-4f7b2c9ae",
"timestamp": "2026-07-28T09:30:00.000Z",
"path": "/v1/projects/0199e0a3-6f21-7c4a-9d18-2b7c5f3ad401/services",
"method": "POST",
"instance": "POST /v1/projects/0199e0a3-6f21-7c4a-9d18-2b7c5f3ad401/services",
"status": 422,
"docs": "https://ghaym.me/docs/errors/idempotency-key-reused"
}