curl --request POST \
--url https://api.motion.so/api/motion/automations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Daily update",
"prompt": "Create a short daily title animation.",
"trigger": {
"type": "schedule_recurring",
"platform": "schedule",
"label": "Every day",
"source": "Schedule",
"intervalMinutes": 1440
},
"execution": {
"engine": "gva",
"effort": "standard"
}
}
'import requests
url = "https://api.motion.so/api/motion/automations"
payload = {
"name": "Daily update",
"prompt": "Create a short daily title animation.",
"trigger": {
"type": "schedule_recurring",
"platform": "schedule",
"label": "Every day",
"source": "Schedule",
"intervalMinutes": 1440
},
"execution": {
"engine": "gva",
"effort": "standard"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Daily update',
prompt: 'Create a short daily title animation.',
trigger: {
type: 'schedule_recurring',
platform: 'schedule',
label: 'Every day',
source: 'Schedule',
intervalMinutes: 1440
},
execution: {engine: 'gva', effort: 'standard'}
})
};
fetch('https://api.motion.so/api/motion/automations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.motion.so/api/motion/automations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Daily update',
'prompt' => 'Create a short daily title animation.',
'trigger' => [
'type' => 'schedule_recurring',
'platform' => 'schedule',
'label' => 'Every day',
'source' => 'Schedule',
'intervalMinutes' => 1440
],
'execution' => [
'engine' => 'gva',
'effort' => 'standard'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.motion.so/api/motion/automations"
payload := strings.NewReader("{\n \"name\": \"Daily update\",\n \"prompt\": \"Create a short daily title animation.\",\n \"trigger\": {\n \"type\": \"schedule_recurring\",\n \"platform\": \"schedule\",\n \"label\": \"Every day\",\n \"source\": \"Schedule\",\n \"intervalMinutes\": 1440\n },\n \"execution\": {\n \"engine\": \"gva\",\n \"effort\": \"standard\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.motion.so/api/motion/automations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Daily update\",\n \"prompt\": \"Create a short daily title animation.\",\n \"trigger\": {\n \"type\": \"schedule_recurring\",\n \"platform\": \"schedule\",\n \"label\": \"Every day\",\n \"source\": \"Schedule\",\n \"intervalMinutes\": 1440\n },\n \"execution\": {\n \"engine\": \"gva\",\n \"effort\": \"standard\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.motion.so/api/motion/automations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Daily update\",\n \"prompt\": \"Create a short daily title animation.\",\n \"trigger\": {\n \"type\": \"schedule_recurring\",\n \"platform\": \"schedule\",\n \"label\": \"Every day\",\n \"source\": \"Schedule\",\n \"intervalMinutes\": 1440\n },\n \"execution\": {\n \"engine\": \"gva\",\n \"effort\": \"standard\"\n }\n}"
response = http.request(request)
puts response.read_body{
"automation": {
"id": "<string>",
"name": "<string>",
"enabled": true,
"prompt": "<string>",
"trigger": {
"type": "<string>",
"platform": "<string>",
"source": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"nextRunAt": "2023-11-07T05:31:56Z",
"runs": [
{
"id": "<string>",
"status": "queued",
"motionAgentChatId": "<string>",
"queuedAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"attempt": 123,
"resultSummary": "<string>",
"error": "<string>"
}
],
"memory": {
"rememberProcessedItems": true,
"includePreviousRuns": 10,
"compactAfterRuns": 52
},
"connectorPolicy": {
"mode": "none",
"onUnavailable": "block",
"grants": [
{
"connectorId": "github",
"access": "read",
"resources": [
"<string>"
],
"condition": {
"eventTypes": [
"schedule_once"
],
"payloadField": "<string>",
"equals": "<string>"
}
}
]
},
"maxConcurrentRuns": 123,
"maxRunsPerHour": 123
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Create an automation
Requires motion:automations:write for OAuth tokens. API keys use the owner account permissions. Automation access must be enabled for the account and environment. See /guides/automations. Automations execute only with GVA; Claude supports reads, pause, and delete only.
curl --request POST \
--url https://api.motion.so/api/motion/automations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Daily update",
"prompt": "Create a short daily title animation.",
"trigger": {
"type": "schedule_recurring",
"platform": "schedule",
"label": "Every day",
"source": "Schedule",
"intervalMinutes": 1440
},
"execution": {
"engine": "gva",
"effort": "standard"
}
}
'import requests
url = "https://api.motion.so/api/motion/automations"
payload = {
"name": "Daily update",
"prompt": "Create a short daily title animation.",
"trigger": {
"type": "schedule_recurring",
"platform": "schedule",
"label": "Every day",
"source": "Schedule",
"intervalMinutes": 1440
},
"execution": {
"engine": "gva",
"effort": "standard"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Daily update',
prompt: 'Create a short daily title animation.',
trigger: {
type: 'schedule_recurring',
platform: 'schedule',
label: 'Every day',
source: 'Schedule',
intervalMinutes: 1440
},
execution: {engine: 'gva', effort: 'standard'}
})
};
fetch('https://api.motion.so/api/motion/automations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.motion.so/api/motion/automations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Daily update',
'prompt' => 'Create a short daily title animation.',
'trigger' => [
'type' => 'schedule_recurring',
'platform' => 'schedule',
'label' => 'Every day',
'source' => 'Schedule',
'intervalMinutes' => 1440
],
'execution' => [
'engine' => 'gva',
'effort' => 'standard'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.motion.so/api/motion/automations"
payload := strings.NewReader("{\n \"name\": \"Daily update\",\n \"prompt\": \"Create a short daily title animation.\",\n \"trigger\": {\n \"type\": \"schedule_recurring\",\n \"platform\": \"schedule\",\n \"label\": \"Every day\",\n \"source\": \"Schedule\",\n \"intervalMinutes\": 1440\n },\n \"execution\": {\n \"engine\": \"gva\",\n \"effort\": \"standard\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.motion.so/api/motion/automations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Daily update\",\n \"prompt\": \"Create a short daily title animation.\",\n \"trigger\": {\n \"type\": \"schedule_recurring\",\n \"platform\": \"schedule\",\n \"label\": \"Every day\",\n \"source\": \"Schedule\",\n \"intervalMinutes\": 1440\n },\n \"execution\": {\n \"engine\": \"gva\",\n \"effort\": \"standard\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.motion.so/api/motion/automations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Daily update\",\n \"prompt\": \"Create a short daily title animation.\",\n \"trigger\": {\n \"type\": \"schedule_recurring\",\n \"platform\": \"schedule\",\n \"label\": \"Every day\",\n \"source\": \"Schedule\",\n \"intervalMinutes\": 1440\n },\n \"execution\": {\n \"engine\": \"gva\",\n \"effort\": \"standard\"\n }\n}"
response = http.request(request)
puts response.read_body{
"automation": {
"id": "<string>",
"name": "<string>",
"enabled": true,
"prompt": "<string>",
"trigger": {
"type": "<string>",
"platform": "<string>",
"source": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"nextRunAt": "2023-11-07T05:31:56Z",
"runs": [
{
"id": "<string>",
"status": "queued",
"motionAgentChatId": "<string>",
"queuedAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"attempt": 123,
"resultSummary": "<string>",
"error": "<string>"
}
],
"memory": {
"rememberProcessedItems": true,
"includePreviousRuns": 10,
"compactAfterRuns": 52
},
"connectorPolicy": {
"mode": "none",
"onUnavailable": "block",
"grants": [
{
"connectorId": "github",
"access": "read",
"resources": [
"<string>"
],
"condition": {
"eventTypes": [
"schedule_once"
],
"payloadField": "<string>",
"equals": "<string>"
}
}
]
},
"maxConcurrentRuns": 123,
"maxRunsPerHour": 123
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
Motion API key (motion_ prefix), authenticated as its owner. Account and engine permissions still apply.
Body
Creates an enabled automation. Defaults: GVA standard, memory {rememberProcessedItems:true,includePreviousRuns:5,compactAfterRuns:20}, no connectors, one concurrent run and four runs per hour. Creation is not idempotent; do not blindly repeat a request after a lost response.
1 - 160Self-contained instructions used for every future invocation.
1 - 20000Match platform to trigger type. Discover environment availability with GET /automations/capabilities.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Uses existing connected accounts and permissions; this request cannot connect an account or grant access.
Show child attributes
Show child attributes
1 <= x <= 101 <= x <= 100Supply engine or effort. Engine changes use the new engine default when effort is omitted.
Show child attributes
Show child attributes
video, text, auto Response
Success
Owner-scoped read view. Read responses can include additional saved context and history. Use the dedicated run-history endpoint for pagination. Read fields are not accepted as write inputs.
Show child attributes
Show child attributes
Was this page helpful?