Midjourney Task Module¶
Feature Description
The API prefix is uniformly http(s)://<your-domain>
HTTPS should be used in production environments to secure authentication tokens. HTTP is only recommended for development environments.
A management system for image generation tasks. It supports task status tracking, progress monitoring, result viewing, and other functions. It includes image URL forwarding and a backend polling update mechanism.
🔐 User Authentication¶
Retrieve Own MJ Tasks¶
- Interface Name: Retrieve Own MJ Tasks
- HTTP Method: GET
- Path:
/api/mj/self
- Authentication Requirement: User
- Function Summary: Paginates and retrieves the current user's Midjourney task list, supporting filtering by task ID and time range.
💡 Request Example:
const response = await fetch('/api/mj/self?p=1&page_size=20&mj_id=task123&start_timestamp=1640908800&end_timestamp=1640995200', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your_user_token',
'New-Api-User': 'Bearer your_user_id'
}
});
const data = await response.json();
✅ Successful Response Example:
{
"success": true,
"message": "",
"data": {
"items": [
{
"id": 1,
"mj_id": "task123456",
"action": "IMAGINE",
"prompt": "a beautiful landscape",
"prompt_en": "a beautiful landscape",
"status": "SUCCESS",
"progress": "100%",
"image_url": "https://example.com/image.jpg",
"video_url": "https://example.com/video.mp4",
"video_urls": "[\"https://example.com/video1.mp4\"]",
"submit_time": 1640908800,
"start_time": 1640909000,
"finish_time": 1640909200,
"fail_reason": "",
"quota": 1000
}
],
"total": 25,
"page": 1,
"page_size": 20
}
}
❗ Failed Response Example:
🧾 Field Descriptions:
p
(Number): Page number, defaults to 1page_size
(Number): Items per page, defaults to 20mj_id
(String): Task ID filter, optionalstart_timestamp
(Number): Start timestamp, optionalend_timestamp
(Number): End timestamp, optional-
Response Field Descriptions:
id
(Number): Database record IDmj_id
(String): Midjourney task unique identifieraction
(String): Operation type, such as IMAGINE, UPSCALE, etc.prompt
(String): Original promptprompt_en
(String): English promptstatus
(String): Task status midjourney.go: 19progress
(String): Completion progress percentageimage_url
(String): Generated image URLvideo_url
(String): Generated video URLvideo_urls
(String): JSON array string of multiple video URLssubmit_time
(Number): Submission timestampstart_time
(Number): Start processing timestampfinish_time
(Number): Finish timestampfail_reason
(String): Failure reasonquota
(Number): Consumed quota
🔐 Administrator Authentication¶
Retrieve All MJ Tasks¶
- Interface Name: Retrieve All MJ Tasks
- HTTP Method: GET
- Path:
/api/mj/
- Authentication Requirement: Administrator
- Function Summary: Paginates and retrieves all Midjourney tasks in the system, supporting filtering by Channel ID, Task ID, and time range.
💡 Request Example:
const response = await fetch('/api/mj/?p=1&page_size=20&channel_id=1&mj_id=task123&start_timestamp=1640908800&end_timestamp=1640995200', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your_admin_token',
'New-Api-User': 'Bearer your_user_id'
}
});
const data = await response.json();
✅ Successful Response Example:
{
"success": true,
"message": "",
"data": {
"items": [
{
"id": 1,
"user_id": 1,
"mj_id": "task123456",
"action": "IMAGINE",
"prompt": "a beautiful landscape",
"status": "SUCCESS",
"progress": "100%",
"image_url": "https://example.com/image.jpg",
"channel_id": 1,
"quota": 1000,
"submit_time": 1640908800,
"finish_time": 1640909200
}
],
"total": 100,
"page": 1,
"page_size": 20
}
}
❗ Failed Response Example:
🧾 Field Descriptions:
p
(Number): Page number, defaults to 1page_size
(Number): Items per page, defaults to 20channel_id
(String): Channel ID filter, optionalmj_id
(String): Task ID filter, optionalstart_timestamp
(String): Start timestamp, optionalend_timestamp
(String): End timestamp, optional-
Response fields include all fields from the user's own tasks, plus the following additions:
user_id
(Number): User ID associated with the taskchannel_id
(Number): Channel ID used