Entity Command API

A guide to using the Mindful Entity Command API to modify data.

This API provides a collection of JSON data endpoints to perform specific actions (commands) against Mindful Entity Kinds.

Connecting to the API

This API requires user, machine, or company token authentication.

In addition to the authentication header, make sure to send the namespace header to designate the intended tenant for your request! This API also supports the view parameter to designate the tenant view. For most use cases, this should be main.

POST https://api.mindfulcms.com/commands/<entity-kind>/<command-key> HTTP/1.1
Authentication: Bearer <api-token>
Content-Type: application/json
Host: api.mindfulcms.com
X-Namespace: <org-key>/<workspace-key>

{
  "command": {
    "input": [...]
  },
  "view": "<view-key>"
}

The shape of the input param varies based on the command being used, but it will always be an array of input payloads.

Metadata

The current metadata for available commands, entities, and fragments can be retrieved by sending a GET request to the /commands endpoint:

Command Metadata

The commands key in the metadata response indicates the name, resource, and URL to access to send a command.

Entity Kind Metadata

The entities key in the metadata response indicates the name and resource of each Entity Kind. It includes metadata about available props (fields), edges (single related item), connections (multiple related items), embedManies (multiple embedded Entity Fragments), and embedOnes (single embedded Entity Fragment).

If the Entity Kind supports Variant Forms, the same information is available under the forms key for each Variant Form.

Entity Metadata

Entity Form Metadata
Entity Fragment Metadata
Attribute Metadata
Reference Metadata
Embed Metadata

Available Entity Kinds

  • Advertising Company

  • Advertising Creative

  • Advertising Email Channel

  • Advertising Image

  • Advertising Line Item

  • Advertising Order

  • Advertising Post

  • Advertising Unit

  • Advertising Website Channel

  • Email Automation Job

  • Email Channel

  • Email Channel Block

  • Email Channel Deployment

  • File

  • Image

  • Label

  • Label Option

  • Magazine Channel

  • Magazine Channel Issue

  • Magazine Channel Section

  • Place or Thing

  • Post

  • Post Interaction

  • Vocab

  • Vocab Term

  • Website Channel

  • Website Channel Topic

This list is abbreviated — the current list of Entity Kinds can be found in the command metadata.

Available Commands

  • Clone

  • Create

  • Delete

  • Delete Connection Edges

  • Delete Edge

  • Delete Embed Manies

  • Delete Embed One

  • Merge

  • Modify Connection Edge Prop Value

  • Modify Edge Prop Value

  • Modify Embed Many Prop Value

  • Modify Embed Many Prop Values

  • Modify Embed One Prop Value

  • Modify Embed One Prop Values

  • Modify Multiple Connection Edge Prop Values

  • Modify Multiple Embed Many Prop Values

  • Modify Prop Value

  • Modify Prop Values

  • Replace Existing Edge

  • Set New Connection Edges

  • Set New Edge

  • Set New Embed Manies

  • Set New Embed One

  • Set or Delete Connection Edges

This list is abbreviated — the current list of available commands can be found in the command metadata.

Examples

Create a Company Post

This example creates a new Post, using the "Company" Variant Form, specifying the name field.

Create an Article Post

This example creates a new Post, using the "Post" Variant Form, specifying the title and the display type of Article.

Multiple display types are available for Post entities, including Article, News, Blog, and more.

For a complete list, review the Entity Form metadata from the Entity Metadata endpoint.

Modify Product Post: Add Company

This example modifies an existing Product Post to set the company edge.

Modify Product Post: Replace Company

This example modifies an existing Product Post to replace the company edge's related node.

Create a Website Channel

This example creates a new Website Channel, specifying the asset and root domain URLs.

Create an Email Channel Deployment

This example creates a new Email Channel Deployment, using the "Omeda" Variant Form, specifying the day, name, and subject line fields, and adding the Email Channel as a related edge.

Pause an Email Advertising Channel Automation Job

This example modifies the embedded Automation Config of an Advertising Email Channel to pause execution of recurring Email Automation Jobs.

Create a Root Website Channel Topic

This example creates a new Website Channel Topic, using the Root Variant Form, specifying the name and slug fields, and setting the website channel edge.

Create a Child Website Channel Topic

This example creates a new Website Channel Topic, using the Child Variant Form, specifying the name and slug fields, and setting the parent edge.

Last updated