Admin API
Use the MESA Admin API to work with workflows programmatically. Get your API key from the MESA CLI and review the base URL, parameters and endpoints.
The MESA Admin API allows you to programmatically interact with MESA. All requests must include your API key. To get your key, install the MESA CLI and run mesa auth login. Your key is saved to ~/.mesa/config.yml.
| Key | Value |
|---|---|
| {url} | https://api.getmesa.com/v1 |
| {uuid} | Your store’s unique identifier: {{uuid}}.myshopify.com |
Workflows
Section titled “Workflows”Get list of automations
Section titled “Get list of automations”GET {url}/admin/{uuid}/automations.jsonReturns a list of automations for a store, sorted by most recently created first.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-api-key |
header | string | No | Example: {{api_key}} |
uuid |
path | string | Yes |
Request body
{ "automations": [ { "uuid": "my-store", "created_by": "", "key": "etsy_order_send_to_google_sheets", "name": "Send Etsy orders to Google Sheets", "version": "1.0.0", "template": "etsy/order/send_to_google_sheets", "description": "Consolidate your Etsy orders in Google Sheets for real-time tracking and improved order management. This template will automatically send Etsy order details to a Google Sheets spreadsheet when a customer completes an order on Etsy.", "video": "", "is_premium": false, "tags": [], "source": "", "destination": "", "enabled": false, "did_complete": false, "logging": true, "debug": false, "setup": "incomplete", "seconds": 135, "notifications": { "enabled": false, "emails": [ "example@theshoppad.com" ] }, "_id": "65f1fdbbb54ac273e806026b", "created_at": "Mar 13 2020", "updated_at": "Mar 13 2024" } ]}Response 200: Successful response
Get the mesa.json file for an automation
Section titled “Get the mesa.json file for an automation”GET {url}/admin/{uuid}/automations/{automation_key}.json| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-api-key |
header | string | No | Example: {{api_key}} |
Content-Type |
header | string | No | Example: application/json |
uuid |
path | string | Yes | |
automation_key |
path | string | Yes |
Response 200: Successful response
Create or update an Automation configuration
Section titled “Create or update an Automation configuration”POST {url}/admin/{uuid}/automations.jsonUpdates the Inputs, Outputs, Credentials and Storage for an automation. Updating scripts requires separate calls to the Script POST endpoing for each script.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-api-key |
header | string | No | Example: {{api_key}} |
uuid |
path | string | Yes |
Request body
{ "key": "", "name": "", "config": { "inputs": [], "outputs": [], "secrets": [], "storage": [], "files": [], "overwrite": false }}Response 200: Successful response
Uninstall an Automation
Section titled “Uninstall an Automation”DELETE {url}/admin/{uuid}/automations/{automation_key}.json| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-api-key |
header | string | No | Example: {{api_key}} |
uuid |
path | string | Yes | |
automation_key |
path | string | Yes | Example: new_workflow_1 |
Response 200: Successful response
Connections
Section titled “Connections”Get a list of Credentials
Section titled “Get a list of Credentials”GET {url}/admin/{uuid}/{automation_key}/credentials.jsonReturns a list of all Credential names. Credential values are not available via the Admin API.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-api-key |
header | string | No | Example: {{api_key}} |
uuid |
path | string | Yes | |
automation_key |
path | string | Yes |
Response 200: Successful response
Create a new Credential
Section titled “Create a new Credential”POST {url}/admin/{uuid}/{automation_key}/credentials.json| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-api-key |
header | string | No | Example: {{api_key}} |
uuid |
path | string | Yes | |
automation_key |
path | string | Yes | Example: new_workflow_1 |
Request body
{ "secret": { "key": "mysecret", "value": "myvalue" }}Response 200: Successful response
Update an existing Credential
Section titled “Update an existing Credential”PUT {url}/admin/{uuid}/{automation_key}/credentials/{credential_key}.json| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-api-key |
header | string | No | Example: {{api_key}} |
uuid |
path | string | Yes | |
automation_key |
path | string | Yes | Example: new_workflow_1 |
secret_key |
path | string | Yes |
Request body
{ "secret": { "value": "myvalue" }}Response 200: Successful response
Delete a Credential
Section titled “Delete a Credential”DELETE {url}/admin/{uuid}/{automation_key}/credentials/{credential_key}.jsonURL Parameters
| Key | Description |
|---|---|
| {{uuid}} | Your store's unique identifier: {{uuid}}.myshopify.com. |
| {{automation_key}} | The automation's key. Example: shoppad/mesa-templates/shopify/draft-order/remove. |
| {{secret_key}} | The key of the Credential, which can be obtained from the Credentials tab of the Mesa Dashboard. |
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-api-key |
header | string | No | Example: {{api_key}} |
uuid |
path | string | Yes | |
automation_key |
path | string | Yes | Example: new_workflow_1 |
secret_key |
path | string | Yes | Example: googlesheets_1 |
Response 200: Successful response
Storage
Section titled “Storage”Get a list of all Storage items
Section titled “Get a list of all Storage items”GET {url}/admin/{uuid}/{automation_key}/storage.jsonNote: Storage has been deprecated in favor of Data by MESA. Returns a list of all Storage item names. To get a Storage value, call GET {{url}}/admin/{{uuid}}/storage/{{storage_name}}.json
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-api-key |
header | string | No | Example: {{api_key}} |
uuid |
path | string | Yes | |
automation_key |
path | string | Yes | Example: new_workflow_1 |
Response 200: Successful response
Create a new Storage item
Section titled “Create a new Storage item”POST {url}/admin/{uuid}/{automation_key}/storage.jsonNote: Storage has been deprecated in favor of Data by MESA. Value parameter can be a string, an object, an array, or a boolean value.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-api-key |
header | string | No | Example: {{api_key}} |
uuid |
path | string | Yes | |
automation_key |
path | string | Yes | Example: new_workflow_1 |
Request body
{ "storage": { "key": "{{storage_key}}", "value": { "mykey": "myvalue" } }}Response 200: Successful response
Get the value of a Storage item
Section titled “Get the value of a Storage item”GET {url}/admin/{uuid}/{automation_key}/storage/{storage_key}.jsonNote: Storage has been deprecated in favor of Data by MESA.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-api-key |
header | string | No | Example: {{api_key}} |
uuid |
path | string | Yes | |
automation_key |
path | string | Yes | Example: new_workflow_1 |
storage_key |
path | string | Yes | Example: storage_1 |
Response 200: Successful response
Update an existing Storage item
Section titled “Update an existing Storage item”PUT {url}/admin/{uuid}/{automation_key}/storage/{storage_key}.jsonNote: Storage has been deprecated in favor of Data by MESA. Value parameter can be a string, an object, an array, or a boolean value.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-api-key |
header | string | No | Example: {{api_key}} |
uuid |
path | string | Yes | |
automation_key |
path | string | Yes | Example: new_workflow_1 |
storage_key |
path | string | Yes | Example: storage_1 |
Request body
{ "storage": { "value": "mynewstringvalue" }}Response 200: Successful response
Deletes a Storage item
Section titled “Deletes a Storage item”DELETE {url}/admin/{uuid}/{automation_key}/storage/{storage_key}.jsonNote: Storage has been deprecated in favor of Data by MESA. Delete a Storage item.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-api-key |
header | string | No | Example: {{api_key}} |
uuid |
path | string | Yes | |
automation_key |
path | string | Yes | Example: new_workflow_1 |
storage_key |
path | string | Yes | Example: storage_1 |
Response 200: Successful response
Scripts
Section titled “Scripts”Get a list of Scripts
Section titled “Get a list of Scripts”GET {url}/admin/{uuid}/{automation_key}/scripts.jsonReturns a list of all Scripts, including the Script code.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-api-key |
header | string | No | Example: {{api_key}} |
uuid |
path | string | Yes |
Response 200: Successful response
Create or update a Script
Section titled “Create or update a Script”POST {url}/admin/{uuid}/{automation_key}/scripts.json| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-api-key |
header | string | No | Example: {{api_key}} |
uuid |
path | string | Yes | |
automation_key |
path | string | Yes | Example: new_workflow_1 |
Request body
{ "script": { "filename": "myscript.js", "code": "// Javascript goes here" }}Response 200: Successful response
Delete a Script
Section titled “Delete a Script”DELETE {url}/admin/{uuid}/{automation_key}/scripts.json| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-api-key |
header | string | No | Example: {{api_key}} |
uuid |
path | string | Yes |
Response 200: Successful response
Testing
Section titled “Testing”Run a test
Section titled “Run a test”POST {url}/admin/{uuid}/{automation_key}/triggers/{trigger_key}/test.jsonTrigger a test with a specific that is passed as the payload body parameter. To test an actual payload, consider running a test in the UI and replaying the task with POST replay.json.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-api-key |
header | string | No | Example: {{api_key}} |
uuid |
path | string | Yes | |
automation_key |
path | string | Yes | Example: new_workflow_1 |
trigger_key |
path | string | Yes | Example: shopify_1 |
Request body
{ "payload": {}}Response 200: Successful response
Replay a task
Section titled “Replay a task”POST {url}/admin/{uuid}/tasks/{task_id}/replay.jsonRestart the execution of the workflow from a specific task. Data from all steps previous to this task in the original workflow run will be available.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-api-key |
header | string | No | Example: {{api_key}} |
uuid |
path | string | Yes | |
task_id |
path | string | Yes | To find the Task ID, click on a step in the Activity List > Request Details, and copy the last ID hash from the URL Example: 65f3459357ca4e809608c8fb |
Response 200: Successful response
Templates
Section titled “Templates”Install a template from the Mesa Template library
Section titled “Install a template from the Mesa Template library”POST {url}/admin/{uuid}/templates/install.json| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-api-key |
header | string | No | Example: {{api_key}} |
uuid |
path | string | Yes |
Request body
{ "template": "shoppad/mesa-templates/tests/kitchen-sink", "force": true}Response 200: Successful response
Get the 50 most recent log entries
Section titled “Get the 50 most recent log entries”GET {url}/admin/{uuid}/logs.jsonReturns a list of the most recent 50 log entries.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-api-key |
header | string | No | Example: {{api_key}} |
uuid |
path | string | Yes |
Response 200: Successful response
