Download OpenAPI specification:Download
This is a sample of the Miralia.ai Documentation containing any necessary informations to post an analysis and get its result with the v2 API of Miralia.ai.
The Miralia.ai API is secured by a set of API Keys, and all your API requests must be made over HTTPS and must be authenticated with these API Keys.
The API keys will be provided by Miralia.ai. You will have two values: the "Secret Key" and the "App ID".
appId, so your URLs
will end with something like ?appId=<YOUR_APP_ID>.Authorization HTTP header.To use our API, you will need to create an analysis. Then, to retrieve the result, you can either do it the "push-based" way, with webhooks, or the "pull-based" way, with other HTTP REST calls.
You will need to send your message with the
/environment/{environmentId}/analyses endpoint. The
endpoint's documentation contains all details on how to send your message.
This is the preferred way of retrieving the result: we send the result as soon as possible, and we know when we delivered the result for sure.
If you choose to integrate with this way, we will integrate the webhook in our configuration. When the analysis will be done, Miralia.ai will do a HTTP POST request to an URL you defined. You can also define a pair of header name and value that we will send alongside the request, to protect your endpoint.
For more information on the webhook format, you will have more information on the
/analysis/{analysisId}/result endpoint.
By using the the /analysis/{analysisId}/result
endpoint, you will have the same output you would have received by webhook.
Create an analysis in the environment provided in the path.
An analysis is composed of multiple inputs. For each input, you must specify:
BODY (the main content)? An ATTACHMENT (a file)? Or
another type for more information? (TICKET_TOPIC for example)To specify the inputs, you have to build the inputs JSON array. Here is an example with
all kinds of inputs:
[
{
"type": "BODY",
"contentType": "file",
"file_key": "file_1"
},
// another possibility is to use a text input as the main content
// but you should have only one BODY input
{
"type": "BODY",
"contentType": "text",
"text": "Main content to analyse",
"name": "Main content" // This is optional, but recommended
},
// if you have attachments, you can specify them
{
"type": "ATTACHMENT",
"contentType": "file",
"file_key": "attachment_1"
},
{
"type": "ATTACHMENT",
"contentType": "file",
"file_key": "attachment_2"
},
// if you have more information that golem must analyse.
{
"type": "TICKET_TOPIC",
"contentType": "text",
"text": "Ticket topic",
"name": "TICKET_TOPIC" // This is optional, but recommended
}
]
This inputs array must be set in the payload field of the request. The request must be a
multipart/form-data request, and payload is mandatory to describe the analysis. It
contains a JSON object, with the inputs array, but also other fields, namely:
metadata: a JSON object containing the metadata of the analysis. Metadata are data you
might want to keep around on your analysis, for example to match it back to something on
your end when you receive the result by webhook.inbox metadata is special: if you have multiple "inboxes" for your messages, you
should set this field to the inbox of the message. It will open a lot of features in the
Miralia.ai console.name: a string containing the name of the analysis. This is optional, and by default is
set to the filename of the first BODY file. If that file has a non-descriptive name, you
should set this field.manualFinalStatusUpdate: a boolean indicating that the success or failure of the
analysis must be confirmed by an external automation. If you're not sure if you need it,
you don't need it.inputs: the array of inputs described above.| environmentId required | integer <int64> ID of the environment where the analysis must be created |
Content and settings for this analysis
| file | string <binary> |
| manualFinalStatusUpdate | boolean |
| metadata | object Metadata associated to the analysis. If you specify the |
| payload | string A JSON Object encoded as a string which defines how to create an API.
|
| files* additional property | string <binary> The files you want to upload. The name of the field in the request payload (e.g., |
{- "id": "7f8e8725-221d-4128-bdb4-c655d0884ca8"
}Get an analysis result according to a configured flow.
The result can be overridden by integrations, but unless explicitly told so, the result will contain the same payload sent to any webhook.
The payload is configured on Miralia.ai side. If the output misses some information you see here but is absent from the result, it might be a misconfiguration.
| analysisId required | string ID of the analysis |
The analysis has finished, the result contains the same data as the webhook payload.
{- "status": "FINISHED",
- "result": {
- "analysisId": "25e625ab-7d91-1234-8a4b-09f52c07ecb9",
- "filename": "mail-0123456.eml",
- "rpaActions": {
- "UploadDocuments": [
- "UploadBody",
- "UploadAttachments"
]
}, - "metadata": {
- "inbox": "support@example.com",
- "ticket_id": "123456"
}, - "categories": [
- "Convocation"
], - "attachmentsCategories": {
- "file.txt": [
- "Autre"
], - "factures_groupees | pages=[1-2].pdf": [
- "Facture"
], - "factures_groupees | pages=[3-4].pdf": [
- "Facture"
], - "CNI.pdf": [
- "CNI"
], - "CNI Recto.png": [
- "CNI recto"
], - "CNI Verso.png": [
- "CNI verso"
]
}, - "extractedData": {
- "message": {
- "date_rdv": {
- "jour": "24",
- "mois": "05",
- "annee": "2025"
}, - "heure_rdv": {
- "heure": "15",
- "minute": "00"
}, - "reference": "6754679"
}, - "attachments": {
- "factures_groupees | pages=[1-2].pdf": {
- "amount": "120.00"
}, - "factures_groupees | pages=[3-4].pdf": {
- "amount": "95.50"
}
}
}, - "fileOperations": [
- {
- "type": "merge",
- "id": "6f1a2ef4-2ac8-4b6b-9a4e-3e7c9f1b2b31",
- "filename": "CNI.pdf",
- "sources": [
- {
- "id": "1c9a2f52-1a3f-4e3a-8b9d-6b6a8b6a8b6a",
- "filename": "CNI Recto.png"
}, - {
- "id": "2d0b3f63-2b4f-5f4b-9c0e-7c7b9c7b9c7b",
- "filename": "CNI Verso.png"
}
]
}, - {
- "type": "split",
- "id": "3e1c4f74-3c5f-6a5c-ad1f-8d8c0d8c0d8c",
- "filename": "factures_groupees | pages=[1-2].pdf",
- "sources": [
- {
- "id": "9f8e7d6c-5b4a-3928-4938-0f0e0d0c0b0a",
- "filename": "factures_groupees.pdf"
}
]
}, - {
- "type": "split",
- "id": "4f2d5f85-4d6f-7b6d-be2f-9e9d1e9d1e9d",
- "filename": "factures_groupees | pages=[3-4].pdf",
- "sources": [
- {
- "id": "9f8e7d6c-5b4a-3928-4938-0f0e0d0c0b0a",
- "filename": "factures_groupees.pdf"
}
]
}
], - "messageHeader": {
- "From": "patient@example.com",
- "To": "support@example.com",
- "Subject": "Confirmation de rendez-vous",
- "Date": "Mon, 20 Jul 2026 10:00:00 +0000"
}, - "messageHTMLBodies": [
- "<!DOCTYPE html><html><body><p>Bonjour, je confirme mon rendez-vous.</p></body></html>"
], - "attachments": [
- {
- "name": "factures_groupees.pdf",
- "data": "JVBERi0xLjQKJc..."
}, - {
- "name": "factures_groupees | pages=[1-2].pdf",
- "data": "JVBERi0xLjQKJc..."
}, - {
- "name": "factures_groupees | pages=[3-4].pdf",
- "data": "JVBERi0xLjQKJc..."
}, - {
- "name": "CNI Recto.png",
- "data": "iVBORw0KGgoAAAANSUhEUg..."
}, - {
- "name": "CNI Verso.png",
- "data": "iVBORw0KGgoAAAANSUhEUg..."
}
], - "replyTemplate": "Bonjour,\n\nNous confirmons votre rendez-vous du 24/05/2025 à 15h00.\n\nCordialement\n"
}
}🚧 Coming soon — this endpoint is not yet available.
Download the raw content of a document belonging to an analysis.
fileId accepts any document identifier found in
fileOperations: both the id of a
fileOperations entry (the resulting split or merged document) and the id of any of
its sources (the original document(s) it was produced from) can be downloaded
individually this way.
| analysisId required | string ID of the analysis |
| fileId required | string <uuid> ID of the document to download, taken from |
No analysis matches this analysisId.
{- "code": 404,
- "message": "Analysis not found"
}This route allows a user to send feedback on an analysis (a correction). Only categories, attachmentsCategories, extractedData, and rpaActions can be corrected; other fields are ignored. Submit only the fields you want to correct — omitted fields are left unchanged. You can use feedbackURL in the result's payload to send a feedback on the analysis you queried.
| analysisId required | string |
object (feedback) Feedback / correction payload for Unlike the result payload, only a subset of fields can be corrected: | |||||||||
| |||||||||
{- "result": {
- "categories": [
- "Convocation"
], - "rpaActions": {
- "UploadBody": {
- "rpa_action_configurations": true,
- "rpa_action_executions": true
}, - "UploadAttachments": {
- "rpa_action_configurations": true,
- "rpa_action_executions": false
}
}
}
}