Download OpenAPI specification:Download
An automation is a path you draw in your panel with blocks joined by arrows: send a message, wait, decide depending on what happened, alert your team. Automations that start with the API ENTRY block have their own address on the internet, their entry URL. Every time your software makes a request to that address, an execution starts: one person's journey through the automation, with the data you send in the request (their mobile number, their name, the date of their appointment…).
It lets your booking software, your shop or your management system report that something has happened (a new appointment, an order, an unpaid invoice) and, from there, everything happens on its own.
With this API your software can:
- Start an execution: automatizacion/{TOKEN}.
- Know how it ends: receive a notification when it finishes (see Notification on finish) or ask, with AutomatizacionEjecucion and AutomatizacionEjecuciones.
- Stop an execution that is still running: AutomatizacionCancelar.
- See which automations you have, with the entry URL and the data each one asks for: AutomatizacionListar.
What the automation does (what it sends, how long it waits, which way it goes) is decided in the drawing, in your panel. That is also where each execution is followed, under View executions.
Automations are in beta. While the beta lasts, each account has a daily cap on executions: see the Limits section.
1. In your panel, under Automations, create an automation that starts with the API ENTRY block. That block is where you declare the data your software is going to send: the name of each item, its type and whether it is required.
2. Publish it. Until it is published and active, its address answers -6 and nothing starts.
3. Copy its address with the Entry URL button, which you will find in the editor and in the list of automations. It looks like this: https://api.mensatek.com/automatizacion/k7Tq2mXw9LbR4zP. Each automation has its own, and it does not change when the drawing changes.
4. Your software makes a POST request to that address every time it wants to start an execution.
The data travels in the VARIABLES parameter: a JSON object with one value for each item declared in the API ENTRY block.
{"movil":"34600000001","nombre":"Lucía","fecha_cita":"2026-11-24 17:00"}
If your software sends the body of the request in JSON, VARIABLES is that object, as it is. If it sends it as a form, it is the same object written as text.
Each item is checked against the type it has in the block:
| Type | What is accepted |
| Mobile | The number with its country code: 34600000001. It must have between 9 and 15 digits; spaces, dashes and the + sign are not counted. |
| A well-formed email address. | |
| Number | A number. Decimals with a dot: 12.5. |
| Date | A date, with or without a time: 2026-11-24 17:00. It is read as Spanish mainland time. |
| Text | Any text. |
- If a required item is missing, or one is not valid for its type (a mobile number with letters), the execution does not start: the answer is -3 and Error says which item it is.
- Items you send that are not declared in the block are ignored.
- Item names are not case-sensitive.
- Each value is a text or a number. An object or a list as a value is ignored.
- Each value can hold up to 2,000 bytes; anything beyond that is cut off. Sent as text, the whole parameter can hold up to 65,000.
If your software does not receive the answer (a network cut, a timeout) it cannot tell whether the automation started. If it simply repeats the call, the person may get the message twice. With the REFERENCIA parameter it can repeat the call safely.
- Send with each request an identifier of your own: cita-88213, PED-2026/0412. From 1 to 50 letters and digits; . _ - : @ / + = # are also allowed. No spaces and no accented letters.
- If the same reference arrives again for the same automation within 24 hours, no new execution is created. The answer carries the one already created and flags it with "Repetida":1.
- The reference is what counts, not the data. If you repeat the reference with different variables, you still get the first execution. For a different request, use a different reference.
- It is case-sensitive: Cita-1 and cita-1 are two references.
- If the first call did not get to start (it answered -3, -6 or -7), the reference is still free: fix the problem and repeat with the same one.
- If two requests with the same reference arrive at the same time, only one starts. The other one gets the execution of the first or, if it does not exist yet, a -7 so that it tries again a few seconds later.
- In your panel, the execution shows its reference under «Origin», and the search box in View executions finds it when you type it in full.
- After the 24 hours, the same reference starts a new execution. To keep a person from going through the automation twice over several days, use the ONLY ONCE block in the drawing.
Starting an execution returns its number (idEjecucion) and nothing else: the journey can take minutes or days. There are two ways to know how it ends, and you can use both.
- We tell you. In your panel, under Automations → Notify your system, enter an address on your server. When each execution finishes we call it with the result and the data. This is the recommended way: your software does not have to ask. See the next section.
- You ask. AutomatizacionEjecucion returns one execution, by its number or by the REFERENCIA you started it with; AutomatizacionEjecuciones, the ones in a period. Use it to check a particular one, to catch up after your server has been down, or if you cannot receive calls.
Both ways give the same data, with the same names. What arrives in the notification is what AutomatizacionEjecucion returns.
Every execution has an estado (status):
| estado | What it means |
activa | It is taking steps right now. |
esperando | Still running, stopped at a wait. espera says which: tiempo (a delay), estado (the result of a message), respuesta (the person's reply), llamada (a call) or agente (someone on your team taking it). |
completada | It reached an END block. resultado is the name you gave that END: "appointment confirmed". |
error | It ended because of a failure. resultado carries the reason. |
cancelada | It was stopped: from your panel, with AutomatizacionCancelar, or because someone on your team took over. |
expirada | It was cut when a new version of the automation was published, or it had been stopped for 35 days. |
You turn it on in your panel, under Automations → Notify your system: the address of your server (https and public) and what to notify about, every execution that finishes or only those that end with an error. It applies to all the automations of the account. The Send a test button sends you a sample notification.
Your server receives a POST request with this JSON:
{
"evento": "automatizacion.terminada",
"fecha": "2026-11-24T17:05:12+01:00",
"automatizacion": { "id": 412, "nombre": "Recordatorio de cita", "version": 3 },
"ejecucion": {
"id": 2539,
"estado": "completada",
"resultado": "cita confirmada",
"inicio": "2026-11-23T17:00:03+01:00",
"fin": "2026-11-24T17:05:12+01:00",
"origen": "api",
"referencia": "cita-88213",
"contacto": "34600000001",
"prueba": false
},
"variables": { "movil": "34600000001", "nombre": "Lucía", "fecha_cita": "2026-11-24 17:00", "respuesta": "SI" },
"envios": [ { "bloque": 2, "canal": "sms", "id": "88120045", "estado": "entregado" } ]
}
- ejecucion.referencia is the REFERENCIA you started the execution with: your software recognises it by that.
- ejecucion.origen says how it started: api, envio (a send), mensaje (an incoming message), llamada (a call), programada (scheduled), evento (an event), chat, flujo (another automation launched it) or prueba (a test).
- ejecucion.prueba is true in real tests launched from the editor and in "Send a test".
- variables are the execution's variables when it finished, as text: the ones you sent when starting it and the ones the blocks have left (what the person replied, for example). Up to 100, of 2,000 characters each at most.
- envios are the messages it has sent, with the block number, the channel, its identifier and its last known status: entregado (delivered), leido (read), error or transitorio (still on its way).
Check that the notification is ours. Every notification is signed with your account's signing key, which is in that same window of the panel, under Show the signing key. Two headers arrive:
- X-Firma, for example t=1795536312,v1=5f2c…. t is the time of the notification, in seconds. v1 is the signature: the HMAC-SHA256, in hexadecimal, of the text made of t, a dot and the request body exactly as it arrives, with your key. Compute it yourself and compare. Reject notifications whose time is more than 5 minutes old.
- X-Aviso, the number of the notification. It is the same in the retries: if you already have it, answer OK and do not process it again.
What your server must answer. Any 2xx response in less than 8 seconds; the content of the response is not read. If it answers anything else, or does not answer, we try again: after 1 minute, after 10 more minutes and after 1 more hour. Four attempts in total. Redirects are not followed. Notifications can arrive out of order and, occasionally, twice.
Notifications are free of charge.
| Limit | How much |
| Starts through the entry URL | 60 per minute and account. For large loads, spread the starts out. |
| Executions per day | 1,000 per account while Automations are in beta. Every execution that starts that day counts, however it starts. Once reached, no more start until the next day; the ones already running carry on. If you need more, ask support. |
| Executions running at the same time | There is a maximum per account. If you reach it, wait for some to finish. |
Queries (AutomatizacionListar, AutomatizacionEjecucion, AutomatizacionEjecuciones and AutomatizacionCancelar) | 120 per minute and account, the four together. |
| List of executions | At most 31 days per query and 200 executions per response. |
| Notification on finish | We wait 8 seconds for your server. Four attempts per notification. |
When any of them is reached the answer is -7 and Error says which one. Wait and repeat the call.
The request answers when the execution reaches its first wait or its end, not before. It can take a few seconds: do not give your software a short timeout and, in case it runs out, always send REFERENCIA.
Same as the rest of our APIs: Basic authentication with your user and your API Token, which you will find in your panel under Your data → Configure → Security. Remember to authorise there the public IP address you will be calling from.
The user you authenticate with must belong to the same account as the automation. Otherwise the answer is -2.
Starts an execution of the automation the address belongs to, with the data in VARIABLES. The automation must start with the API ENTRY block and be published and active.
The three parameters are optional and go in the body of the request. The usual call sends VARIABLES and REFERENCIA:
curl -u "UsuarioAPI:APIToken" \
--data-urlencode 'VARIABLES={"movil":"34600000001","nombre":"Lucía","fecha_cita":"2026-11-24 17:00"}' \
--data-urlencode 'REFERENCIA=cita-88213' \
https://api.mensatek.com/automatizacion/k7Tq2mXw9LbR4zP
If your software sends the body in JSON, VARIABLES goes as an object:
curl -u "UsuarioAPI:APIToken" \
-H 'Content-Type: application/json' \
-d '{"VARIABLES":{"movil":"34600000001","nombre":"Lucía","fecha_cita":"2026-11-24 17:00"},"REFERENCIA":"cita-88213"}' \
https://api.mensatek.com/automatizacion/k7Tq2mXw9LbR4zP
The answer, in JSON:
{"Res":1,"idEjecucion":2539}
If that REFERENCIA had already started the execution in the last 24 hours, no new one is created and the answer says so:
{"Res":1,"idEjecucion":2539,"Repetida":1}
If it could not start, Res is negative and Error carries the reason:
{"Res":-3,"Error":"Missing required variable: movil"}
The Res codes are listed in the response, further down.
| TOKEN required | string Example: k7Tq2mXw9LbR4zP The last part of your automation's entry URL. You do not have to type it or send it separately: copy the whole address with the Entry URL button in your panel. |
| Variables | object Example: Variables={"movil":"34600000001","nombre":"Lucía","fecha_cita":"2026-11-24 17:00"} The data of this execution: a JSON object with one value for each item declared in the API ENTRY block of the automation. All the required ones must be there; the ones not declared are ignored.
|
| Referencia | string Example: Referencia=cita-88213 An identifier of your own for this request, such as the appointment or order number. Optional. It keeps a retry from starting twice: the same reference for the same automation within 24 hours does not create another execution, and the answer carries the one already created with |
| Resp | string Enum: "TXT" "JSON" "XML" Example: Resp=JSON Response format.
|
Parameters are sent in the body of the POST request, either as a JSON object (Content-Type application/json, RECOMMENDED) or as an application/x-www-form-urlencoded form. In the form format, array or object parameters are sent as a JSON-encoded string. Parameter names are case-insensitive. The detailed description of each parameter is in the parameters section of this operation.
| Variables | object |
| Referencia | string |
| Resp | string |
| Res required | integer <int32> Result of the call.
| ||||||||||||||
| idEjecucion | integer Number of the execution. It comes when | ||||||||||||||
| Repetida | integer It comes, with value | ||||||||||||||
| Error | string The reason, when |
{- "Variables": {
- "movil": "34600000001",
- "nombre": "Lucía",
- "fecha_cita": "2026-11-24 17:00"
}, - "Referencia": "cita-88213"
}{- "Res": 1,
- "idEjecucion": 2539
}Returns the automations of your account, newest first. For those that start with the API ENTRY block and are published it also brings their entry URL and the data they ask for: what your software needs to start them.
Parameters can go in the address or in the request body:
curl -u "UsuarioAPI:APIToken" "https://api.mensatek.com/v7/AutomatizacionListar?ESTADO=activo"
For each automation you get:
id | Its number. It is what IDAUTOMATIZACION asks for in the other functions. |
nombre | The name it has in your panel. |
estado | activo (active), pausado (paused: it starts no new executions; the ones already running carry on) or borrador (draft). |
empieza | How it starts: api (from your software), envio, mensaje, llamada, programada, evento or chat. |
version | The published version. 0 if it has not been published yet. |
modificada, publicada | When it was last changed and last published. |
url | Its entry URL. Only for those that start by api and are published. |
variables | The data it asks for, in the same ones: for each, nombre (name), tipo (movil, email, numero, fecha or texto) and obligatoria (required). |
| Estado | string Example: Estado=activo Optional. Only those in that status: |
| Resp | string Enum: "TXT" "JSON" "XML" Example: Resp=JSON Format of the response. JSON by default.
|
Parameters are sent in the body of the POST request, either as a JSON object (Content-Type application/json, RECOMMENDED) or as an application/x-www-form-urlencoded form. In the form format, array or object parameters are sent as a JSON-encoded string. Parameter names are case-insensitive. The detailed description of each parameter is in the parameters section of this operation.
| Estado | string |
| Resp | string |
| Res required | integer <int32> Result of the call.
| ||||||||||||||
| total | integer How many automations the response brings. | ||||||||||||||
| automatizaciones | Array of arrays The automations. What you get for each one is in the description of the function. | ||||||||||||||
| Error | string The reason, in English, when |
{- "Estado": "activo"
}{- "Res": 1,
- "total": 2,
- "automatizaciones": [
- {
- "id": 412,
- "nombre": "Recordatorio de cita",
- "estado": "activo",
- "empieza": "api",
- "version": 3,
- "modificada": "2026-11-10T09:30:00+01:00",
- "publicada": "2026-11-10T09:31:00+01:00",
- "variables": [
- {
- "nombre": "movil",
- "tipo": "movil",
- "obligatoria": true
}, - {
- "nombre": "nombre",
- "tipo": "texto",
- "obligatoria": false
}, - {
- "nombre": "fecha_cita",
- "tipo": "fecha",
- "obligatoria": false
}
]
}, - {
- "id": 398,
- "nombre": "Atención por WhatsApp",
- "estado": "pausado",
- "empieza": "mensaje",
- "version": 1,
- "modificada": "2026-11-02T18:00:00+01:00",
- "publicada": "2026-11-02T18:05:00+01:00"
}
]
}Returns how an execution is going, or how it ended. You look it up in one of two ways:
- By its number, with IDEJECUCION: the idEjecucion the entry URL returned.
- By the REFERENCIA you started it with. If your software never received the number (a network failure), this is how you find it. If several executions carry that reference, you get the most recent one; with IDAUTOMATIZACION the search is limited to that automation.
curl -u "UsuarioAPI:APIToken" "https://api.mensatek.com/v7/AutomatizacionEjecucion?IDEJECUCION=2539"
curl -u "UsuarioAPI:APIToken" "https://api.mensatek.com/v7/AutomatizacionEjecucion?REFERENCIA=cita-88213"
The response brings the same as the notification on finish, with the same names (automatizacion, ejecucion, variables and envios), and two more fields in ejecucion for those still running: bloque, the number of the block it is at, and espera, what it is waiting for. The statuses are in the section Knowing how an execution ends.
With PASOS=1 you also get pasos, the path it has followed: for each step, the number of the bloque (block), its tipo (type), the salida (output) it left by (ok, entregado, respuesta, timeout…; espera or esperando when it stopped to wait, fin at an END block) and its fecha (date).
| Idejecucion | integer Example: Idejecucion=2539 The number of the execution. You must send this parameter or |
| Referencia | string Example: Referencia=cita-88213 The |
| Idautomatizacion | integer Example: Idautomatizacion=412 Optional, with |
| Pasos | integer Example: Pasos=1 Optional. With |
| Resp | string Enum: "TXT" "JSON" "XML" Example: Resp=JSON Format of the response. JSON by default.
|
Parameters are sent in the body of the POST request, either as a JSON object (Content-Type application/json, RECOMMENDED) or as an application/x-www-form-urlencoded form. In the form format, array or object parameters are sent as a JSON-encoded string. Parameter names are case-insensitive. The detailed description of each parameter is in the parameters section of this operation.
| Idejecucion | integer |
| Referencia | string |
| Idautomatizacion | integer |
| Pasos | integer |
| Resp | string |
| Res required | integer <int32> Result of the call.
| ||||||||||||||
| automatizacion | object The automation: its number, its name and the version this execution ran with. | ||||||||||||||
| ejecucion | object The execution: | ||||||||||||||
| variables | object The execution's variables, as text: the ones you sent when starting it and the ones the blocks have left. Up to 100, of 2,000 characters each at most. | ||||||||||||||
| envios | Array of arrays The messages it has sent: the number of the | ||||||||||||||
| pasos | Array of arrays Only with | ||||||||||||||
| Error | string The reason, in English, when |
{- "idEjecucion": 2539
}{- "Res": 1,
- "automatizacion": {
- "id": 412,
- "nombre": "Recordatorio de cita",
- "version": 3
}, - "ejecucion": {
- "id": 2539,
- "estado": "completada",
- "resultado": "cita confirmada",
- "inicio": "2026-11-23T17:00:03+01:00",
- "fin": "2026-11-24T17:05:12+01:00",
- "origen": "api",
- "referencia": "cita-88213",
- "contacto": "34600000001",
- "prueba": false,
- "bloque": 0,
- "espera": ""
}, - "variables": {
- "movil": "34600000001",
- "nombre": "Lucía",
- "fecha_cita": "2026-11-24 17:00",
- "respuesta": "SI"
}, - "envios": [
- {
- "bloque": 2,
- "canal": "sms",
- "id": "88120045",
- "estado": "entregado"
}
]
}Returns the executions of your account that started in a period, newest first. Use it to catch up: what has finished since yesterday, which are still running, which have failed.
curl -u "UsuarioAPI:APIToken" "https://api.mensatek.com/v7/AutomatizacionEjecuciones?IDAUTOMATIZACION=412&ESTADO=en_marcha"
- Without DESDE or HASTA, it looks at the last 7 days. The period can span 31 days at most.
- Each response brings up to 50 executions (LIMITE to ask for another amount, 200 at most). If there are more, mas is true: repeat the call with ANTESDE set to the siguiente of the response, until mas is false.
- For each execution you get the essentials: its id, the automatizacion (its number), version, estado, resultado, inicio, fin, origen, referencia, contacto and prueba. Its variables and its messages, with AutomatizacionEjecucion.
| Idautomatizacion | integer Example: Idautomatizacion=412 Optional. Only the executions of that automation. |
| Estado | string Example: Estado=en_marcha Optional. Only those in that status: |
| Desde | string Example: Desde=2026-11-17 Optional. From when, in Spanish mainland time: |
| Hasta | string Example: Hasta=2026-11-24 Optional. Until when: |
| Limite | integer Example: Limite=50 Optional. How many executions per response: 1 to 200. Without it, 50. |
| Antesde | integer Example: Antesde=2540 Optional. To continue a list that did not fit in one response: the |
| Resp | string Enum: "TXT" "JSON" "XML" Example: Resp=JSON Format of the response. JSON by default.
|
Parameters are sent in the body of the POST request, either as a JSON object (Content-Type application/json, RECOMMENDED) or as an application/x-www-form-urlencoded form. In the form format, array or object parameters are sent as a JSON-encoded string. Parameter names are case-insensitive. The detailed description of each parameter is in the parameters section of this operation.
| Idautomatizacion | integer |
| Estado | string |
| Desde | string |
| Hasta | string |
| Limite | integer |
| Antesde | integer |
| Resp | string |
| Res required | integer <int32> Result of the call.
| ||||||||||||||
| desde | string The period that was looked at: from when. | ||||||||||||||
| hasta | string The period that was looked at: until when. | ||||||||||||||
| total | integer How many executions this response brings. | ||||||||||||||
| ejecuciones | Array of arrays The executions, newest first. | ||||||||||||||
| mas | boolean
| ||||||||||||||
| siguiente | integer With | ||||||||||||||
| Error | string The reason, in English, when |
{- "idAutomatizacion": 412,
- "Desde": "2026-11-17",
- "Hasta": "2026-11-24"
}{- "Res": 1,
- "desde": "2026-11-17T00:00:00+01:00",
- "hasta": "2026-11-24T23:59:59+01:00",
- "total": 2,
- "ejecuciones": [
- {
- "id": 2540,
- "automatizacion": 412,
- "version": 3,
- "estado": "esperando",
- "resultado": "",
- "inicio": "2026-11-24T09:00:00+01:00",
- "fin": "",
- "origen": "api",
- "referencia": "cita-88214",
- "contacto": "34600000002",
- "prueba": false
}, - {
- "id": 2539,
- "automatizacion": 412,
- "version": 3,
- "estado": "completada",
- "resultado": "cita confirmada",
- "inicio": "2026-11-23T17:00:03+01:00",
- "fin": "2026-11-24T17:05:12+01:00",
- "origen": "api",
- "referencia": "cita-88213",
- "contacto": "34600000001",
- "prueba": false
}
], - "mas": false,
- "siguiente": 0
}Stops an execution that is still running. It does the same as Cancel under View executions, in your panel: the execution ends as cancelada and takes no more steps. Whatever it had already sent stays sent.
Because it changes something, the parameter goes in the body of the request, not in the address:
curl -u "UsuarioAPI:APIToken" -d "IDEJECUCION=2540" https://api.mensatek.com/v7/AutomatizacionCancelar
- If the execution had already finished, the answer is -6 and ejecucion.estado says how it ended. It is left untouched.
- If you have the notification on finish turned on, the notification for that execution arrives all the same, with estado cancelada.
| Idejecucion required | integer Example: Idejecucion=2540 The number of the execution to stop. |
| Resp | string Enum: "TXT" "JSON" "XML" Example: Resp=JSON Format of the response. JSON by default.
|
Parameters are sent in the body of the POST request, either as a JSON object (Content-Type application/json, RECOMMENDED) or as an application/x-www-form-urlencoded form. In the form format, array or object parameters are sent as a JSON-encoded string. Parameter names are case-insensitive. The detailed description of each parameter is in the parameters section of this operation.
| Idejecucion required | integer |
| Resp | string |
| Res required | integer <int32> Result of the call.
| ||||||||||||||
| ejecucion | object The execution: its | ||||||||||||||
| Error | string The reason, in English, when |
{- "idEjecucion": 2540
}{- "Res": 1,
- "ejecucion": {
- "id": 2540,
- "estado": "cancelada",
- "resultado": "cancelada_usuario"
}
}