Task: Execute Action
Overview
- API:
POST /mj/submit/action - Description: Trigger various button actions related to images (e.g., UPSCALE, VARIATION, REROLL, ZOOM, etc.).
- Content-Type:
application/json
Authentication
- Use HTTP Bearer Token, Example:
Authorization: Bearer sk-xxxxx
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| taskId | string | Yes | Original drawing task ID, indicating the task to perform the action on |
| customId | string | Yes | Action identifier. Platform may use composite customId to specify action and parameters, e.g. MJ::JOB::upsample::2::... |
| notifyHook | string | No | Callback URL; if empty, uses global notifyHook |
| state | string | No | Custom passthrough parameter for callbacks or task tracking |
Recommended field order: taskId, customId, notifyHook, state.
Request Example
json
{
"customId": "MJ::JOB::upsample::2::3dbbd469-36af-4a0f-8f02-df6c579e7011",
"taskId": "1725017986212425",
"notifyHook": "",
"state": "exec-001"
}curl
bash
curl -X POST "https://api.gpt.ge/mj/submit/action" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-xxxx" \
-d '{"customId":"MJ::JOB::upsample::2::3dbbd469-36af-4a0f-8f02-df6c579e7011","taskId":"1725017986212425","notifyHook":"","state":"exec-001"}'JavaScript (fetch)
javascript
fetch('https://api.gpt.ge/mj/submit/action', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer sk-xxxx' },
body: JSON.stringify({ customId: 'MJ::JOB::upsample::2::3dbbd469-36af-4a0f-8f02-df6c579e7011', taskId: '1725017986212425', notifyHook: '', state: 'exec-001' })
}).then(r => r.json()).then(console.log)Python (requests)
python
import requests
payload = {
'customId': 'MJ::JOB::upsample::2::3dbbd469-36af-4a0f-8f02-df6c579e7011',
'taskId': '1725017986212425',
'notifyHook': '',
'state': 'exec-001'
}
resp = requests.post('https://api.gpt.ge/mj/submit/action', headers={'Content-Type':'application/json','Authorization':'Bearer sk-xxxx'}, json=payload)
print(resp.json())Response Example (200)
json
{
"code": 1,
"description": "Submit success",
"result": "1725017986212425",
"properties": {
"discordChannelId": "1278917486263402612",
"discordInstanceId": "1550466896007176192"
}
}