Mistakes
That guide describes the error code that can return APIs of JAAKand recommendations for their resolution.
Error response format
All error responses follow the same JSON format:
{
"error": {
"code": "invalid_token",
"message": "The token's expired",
"status": 401,
"details": {
"expiredAt": "2024-01-15T10:30:00Z"
}
}
}
| Field | Description |
|---|---|
| code | Unique error code to identify problem |
| message | Legible description of error |
| status | HTTP status code |
| details | Additional information specific to error (optional) |
HTTP status code
400 Bad Request
The request contains syntax errors or invalid parameters.
{
"error": {
"code": "invalid_request",
"message": "The email field is required",
"status": 400,
"details": {
"field": "email",
"reason": "required"
}
}
}
solution:
- Check that all required fields are present
- Check that data types are correct (string, number, etc.)
- Check that values are valid (email, URL, date) ISO 8601)
401 Unauthorized
The credentials are invalid or have been insufficient.
{
"error": {
"code": "invalid_credentials",
"message": "API Key or API Invalid secret",
"status": 401
}
}
solution:
- Check that you're sending the right authentication headquarters
- Check that the credentials are right for the environment (sandbox vs. production)
- Check that tokens haven't expired.
403 Forbidden
You have no permission to have access to the requested remedy.
{
"error": {
"code": "forbidden",
"message": "You have no permission to gain access to this remedy",
"status": 403
}
}
solution:
- Check that your plan includes access to this functionality
- Check that the user has the necessary permission
- Contact support if you think you should have access
404 Not Found
The requested remedy does not exist.
{
"error": {
"code": "not_found",
"message": "Unfound meeting",
"status": 404,
"details": {
"resourceType": "session",
"resourceId": "ses_abc123xyz"
}
}
}
solution:
- Check that the remedy's ID is correct
- Check that the remedy exists in the right environment
- The remedy may have been removed or expired
422 Unprocessor Entity
The request is valid but cannot be processed due to business rules.
{
"error": {
"code": "session_already_completed",
"message": "The sitting was completed and cannot be altered.",
"status": 422,
"details": {
"sessionId": "ses_abc123xyz",
"status": "completed"
}
}
}
solution:
- Check the current status of the remedy before trying to amend it
- Check documentation to understand valid status transitions
429 Too Many Requests
You have exceeded the limit of permitted applications.
{
"error": {
"code": "rate_limit_exceeded",
"message": "You have exceeded the demand limit. Try again in 60 seconds",
"status": 429,
"details": {
"retryAfter": 60,
"limit": 100,
"window": "1m"
}
}
}
solution:
- Implement exponential backoff into your code
- Backup the head
Retry-Afterin response - Consider packing responses as soon as possible
- Contact support if you need a bigger limit
500 Internal Server Error
Internal server error.
{
"error": {
"code": "internal_error",
"message": "That's an internal mistake.",
"status": 500,
"details": {
"requestId": "req_xyz789"
}
}
}
solution:
- Retry after a few seconds
- If the error persists, contact support with the
requestId
Request ID
All responses include a Leader X-Request-Id. Enter them by contacting support so we can quickly identify your request.
Specific error codes
Authentication errors
| Code | Description | Resolution |
|---|---|---|
invalid_api_key | API Unvalid key | He verifies that API Key's right. |
invalid_api_secret | API Invalid secret | Check that API Secret be correct |
invalid_token | Token JWT invalid | get a new token with sign-in |
token_expired | Token JWT expired | Use the refresh token to renew |
refresh_token_expired | Refresh token expired | Relogin |
credentials_mismatch | Credentials do not coincide with the environment | Use sandbox or production credentials as appropriate |
Verification errors (KYC)
| Code | Description | Resolution |
|---|---|---|
session_not_found | Unfound meeting | Check Session ID |
session_expired | The sitting has been closed. | Create a new session |
session_already_completed | The session has been completed | Check the result with PET / sessions /{d} |
session_cancelled | The session was cancelled | Create a new session if necessary |
invalid_verification_type | Unvalid type of verification | Use one of: kyc _ full, survival _ only, face _ match, document _ only, document _ validation |
document_type_not_supported | Unsupported document type | Check the permitted document types |
ine_validation_unavailable | Validation with INE Not available | Service temporarily unavailable, try later |
Signature errors (Signa)
| Code | Description | Resolution |
|---|---|---|
template_not_found | Unfound | Check the template ID |
template_invalid | The template has mistakes | Check the template settings at dashboard |
submission_not_found | Unfound sending | Check the sending ID |
submission_cancelled | The dispatch was cancelled | The document cannot be signed |
signer_not_found | Unfound sign | Check the sign's ID or email |
signature_already_completed | The sign signed | Can't sign twice |
invalid_signature_type | Unvalid signature type | Use one of: simple, electronic _ advanced, electronic _ quantified |
pdf_processing_error | Failed to process PDF | Check that the PDF is valid and isn't corrupt |
Validation errors
| Code | Description | Resolution |
|---|---|---|
field_required | Required area missing | includes all required fields |
field_invalid | Field with invalid format | Check the field format |
field_too_long | Field beyond border | Reduces value length |
field_too_short | Very short field | Increase Value Length |
invalid_email | Email with invalid format | Use valid email |
invalid_url | Invalid URL | Include protocol (https: / /) |
invalid_date | Invalid date | Use format ISO 8601 |
invalid_json | JSON malformed | Valid JSON before sending |
Rate Limiting
The APIs of JAAK they implement demand limits to ensure service stability.
Default limits
| Plan | Requests per minute | Requests per hour |
|---|---|---|
| Sandbox | 60 | 1,000 |
| Starter | 100 | 5,000 |
| Business | 500 | 25,000 |
| Enterprise | Custom | Custom |
Points limit heads
Each response includes leaders with border information:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1705315200
| Leader | Description |
|---|---|
| X-RateLimited-Libit | Loan of applications by window |
| X-RateLimited-Remaining | Requests remaining in the current window |
| X-RateLimited -Reset | Timespamp Unix after Reboot |
Status limitation management
Implement exponential backoff when you get an error 429:
async function apiCallWithRetry(fn, maxRetries = 3) {
for (let attempt = 0; attempt < maxRetries; attempt++) {
try {
return await fn();
} catch (error) {
if (error.status === 429 && attempt < maxRetries - 1) {
const retryAfter = error.details?.retryAfter || Math.pow(2, attempt);
console.log(`Rate limited. Esperando ${retryAfter} segundos...`);
await sleep(retryAfter * 1000);
} else {
throw error;
}
}
}
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
Optimize your applications
To reduce the number of applications:
- Using webhooks instead of polling
- Skip responses where possible
- Stretch operations at API Let him.
Identification checks errors
These errors occur during the verification process and are reported in the result of the session.
document errors
| Code | Description | Recommendation |
|---|---|---|
DOCUMENT_NOT_READABLE | Can't read document | Ask the user to take a more clear photo |
DOCUMENT_EXPIRED | The document's up | Requests users to use an existing document |
DOCUMENT_ALTERED | Reactions were found | Possible fraud, manually check |
DOCUMENT_NOT_SUPPORTED | Unsupported document type | Indicates accepted document types |
DOCUMENT_WRONG_COUNTRY | Unsupported country document | Mexican document only accepted |
DOCUMENT_PHOTO_MISSING | No photo found in document | Check to be the front of the document |
Life errors
| Code | Description | Recommendation |
|---|---|---|
LIVENESS_FAILED | Liveness detection Failed | Can be an attempt at fraud or bad light |
SPOOF_DETECTED | Suplantation attempt detected | Possible photo or video fraud |
FACE_NOT_DETECTED | No face was found | Ask the user to focus his face |
MULTIPLE_FACES | Multiple faces were detected | Only one person should be in the image |
FACE_TOO_SMALL | A very small face in the image | Requests the user to come closer |
POOR_LIGHTING | Inadequate light | Call for better light |
face match errors
| Code | Description | Recommendation |
|---|---|---|
FACE_MISMATCH | The face doesn't match the document | Possible fraud or document of another person |
LOW_CONFIDENCE | Low confidence in coincidence | Consider manual review |
SELFIE_QUALITY_LOW | Insufficient selfie quality | Ask for a better photo |
DOCUMENT_PHOTO_QUALITY_LOW | photo quality of low document | Requests better photo of document |
Validation errors INE
| Code | Description | Recommendation |
|---|---|---|
INE_NOT_FOUND | INE Not found at best | Check that data are correct |
INE_CANCELLED | INE cancelled or reported | The document is invalid |
INE_EXPIRED | INE earned by the best man | The document is invalid |
INE_SERVICE_UNAVAILABLE | Service INE Not available | Try later |
Mapping your code
Full example
class JAAKError extends Error {
constructor(response) {
super(response.error.message);
this.code = response.error.code;
this.status = response.error.status;
this.details = response.error.details;
}
}
async function callJAAKAPI(endpoint, options) {
const response = await fetch(`https://api.jaak.ai${endpoint}`, {
...options,
headers: {
'Content-Type': 'application/json',
'X-API-Key': API_KEY,
'X-API-Secret': API_SECRET,
...options.headers
}
});
const data = await response.json();
if (!response.ok) {
throw new JAAKError(data);
}
return data;
}
// Using with bug management
async function createSession(verificationType) {
try {
const session = await callJAAKAPI('/api/v1/sessions', {
method: 'POST',
body: JSON.stringify({ verificationType })
});
return session;
} catch (error) {
if (error instanceof JAAKError) {
switch (error.code) {
case 'rate_limit_exceeded':
console.log('Just waiting before we get back to it...');
await sleep(error.details.retryAfter * 1000);
return createSession(verificationType);
case 'invalid_credentials':
console.error('Invalid credentials. Check your API Key and Secret.');
throw error;
case 'forbidden':
console.error('You have no access to this type of check.');
throw error;
default:
console.error(`Error de JAAK: ${error.message} (${error.code})`);
throw error;
}
}
throw error;
}
}
Contact Support
If you find an error that you cannot solve:
- includes
Request-Idresponse head - Describe the steps to play the bug
- Includes error code and complete message
- indicates the environment (sandbox or production)
Email: support
Support schedule
Our support team is available Monday through Friday, 9:00 to 18:00 (Mexico City time). For emergencies outside business hours, contact your account executive.