> ## Documentation Index
> Fetch the complete documentation index at: https://apidoc.deerapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Midjourney Submit Action

> Use DeerAPI to call the Midjourney Submit Action endpoint with request details, response details, examples, and an OpenAPI playground.

## Overview

Use this endpoint to call the Midjourney Submit Action workflow through DeerAPI. The API reference on this page shows the request schema, response schema, authentication requirements, and runnable examples for the configured endpoint.

## Before you start

Use the DeerAPI base URL and pass your API Key in the `Authorization` header:

```text theme={null}
https://api.deerapi.com
```

```text theme={null}
Authorization: Bearer $DEERAPI_KEY
```

## Model selection

Choose a current model ID from the [live pricing page](https://api.deerapi.com/pricing). Model availability changes over time, so avoid copying a model ID from an old project without checking the live list first.

## Implementation notes

* Use the OpenAPI playground for the exact request fields accepted by this endpoint.
* Keep API Keys on the server side when you build production applications.
* Log the request ID from failed calls so support can investigate the request.
* Retry `429`, `500`, and `503` responses with exponential backoff.


## OpenAPI

````yaml /api/openapi/image/midjourney/post-submit-action.openapi.json POST /mj/submit/action
openapi: 3.1.0
info:
  title: Action API
  version: 1.0.0
  description: >-
    Create a Midjourney follow-up task such as upscale, variation, reroll, zoom,
    or pan using the latest button customId from the fetch response.
servers:
  - url: https://api.deerapi.com
security:
  - bearerAuth: []
paths:
  /mj/submit/action:
    post:
      summary: Create a Midjourney follow-up action task
      operationId: action
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - customId
                - taskId
              properties:
                customId:
                  type: string
                  description: >-
                    Action id taken from the latest `buttons` array returned by
                    the fetch endpoint.
                taskId:
                  type: string
                  description: Midjourney task id you want to continue from.
                state:
                  type: string
                  description: >-
                    Custom state string. Returned as-is in the task result and
                    webhook callback for your own tracking.
                enableRemix:
                  type: boolean
                  description: >-
                    Whether to force remix mode when the current action supports
                    it.
                chooseSameChannel:
                  type: boolean
                  description: >-
                    Whether to prefer the same channel account used by the
                    current task.
              default:
                customId: MJ::JOB::variation::3::example
                taskId: '1773314942177684'
                enableRemix: false
            example:
              customId: MJ::JOB::variation::3::example
              taskId: '1773314942177684'
              enableRemix: false
            examples:
              Default:
                summary: Default request
                value:
                  customId: MJ::JOB::variation::3::example
                  taskId: '1773314942177684'
                  enableRemix: false
      responses:
        '200':
          description: Action task accepted.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - description
                  - result
                properties:
                  code:
                    type: integer
                  description:
                    type: string
                  result:
                    type: string
                    description: New Midjourney task id created for the action.
                  properties:
                    type: object
                    properties:
                      numberOfQueues:
                        type: integer
                      discordInstanceId:
                        type: string
                      discordChannelId:
                        type: string
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl https://api.deerapi.com/mj/submit/action \
              -H "Content-Type: application/json" \
              -H "Authorization: Bearer $DEERAPI_KEY" \
              -d '{
                "customId": "MJ::JOB::variation::3::example",
                "taskId": "1773314942177684",
                "enableRemix": false
              }'
        - lang: Python
          label: requests
          source: |
            import os
            import requests

            url = "https://api.deerapi.com/mj/submit/action"
            headers = {
                "Authorization": "Bearer " + os.environ["DEERAPI_KEY"],
                "Content-Type": "application/json",
            }
            payload = {
              "customId": "MJ::JOB::variation::3::example",
              "taskId": "1773314942177684",
              "enableRemix": false
            }

            response = requests.post(url, headers=headers, json=payload)
            print(response.json())
        - lang: JavaScript
          label: fetch
          source: >
            const response = await
            fetch("https://api.deerapi.com/mj/submit/action", {
              method: "POST",
              headers: {
                Authorization: `Bearer ${process.env.DEERAPI_KEY}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                "customId": "MJ::JOB::variation::3::example",
                "taskId": "1773314942177684",
                "enableRemix": false
              }),
            });


            console.log(await response.json());
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Use a DeerAPI API Key as a Bearer token.

````