API Error
My API key is returning '401 Unauthorized - Invalid token provided' when making parse requests to the InternationalIdV2 endpoint. The client initializes successfully and document creation works, but all parse calls fail with authorization errors. Anything I should Optimized? thanks
Log in to comment and vote
Comments18
Jonathan Grandperrin
Jun 25, 2025
Hi! Thanks for your feedback.
Can you give us more details about this API KEY error please? Where did it happen, on the API or on the user interface? We’ll fix it as soon as we understand the problem.
Bashir ABDEL WAHED
Jun 25, 2025
Hello, thank your request and sorry for your problem.
Can you provide more details ?
what language are you using to run your test ?
please provide the full code you used.
Arif ŞAHİN
Jun 27, 2025
Language Javascript, Nodejs.
This is the error:
"Error processing receipt:"
▶{stack: "Error: Failed to process receipt. Please try again. at MindeeService.processReceipt (https://zp1v56uxy8rdx5ypatb0ockcb9tr6a-oci3--5173--cb7c0bca.local-credentialless.webcontainer-api.io/src/utils/mindeeApi.ts:27:13) at async processReceipt (https://zp1v56uxy8rdx5ypatb0ockcb9tr6a-oci3--5173--cb7c0bca.local-credentialless.webcontainer-api.io/src/App.tsx:85:27) at async handleCropComplete (https://zp1v56uxy8rdx5ypatb0ockcb9tr6a-oci3--5173--cb7c0bca.local-credentialless.webcontainer-api.io/src/App.tsx:70:5)", message: "Failed to process receipt. Please try again.", name: "Error"}
at processReceipt (/src/App.tsx:89:15) at async handleCropComplete (/src/App.tsx:70:5)Arif ŞAHİN
Jun 27, 2025
Also have this:
"Error processing receipt:"
▶{stack: "Error: Mindee API error: 401 at MindeeService.processReceipt (https://zp1v56uxy8rdx5ypatb0ockcb9tr6a-oci3--5173--cb7c0bca.local-credentialless.webcontainer-api.io/src/utils/mindeeApi.ts?t=1751015756447:18:15) at async processReceipt (https://zp1v56uxy8rdx5ypatb0ockcb9tr6a-oci3--5173--cb7c0bca.local-credentialless.webcontainer-api.io/src/App.tsx?t=1751015756447:85:27) at async handleCropComplete (https://zp1v56uxy8rdx5ypatb0ockcb9tr6a-oci3--5173--cb7c0bca.local-credentialless.webcontainer-api.io/src/App.tsx?t=1751015756447:70:5)", message: "Mindee API error: 401 ", name: "Error"}
at processReceipt (/src/App.tsx?t=1751015756447:89:15) at async handleCropComplete (/src/App.tsx?t=17510157564Jonathan Grandperrin
Jun 30, 2025
Do you confirm the API Key you are using starts with
mk_ormd_and not some other value like a name or an ID?To make sure, you can find it by clicking the copy button here:
Bashir ABDEL WAHED
Jun 30, 2025
Thank you for your reply.
Can you please put the code you use here in the comments ?
Chloé Monnin
Jul 15, 2025
Hello,
Can you provide the code you used please ? You can also check below the previous answers for a similar issue.
thx
Romain Colineaux
Jul 15, 2025
Bonjour Chloé,
const mindee = require('mindee');
async function testMindeeAuthentication() {
const apiKey = 'md_l*********';
try {
// 1. Create client - this works fine
const client = new mindee.Client({ apiKey });
console.log('✅ Client created successfully');
// 2. Create document - this also works fine
const testImageBuffer = Buffer.from(/* small PNG data */);
const document = await client.docFromBuffer(testImageBuffer, "test.png");
console.log('✅ Document created successfully');
// 3. This line causes the 401 "Invalid token provided" error
const response = await client.parse(mindee.product.InternationalIdV2, document);
} catch (error) {
console.error('Error:', error.message); // "Authorization required"
console.error('Code:', error.code); // 401
console.error('Details:', error.details); // "Invalid token provided"
}
}
Romain Colineaux
Jul 15, 2025
I have now an 404 error…
Romain Colineaux
Jul 15, 2025
@Chloé Monnin let me know what I should do. thanks
Ianaré Sévi
Jul 16, 2025
We’re still in the process of adding v2 support to the Node.js client.
A RC version should be out in a couple days.
In the meantime, you can follow the instructions here:
https://docs.mindee.com/getting-started/integrating-mindee
Thanks