Admin API | MESA Docs

MESA Admin API

The MESA Admin API allows you to programmatically interact with MESA. All requests must include your API key which can be found in My Account > Connections.

Key

Value

{url}
https://api.getmesa.com/v1

{uuid}
Your store’s unique identifier: {{uuid}}.myshopify.com

Workflows

Get list of automations

GET http://{{url}}/admin/{uuid}/automations.json

Returns a list of automations for a store, sorted by most recently created first.

Path parameters

Header parameters

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"}]}

Responses

GET /admin/{uuid}/automations.json HTTP/1.1
Host: {{url}}
Content-Type: application/json
Accept: */*
Content-Length: 776

{
  "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"
    }
  ]
}

Get the mesa.json file for an automation

GET http://{{url}}/admin/{uuid}/automations/{automation_key}.json

Path parameters

Header parameters

Responses

GET /admin/{uuid}/automations/{automation_key}.json HTTP/1.1
Host: {{url}}
Accept: */*

Create or update an Automation configuration

POST http://{{url}}/admin/{uuid}/automations.json

Updates the Inputs, Outputs, Credentials and Storage for an automation.

Path parameters

Header parameters

Body

{"key":"","name":"","config":{"inputs":[],"outputs":[],"secrets":[],"storage":[],"files":[],"overwrite":false}}

Responses

POST /admin/{uuid}/automations.json HTTP/1.1
Host: {{url}}
Content-Type: application/json
Accept: */*
Content-Length: 111

{
  "key": "",
  "name": "",
  "config": {
    "inputs": [],
    "outputs": [],
    "secrets": [],
    "storage": [],
    "files": [],
    "overwrite": false
  }
}

Uninstall an Automation

DELETE http://{{url}}/admin/{uuid}/automations/{automation_key}.json

Path parameters

Header parameters

Responses

DELETE /admin/{uuid}/automations/{automation_key}.json HTTP/1.1
Host: {{url}}
Accept: */*

Connections

Get a list of Credentials

GET http://{{url}}/admin/{uuid}/{automation_key}/credentials.json

Returns a list of all Credential names.

Path parameters

Header parameters

Responses

GET /admin/{uuid}/{automation_key}/credentials.json HTTP/1.1
Host: {{url}}
Accept: */*

Create a new Credential

POST http://{{url}}/admin/{uuid}/{automation_key}/credentials.json

Path parameters

Header parameters

Body

{"secret":{"key":"mysecret","value":"myvalue"}}

Responses

POST /admin/{uuid}/{automation_key}/credentials.json HTTP/1.1
Host: {{url}}
Content-Type: application/json
Accept: */*
Content-Length: 47

{
  "secret": {
    "key": "mysecret",
    "value": "myvalue"
  }
}

Update an existing Credential

PUT http://{{url}}/admin/{uuid}/{automation_key}/credentials/{credential_key}.json

Path parameters

Header parameters

Body

{"secret":{"value":"myvalue"}}

Responses

PUT /admin/{uuid}/{automation_key}/credentials/{credential_key}.json HTTP/1.1
Host: {{url}}
Content-Type: application/json
Accept: */*
Content-Length: 30

{
  "secret": {
    "value": "myvalue"
  }
}

Delete a Credential

DELETE http://{{url}}/admin/{uuid}/{automation_key}/credentials/{credential_key}.json

Path parameters

Header parameters

Responses

DELETE /admin/{uuid}/{automation_key}/credentials/{credential_key}.json HTTP/1.1
Host: {{url}}
Accept: */*

Storage

Get a list of all Storage items

GET http://{{url}}/admin/{uuid}/{automation_key}/storage.json

Returns a list of all Storage item names.

Path parameters

Header parameters

Responses

GET /admin/{uuid}/{automation_key}/storage.json HTTP/1.1
Host: {{url}}
Accept: */*

Create a new Storage item

POST http://{{url}}/admin/{uuid}/{automation_key}/storage.json

The value parameter can be a string, an object, an array, or a boolean value.

Path parameters

Header parameters

Body

{"storage":{"key":"{{storage_key}}","value":{"mykey":"myvalue"}}}

Responses

POST /admin/{uuid}/{automation_key}/storage.json HTTP/1.1
Host: {{url}}
Content-Type: application/json
Accept: */*
Content-Length: 65

{
  "storage": {
    "key": "{{storage_key}}",
    "value": {
      "mykey": "myvalue"
    }
  }
}

Get the value of a Storage item

GET http://{{url}}/admin/{uuid}/{automation_key}/storage/{storage_key}.json

Path parameters

Header parameters

Responses

GET /admin/{uuid}/{automation_key}/storage/{storage_key}.json HTTP/1.1
Host: {{url}}
Accept: */*

Update an existing Storage item

PUT http://{{url}}/admin/{uuid}/{automation_key}/storage/{storage_key}.json

Path parameters

Header parameters

Body

{"storage":{"value":"mynewstringvalue"}}

Responses

PUT /admin/{uuid}/{automation_key}/storage/{storage_key}.json HTTP/1.1
Host: {{url}}
Content-Type: application/json
Accept: */*
Content-Length: 40

{
  "storage": {
    "value": "mynewstringvalue"
  }
}

Deletes a Storage item

DELETE http://{{url}}/admin/{uuid}/{automation_key}/storage/{storage_key}.json

Path parameters

Header parameters

Responses

DELETE /admin/{uuid}/{automation_key}/storage/{storage_key}.json HTTP/1.1
Host: {{url}}
Accept: */*

Scripts

Get a list of Scripts

GET http://{{url}}/admin/{uuid}/{automation_key}/scripts.json

Returns a list of all Scripts, including the Script code.

Path parameters

Header parameters

Responses

GET /admin/{uuid}/{automation_key}/scripts.json HTTP/1.1
Host: {{url}}
Accept: */*

Create or update a Script

POST http://{{url}}/admin/{uuid}/{automation_key}/scripts.json

Path parameters

Header parameters

Body

{"script":{"filename":"myscript.js","code":"// Javascript goes here"}}

Responses

POST /admin/{uuid}/{automation_key}/scripts.json HTTP/1.1
Host: {{url}}
Content-Type: application/json
Accept: */*
Content-Length: 70

{
  "script": {
    "filename": "myscript.js",
    "code": "// Javascript goes here"
  }
}

Delete a Script

DELETE http://{{url}}/admin/{uuid}/{automation_key}/scripts.json

Path parameters

Header parameters

Responses

DELETE /admin/{uuid}/{automation_key}/scripts.json HTTP/1.1
Host: {{url}}
Accept: */*

Testing

Run a test

POST http://{{url}}/admin/{uuid}/{automation_key}/triggers/{trigger_key}/test.json

Trigger a test with a specific payload.

Path parameters

Header parameters

Body

{"payload":{}}

Responses

POST /admin/{uuid}/{automation_key}/triggers/{trigger_key}/test.json HTTP/1.1
Host: {{url}}
Content-Type: application/json
Accept: */*
Content-Length: 14

{
  "payload": {}
}

Tasks

Replay a task

POST http://{{url}}/admin/{uuid}/tasks/{task_id}/replay.json

Restart the execution of the workflow from a specific task.

Path parameters

Header parameters

Responses

POST /admin/{uuid}/tasks/{task_id}/replay.json HTTP/1.1
Host: {{url}}
Accept: */*

Templates

Install a template from the Mesa Template library

POST http://{{url}}/admin/{uuid}/templates/install.json

Path parameters

Header parameters

Body

{"template":"shoppad/mesa-templates/tests/kitchen-sink","force":true}

Responses

POST /admin/{uuid}/templates/install.json HTTP/1.1
Host: {{url}}
Content-Type: application/json
Accept: */*
Content-Length: 69

{
  "template": "shoppad/mesa-templates/tests/kitchen-sink",
  "force": true
}

Logs

Get the 50 most recent log entries

GET http://{{url}}/admin/{uuid}/logs.json

Returns a list of the most recent 50 log entries.

Path parameters

Header parameters

Responses

GET /admin/{uuid}/logs.json HTTP/1.1
Host: {{url}}
Accept: */*