Skip to main content
POST
/
mj
/
submit
/
edits
cURL
curl https://api.cometapi.com/mj/submit/edits \
  -H "Authorization: Bearer $COMETAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Change to white background",
    "image": "https://your-image-host/source.png"
  }'
{
  "code": 123,
  "description": "<string>",
  "result": "<string>"
}
Use this endpoint to edit a Midjourney image with a mask, or to generate a transparent-background result from a prompt plus source image.

Two common modes

  • Masked edit: send maskBase64 plus prompt, and optionally the original image
  • Transparent drawing: send image plus prompt when you want a transparent-background result without a separate mask

Task flow

1

Submit the editor task

Choose the editing mode, send the prompt and source data, then store the returned task id.
2

Poll the task

Use Fetch Single Task until the task reaches a terminal state.
3

Continue from the result

Use the final asset directly, or trigger Action when the edited result exposes follow-up buttons.

Authorizations

Authorization
string
header
required

Bearer token authentication. Use your CometAPI key.

Body

application/json
prompt
string
default:Change to white background
required

Text prompt describing the desired edit.

image
string
default:https://your-image-host/source.png
required

Image to edit. Pass a public URL or a base64-encoded data URI.

state
string

Custom state string. Returned as-is in the task result and webhook callback for your own tracking.

notifyHook
string

Webhook URL to receive task status updates. Falls back to your account-level webhook if omitted.

noStorage
boolean

When true, return the original provider image URL instead of a CometAPI-proxied link.

Response

200 - application/json

Success

code
integer

Submission status code. 1 = submitted successfully (result carries the task id). 21 = the action opened a confirmation modal; continue with /mj/submit/modal using the returned task id. 4 = parameter error; description explains the cause.

description
string
result
string