Miridia
Portal
Integrations

Workflows

The workflows operations of the Core API.

Base URL: https://api.miridia.io. Read Authentication and Conventions before you call these operations.

MethodPathOperation
POST/api/workflows/resume-workflowResume workflow
GET/api/workflows/{entityType}/configuredGet configured workflows
PUT/api/workflows/configured/{workflowId}Update configured workflow
PATCH/api/workflows/configured/{workflowId}Patch configured workflow
DELETE/api/workflows/configured/{workflowId}Delete configured workflow
POST/api/workflows/{entityType}/configure-positionsConfigure workflow position
POST/api/workflows/configureConfigure workflow
GET/api/workflows/templates/{workflowId}Get workflow template
GET/api/workflows/{entityType}/actionsGet actionable workflows
POST/api/workflows/{entityType}/actions/{actionId}Execute action

Resume workflow

POST/api/workflows/resume-workflow

Access. Send a bearer token or an API key. Any signed-in member can call this operation.

Request body

Send JSON with the shape ResumeWorkflowRequest. Payload for resuming a suspended workflow instance.

FieldTypeRequiredDescription
workflowIdstringYes

Response

200. Returns a SingleResult envelope. The data field is boolean.

Request
curl -X POST "https://api.miridia.io/api/workflows/resume-workflow" \
  -H "Authorization: Bearer $MIRIDIA_TOKEN" \
  -H "X-Business-Id: $MIRIDIA_BUSINESS_ID" \
  -H "Content-Type: application/json" \
  -d '{
  "workflowId": "string"
}'
Response
{
  "message": "string",
  "messages": [
    {
      "title": "string",
      "message": "string",
      "level": "Standard",
      "icon": "SyncAlert",
      "code": "string"
    }
  ],
  "data": true,
  "statusCode": "OK",
  "canRead": true,
  "canEdit": true,
  "canDelete": true
}

Get configured workflows

GET/api/workflows/{entityType}/configured

Access. Send a bearer token or an API key. The caller needs the Workflows view permission.

Parameters

NameInTypeRequiredDescription
entityTypepathenum DispatchEntityTypeYesOne of: None, Customer, Contact, Product, Order, Shipment, IntegrationProvider, Address, Business, Notification, Package, Supplier, User, WorkOrder, TransferOrder, PurchaseOrder, Bom, Vehicle.
managedquerybooleanNo

Response

200. Returns a PagedResult envelope. Each item in data is BusinessIntegrationProviderWorkflowResponse.

Request
curl -X GET "https://api.miridia.io/api/workflows/{entityType}/configured" \
  -H "Authorization: Bearer $MIRIDIA_TOKEN" \
  -H "X-Business-Id: $MIRIDIA_BUSINESS_ID"
Response
{
  "count": 0,
  "totalCount": 0,
  "page": 0,
  "finalPage": 0,
  "pageSize": 0,
  "hasMore": true,
  "statusCode": "OK",
  "data": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "entityId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "entityType": "Customer",
      "title": "string",
      "description": "string",
      "enabled": true,
      "isManaged": true,
      "isSingleAction": true,
      "isMultiAction": true,
      "accessToken": "string",
      "url": "string",
      "position": 0,
      "integrationProviderWorkflow": {}
    }
  ],
  "messages": [
    {
      "title": "string",
      "message": "string",
      "level": "Standard",
      "icon": "SyncAlert",
      "code": "string"
    }
  ]
}

Update configured workflow

PUT/api/workflows/configured/{workflowId}

Access. Send a bearer token or an API key. The caller needs the Workflows modify permission.

Parameters

NameInTypeRequiredDescription
workflowIdpathstring (uuid)Yes

Request body

Send JSON with the shape UpdateConfiguredWorkflowRequest. Payload for the full edit of a configured workflow: the title, the description, and the two action flags. The trigger and the provider stay as they are.

FieldTypeRequiredDescription
titlestringYes
descriptionstringNoLimits: maximum 10000 characters.
isSingleActionbooleanNo
isMultiActionbooleanNo

Response

200. Returns a SingleResult envelope. The data field is BusinessIntegrationProviderWorkflowResponse.

Request
curl -X PUT "https://api.miridia.io/api/workflows/configured/{workflowId}" \
  -H "Authorization: Bearer $MIRIDIA_TOKEN" \
  -H "X-Business-Id: $MIRIDIA_BUSINESS_ID" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "string",
  "description": "string",
  "isSingleAction": true,
  "isMultiAction": true
}'
Response
{
  "message": "string",
  "messages": [
    {
      "title": "string",
      "message": "string",
      "level": "Standard",
      "icon": "SyncAlert",
      "code": "string"
    }
  ],
  "data": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "entityId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "entityType": "Customer",
    "title": "string",
    "description": "string",
    "enabled": true,
    "isManaged": true,
    "isSingleAction": true,
    "isMultiAction": true,
    "accessToken": "string",
    "url": "string",
    "position": 0,
    "integrationProviderWorkflow": {
      "id": 0,
      "entityType": "Customer",
      "title": "string",
      "eventTitle": "string"
    }
  },
  "statusCode": "OK",
  "canRead": true,
  "canEdit": true,
  "canDelete": true
}

Patch configured workflow

PATCH/api/workflows/configured/{workflowId}

Access. Send a bearer token or an API key. The caller needs the Workflows modify permission.

Parameters

NameInTypeRequiredDescription
workflowIdpathstring (uuid)Yes

Request body

Send JSON with the shape PatchConfiguredWorkflowRequest. Payload for partially updating a configured workflow. Currently only the active state is patchable.

FieldTypeRequiredDescription
isEnabledbooleanYes

Response

200. Returns a SingleResult envelope. The data field is BusinessIntegrationProviderWorkflowResponse.

Request
curl -X PATCH "https://api.miridia.io/api/workflows/configured/{workflowId}" \
  -H "Authorization: Bearer $MIRIDIA_TOKEN" \
  -H "X-Business-Id: $MIRIDIA_BUSINESS_ID" \
  -H "Content-Type: application/json" \
  -d '{
  "isEnabled": true
}'
Response
{
  "message": "string",
  "messages": [
    {
      "title": "string",
      "message": "string",
      "level": "Standard",
      "icon": "SyncAlert",
      "code": "string"
    }
  ],
  "data": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "entityId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "entityType": "Customer",
    "title": "string",
    "description": "string",
    "enabled": true,
    "isManaged": true,
    "isSingleAction": true,
    "isMultiAction": true,
    "accessToken": "string",
    "url": "string",
    "position": 0,
    "integrationProviderWorkflow": {
      "id": 0,
      "entityType": "Customer",
      "title": "string",
      "eventTitle": "string"
    }
  },
  "statusCode": "OK",
  "canRead": true,
  "canEdit": true,
  "canDelete": true
}

Delete configured workflow

DELETE/api/workflows/configured/{workflowId}

Access. Send a bearer token or an API key. The caller needs the Workflows delete permission.

Parameters

NameInTypeRequiredDescription
workflowIdpathstring (uuid)Yes

Response

200. Returns a SingleResult envelope. The data field is BusinessIntegrationProviderWorkflowResponse.

Request
curl -X DELETE "https://api.miridia.io/api/workflows/configured/{workflowId}" \
  -H "Authorization: Bearer $MIRIDIA_TOKEN" \
  -H "X-Business-Id: $MIRIDIA_BUSINESS_ID"
Response
{
  "message": "string",
  "messages": [
    {
      "title": "string",
      "message": "string",
      "level": "Standard",
      "icon": "SyncAlert",
      "code": "string"
    }
  ],
  "data": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "entityId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "entityType": "Customer",
    "title": "string",
    "description": "string",
    "enabled": true,
    "isManaged": true,
    "isSingleAction": true,
    "isMultiAction": true,
    "accessToken": "string",
    "url": "string",
    "position": 0,
    "integrationProviderWorkflow": {
      "id": 0,
      "entityType": "Customer",
      "title": "string",
      "eventTitle": "string"
    }
  },
  "statusCode": "OK",
  "canRead": true,
  "canEdit": true,
  "canDelete": true
}

Configure workflow position

POST/api/workflows/{entityType}/configure-positions

Access. Send a bearer token or an API key. The caller needs the Workflows modify permission.

Parameters

NameInTypeRequiredDescription
entityTypepathenum DispatchEntityTypeYesOne of: None, Customer, Contact, Product, Order, Shipment, IntegrationProvider, Address, Business, Notification, Package, Supplier, User, WorkOrder, TransferOrder, PurchaseOrder, Bom, Vehicle.

Request body

Send JSON with the shape ConfigureIntegrationProviderWorkflowPositionCommand.

FieldTypeRequiredDescription
entityTypeenum DispatchEntityTypeNoOne of: None, Customer, Contact, Product, Order, Shipment, IntegrationProvider, Address, Business, Notification, Package, Supplier, User, WorkOrder, TransferOrder, PurchaseOrder, Bom, Vehicle.
workflowIdsstring (uuid)[]Yes

Response

200. Returns a PagedResult envelope. Each item in data is BusinessIntegrationProviderWorkflowResponse.

Request
curl -X POST "https://api.miridia.io/api/workflows/{entityType}/configure-positions" \
  -H "Authorization: Bearer $MIRIDIA_TOKEN" \
  -H "X-Business-Id: $MIRIDIA_BUSINESS_ID" \
  -H "Content-Type: application/json" \
  -d '{
  "entityType": "Customer",
  "workflowIds": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ]
}'
Response
{
  "count": 0,
  "totalCount": 0,
  "page": 0,
  "finalPage": 0,
  "pageSize": 0,
  "hasMore": true,
  "statusCode": "OK",
  "data": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "entityId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "entityType": "Customer",
      "title": "string",
      "description": "string",
      "enabled": true,
      "isManaged": true,
      "isSingleAction": true,
      "isMultiAction": true,
      "accessToken": "string",
      "url": "string",
      "position": 0,
      "integrationProviderWorkflow": {}
    }
  ],
  "messages": [
    {
      "title": "string",
      "message": "string",
      "level": "Standard",
      "icon": "SyncAlert",
      "code": "string"
    }
  ]
}

Configure workflow

POST/api/workflows/configure

Access. Send a bearer token or an API key. The caller needs the Workflows modify permission.

Request body

Send JSON with the shape ConfigureWorkflowCommand.

FieldTypeRequiredDescription
triggerIdinteger (int32)NoThe workflow trigger id. Leave this at zero for a workflow with no trigger, that is a menu action only. Give either this value or EntityType.
titlestringYes
descriptionstringYes
templateIdinteger (int32)NoThe workflow template if the user selected one. Otherwise this will be empty.
entityTypeenum DispatchEntityTypeNoOne of: None, Customer, Contact, Product, Order, Shipment, IntegrationProvider, Address, Business, Notification, Package, Supplier, User, WorkOrder, TransferOrder, PurchaseOrder, Bom, Vehicle.
isSingleActionbooleanNoShows this workflow as a menu action on the entity details page.
isMultiActionbooleanNoShows this workflow as a bulk menu action on the entity list page.

Response

200. Returns a SingleResult envelope. The data field is BusinessIntegrationProviderWorkflowResponse.

Request
curl -X POST "https://api.miridia.io/api/workflows/configure" \
  -H "Authorization: Bearer $MIRIDIA_TOKEN" \
  -H "X-Business-Id: $MIRIDIA_BUSINESS_ID" \
  -H "Content-Type: application/json" \
  -d '{
  "triggerId": 0,
  "title": "string",
  "description": "string",
  "templateId": 0,
  "entityType": "Customer",
  "isSingleAction": true,
  "isMultiAction": true
}'
Response
{
  "message": "string",
  "messages": [
    {
      "title": "string",
      "message": "string",
      "level": "Standard",
      "icon": "SyncAlert",
      "code": "string"
    }
  ],
  "data": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "entityId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "entityType": "Customer",
    "title": "string",
    "description": "string",
    "enabled": true,
    "isManaged": true,
    "isSingleAction": true,
    "isMultiAction": true,
    "accessToken": "string",
    "url": "string",
    "position": 0,
    "integrationProviderWorkflow": {
      "id": 0,
      "entityType": "Customer",
      "title": "string",
      "eventTitle": "string"
    }
  },
  "statusCode": "OK",
  "canRead": true,
  "canEdit": true,
  "canDelete": true
}

Get workflow template

GET/api/workflows/templates/{workflowId}

Get's the list of templates configured for the provided workflow id

Access. Send a bearer token or an API key. The caller needs the Workflows view permission.

Parameters

NameInTypeRequiredDescription
workflowIdpathinteger (int32)YesThe workflow (trigger) id

Response

200. Returns a JSON array. Each item is IntegrationProviderWorkflowTemplateResponse.

Request
curl -X GET "https://api.miridia.io/api/workflows/templates/{workflowId}" \
  -H "Authorization: Bearer $MIRIDIA_TOKEN" \
  -H "X-Business-Id: $MIRIDIA_BUSINESS_ID"
Response
[
  {
    "id": 0,
    "title": "string",
    "description": "string"
  }
]

Get actionable workflows

GET/api/workflows/{entityType}/actions

Access. Send a bearer token or an API key. The caller needs the Workflows view permission.

Parameters

NameInTypeRequiredDescription
entityTypepathenum DispatchEntityTypeYesOne of: None, Customer, Contact, Product, Order, Shipment, IntegrationProvider, Address, Business, Notification, Package, Supplier, User, WorkOrder, TransferOrder, PurchaseOrder, Bom, Vehicle.

Response

200. Returns a JSON array. Each item is ExecutableIntegrationProviderWorkflowResponse.

Request
curl -X GET "https://api.miridia.io/api/workflows/{entityType}/actions" \
  -H "Authorization: Bearer $MIRIDIA_TOKEN" \
  -H "X-Business-Id: $MIRIDIA_BUSINESS_ID"
Response
[
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "title": "string",
    "isSingleAction": true,
    "isMultiAction": true
  }
]

Execute action

POST/api/workflows/{entityType}/actions/{actionId}

Access. Send a bearer token or an API key. The caller needs the Workflows view permission.

Parameters

NameInTypeRequiredDescription
entityTypepathenum DispatchEntityTypeYesOne of: None, Customer, Contact, Product, Order, Shipment, IntegrationProvider, Address, Business, Notification, Package, Supplier, User, WorkOrder, TransferOrder, PurchaseOrder, Bom, Vehicle.
actionIdpathstring (uuid)Yes

Request body

Send JSON with the shape ExecuteWorkflowActionRequest. Payload for a workflow menu action. A single-action workflow takes one entity id.

FieldTypeRequiredDescription
entityIdsstring (uuid)[]No

Response

200. Returns a SingleResult envelope. The data field is ExecuteWorkflowActionResponse.

Request
curl -X POST "https://api.miridia.io/api/workflows/{entityType}/actions/{actionId}" \
  -H "Authorization: Bearer $MIRIDIA_TOKEN" \
  -H "X-Business-Id: $MIRIDIA_BUSINESS_ID" \
  -H "Content-Type: application/json" \
  -d '{
  "entityIds": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ]
}'
Response
{
  "message": "string",
  "messages": [
    {
      "title": "string",
      "message": "string",
      "level": "Standard",
      "icon": "SyncAlert",
      "code": "string"
    }
  ],
  "data": {
    "succeeded": [
      "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    ],
    "failed": [
      "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    ]
  },
  "statusCode": "OK",
  "canRead": true,
  "canEdit": true,
  "canDelete": true
}

Models

The operations on this page use these object types. Select a type to see its fields.

BusinessIntegrationProviderWorkflowResponse
FieldTypeDescription
idstring (uuid)
entityIdstring (uuid)
entityTypeenum DispatchEntityTypeOne of: None, Customer, Contact, Product, Order, Shipment, IntegrationProvider, Address, Business, Notification, Package, Supplier, User, WorkOrder, TransferOrder, PurchaseOrder, Bom, Vehicle.
titlestring
descriptionstring
enabledboolean
isManagedbooleanTrue when Miridia provisioned this workflow.
isSingleActionbooleanTrue when the workflow shows in the details page menu of its entity type.
isMultiActionbooleanTrue when the workflow shows in the list page bulk menu of its entity type.
accessTokenstring
urlstring
positioninteger (int32)
integrationProviderWorkflowWorkflowTriggerResponse
ExecutableIntegrationProviderWorkflowResponse
FieldTypeDescription
idstring (uuid)
titlestring
isSingleActionbooleanShows on the entity details page menu.
isMultiActionbooleanShows on the entity list bulk menu.
ExecuteWorkflowActionResponse

The per-id result of a workflow menu action. An id in failed means the webhook call for that entity did not return a success status.

FieldTypeDescription
succeededstring (uuid)[]
failedstring (uuid)[]
IntegrationProviderWorkflowTemplateResponse
FieldTypeDescription
idinteger (int32)
titlestring
descriptionstring
WorkflowTriggerResponse
FieldTypeDescription
idinteger (int32)
entityTypeenum DispatchEntityTypeOne of: None, Customer, Contact, Product, Order, Shipment, IntegrationProvider, Address, Business, Notification, Package, Supplier, User, WorkOrder, TransferOrder, PurchaseOrder, Bom, Vehicle.
titlestring
eventTitlestring