{
	"openapi": "3.1.0",
	"info": {
		"title": "Manus Integrations API",
		"description": "API for integrating Manus into your workflow.",
		"version": "1.0.0"
	},
	"servers": [
		{
			"url": "https://api.manus.ai"
		}
	],
	"security": [
		{
			"bearerAuth": []
		}
	],
	"paths": {
		"/v1/files": {
			"get": {
				"summary": "ListFiles",
				"description": "Retrieves a list of the 10 most recently uploaded files.",
				"operationId": "openapi.v1.OpenapiOauthService.ListFiles",
				"responses": {
					"200": {
						"description": "Files retrieved successfully.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"object": {
											"type": "string",
											"description": "Always \"list\""
										},
										"data": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/File"
											},
											"description": "Array of file objects (max 10)"
										}
									}
								}
							}
						}
					}
				}
			},
			"post": {
				"summary": "CreateFile",
				"description": "Creates a file record and returns a presigned URL for uploading the file content to S3.",
				"operationId": "openapi.v1.OpenapiOauthService.CreateFile",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"filename": {
										"type": "string",
										"description": "Name of the file to upload"
									}
								},
								"required": [
									"filename"
								]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "File record created successfully.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/FileCreate"
								}
							}
						}
					}
				}
			}
		},
		"/v1/files/{file_id}": {
			"get": {
				"summary": "RetrieveFile",
				"description": "Retrieves details of a specific file by ID.",
				"operationId": "openapi.v1.OpenapiOauthService.RetrieveFile",
				"parameters": [
					{
						"name": "file_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"description": "The ID of the file to retrieve"
						}
					}
				],
				"responses": {
					"200": {
						"description": "File retrieved successfully.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/File"
								}
							}
						}
					},
					"404": {
						"description": "File not found or has been deleted.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"code": {
											"type": "integer",
											"example": 5
										},
										"message": {
											"type": "string",
											"example": "file not found or has been deleted"
										},
										"details": {
											"type": "array",
											"items": {},
											"example": []
										}
									}
								}
							}
						}
					}
				}
			},
			"delete": {
				"summary": "DeleteFile",
				"description": "Deletes a file by ID. This removes both the file record and the file from S3 storage.",
				"operationId": "openapi.v1.OpenapiOauthService.DeleteFile",
				"parameters": [
					{
						"name": "file_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"description": "The ID of the file to delete"
						}
					}
				],
				"responses": {
					"200": {
						"description": "File deleted successfully.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"id": {
											"type": "string",
											"description": "The ID of the deleted file"
										},
										"object": {
											"type": "string",
											"description": "Always \"file.deleted\""
										},
										"deleted": {
											"type": "boolean",
											"description": "Always true if successful"
										}
									}
								}
							}
						}
					},
					"404": {
						"description": "File not found or has been deleted.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"code": {
											"type": "integer",
											"example": 5
										},
										"message": {
											"type": "string",
											"example": "file not found or has been deleted"
										},
										"details": {
											"type": "array",
											"items": {},
											"example": []
										}
									}
								}
							}
						}
					}
				}
			}
		},
		"/v1/tasks": {
			"get": {
				"summary": "GetTasks",
				"description": "Retrieves a list of tasks with optional filtering and pagination.",
				"operationId": "openapi.v1.OpenapiOauthService.GetTasks",
				"parameters": [
					{
						"name": "after",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Cursor for pagination. ID of the last task from the previous page."
						}
					},
					{
						"name": "limit",
						"in": "query",
						"schema": {
							"type": "integer",
							"format": "int32",
							"description": "Maximum number of tasks to return. Default: 100, Range: 1-1000."
						}
					},
					{
						"name": "order",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Sort direction: \"asc\" or \"desc\". Default: \"desc\"."
						}
					},
					{
						"name": "orderBy",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Sort field: \"created_at\" or \"updated_at\". Default: \"created_at\"."
						}
					},
					{
						"name": "query",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Search term to filter by title and body content."
						}
					},
					{
						"name": "status",
						"in": "query",
						"schema": {
							"type": "array",
							"items": {
								"type": "string"
							},
							"description": "Filter by task status: \"pending\", \"running\", \"completed\", \"failed\"."
						}
					},
					{
						"name": "createdAfter",
						"in": "query",
						"schema": {
							"type": "integer",
							"format": "int64",
							"description": "Filter tasks created after this Unix timestamp (seconds)."
						}
					},
					{
						"name": "createdBefore",
						"in": "query",
						"schema": {
							"type": "integer",
							"format": "int64",
							"description": "Filter tasks created before this Unix timestamp (seconds)."
						}
					},
					{
						"name": "project_id",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Filter tasks by project ID. Returns only tasks belonging to the specified project."
						}
					}
				],
				"responses": {
					"200": {
						"description": "Tasks retrieved successfully.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"object": {
											"type": "string",
											"description": "Always \"list\""
										},
										"data": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/Task"
											}
										},
										"first_id": {
											"type": "string",
											"description": "ID of the first task in the list"
										},
										"last_id": {
											"type": "string",
											"description": "ID of the last task in the list (use as 'after' for next page)"
										},
										"has_more": {
											"type": "boolean",
											"description": "Whether there are more tasks available"
										}
									}
								}
							}
						}
					}
				}
			},
			"post": {
				"summary": "CreateTask",
				"description": "Creates a new task.",
				"operationId": "openapi.v1.OpenapiOauthService.CreateTask",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"prompt": {
										"type": "string",
										"title": "prompt",
										"description": "The task prompt or instruction for the Manus agent. Limited to approximately 5,000 estimated tokens; the exact character count varies by language and content.",
										"example": "Write a function to calculate fibonacci numbers"
									},
									"attachments": {
										"type": "array",
										"items": {
											"oneOf": [
												{
													"type": "object",
													"title": "File ID Attachment",
													"properties": {
														"filename": {
															"type": "string",
															"description": "Name of the file attachment"
														},
														"file_id": {
															"type": "string",
															"description": "ID of a previously uploaded file (via POST /v1/files)"
														},
													},
													"required": [
														"filename",
														"file_id"
													]
												},
												{
													"type": "object",
													"title": "URL Attachment",
													"properties": {
														"filename": {
															"type": "string",
															"description": "Name of the file attachment"
														},
														"url": {
															"type": "string",
															"description": "Publicly accessible URL to a file or image"
														},
														"mimeType": {
															"type": "string",
															"description": "MIME type of the file (optional)"
														}
													},
													"required": [
														"filename",
														"url"
													]
												},
												{
													"type": "object",
													"title": "Base64 Data Attachment",
													"properties": {
														"filename": {
															"type": "string",
															"description": "Name of the file attachment"
														},
														"fileData": {
															"type": "string",
															"description": "Base64 encoded file/image data in format: 'data:<mime_type>;base64,<encoded_content>'"
														}
													},
													"required": [
														"filename",
														"fileData"
													]
												}
											]
										},
										"title": "attachments",
										"description": "Array of file/image attachments. No distinction between files and images - both are treated the same way."
									},
									"taskMode": {
										"type": "string",
										"enum": [
											"chat",
											"adaptive",
											"agent"
										],
										"title": "task_mode",
										"deprecated": true,
										"description": "Deprecated. This parameter is no longer used. All tasks default to agent mode."
									},
									"connectors": {
										"type": "array",
										"items": {
											"type": "string"
										},
										"title": "connectors",
										"description": "List of connector IDs to enable for this task. Only connectors already configured in the user's account can be used."
									},
									"hideInTaskList": {
										"type": "boolean",
										"title": "hide_in_task_list",
										"description": "Whether to hide this task from the Manus webapp task list. The task will still be accessible via the provided link."
									},
									"createShareableLink": {
										"type": "boolean",
										"title": "create_shareable_link",
										"description": "Whether to make the chat publicly accessible to others on the Manus website."
									},
									"taskId": {
										"type": "string",
										"title": "task_id",
										"description": "For continuing existing tasks (multi-turn)"
									},
									"agentProfile": {
										"type": "string",
										"enum": [
											"manus-1.6",
											"manus-1.6-lite",
											"manus-1.6-max"
										],
										"title": "agent_profile",
										"description": "manus-1.6, manus-1.6-lite, or manus-1.6-max",
										"default": "manus-1.6"
									},
									"locale": {
										"type": "string",
										"title": "locale",
										"description": "Your default locale that you've set on Manus (e.g., \"en-US\", \"zh-CN\")"
									},
									"projectId": {
										"type": "string",
										"title": "project_id",
										"description": "ID of the project to associate this task with. The project's instruction will be applied to the task."
									},
									"interactiveMode": {
										"type": "boolean",
										"title": "interactive_mode",
										"description": "Enable interactive mode to allow Manus to ask follow-up questions when input is insufficient. Default: false (no follow-up questions)."
									}
								},
								"required": [
									"prompt",
									"agentProfile"
								],
								"additionalProperties": false,
								"example": {
									"prompt": "Write a function to calculate fibonacci numbers",
									"agentProfile": "manus-1.6"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "Task created successfully.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"task_id": {
											"type": "string",
											"title": "task_id"
										},
										"task_title": {
											"type": "string",
											"title": "task_title"
										},
										"task_url": {
											"type": "string",
											"title": "task_url"
										},
										"share_url": {
											"type": "string",
											"title": "share_url",
											"description": "Optional publicly accessible link to the chat. Only present if create_shareable_link was set to true."
										}
									},
									"additionalProperties": false
								}
							}
						}
					}
				}
			}
		},
		"/v1/projects": {
			"get": {
				"summary": "ListProjects",
				"description": "Retrieves a list of all projects in your account.",
				"operationId": "openapi.v1.OpenapiOauthService.ListProjects",
				"parameters": [
					{
						"name": "limit",
						"in": "query",
						"schema": {
							"type": "integer",
							"format": "int32",
							"description": "Maximum number of projects to return. Default: 100, Range: 1-1000."
						}
					}
				],
				"responses": {
					"200": {
						"description": "Projects retrieved successfully.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"data": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/Project"
											}
										}
									}
								}
							}
						}
					}
				}
			},
			"post": {
				"summary": "CreateProject",
				"description": "Creates a new project to organize tasks and apply consistent instructions.",
				"operationId": "openapi.v1.OpenapiOauthService.CreateProject",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"name": {
										"type": "string",
										"description": "Name of the project"
									},
									"instruction": {
										"type": "string",
										"description": "Default instruction that will be applied to all tasks in this project"
									}
								},
								"required": [
									"name"
								]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "Project created successfully.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Project"
								}
							}
						}
					}
				}
			}
		},
		"/v1/webhooks": {
			"post": {
				"summary": "CreateWebhook",
				"description": "Creates a new webhook.",
				"operationId": "openapi.v1.OpenapiOauthService.CreateWebhook",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"webhook": {
										"type": "object",
										"properties": {
											"url": {
												"type": "string"
											}
										},
										"required": [
											"url"
										]
									}
								},
								"required": [
									"webhook"
								]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "Webhook created successfully.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"webhook_id": {
											"type": "string"
										}
									}
								}
							}
						}
					}
				}
			}
		},
		"/v1/tasks/{task_id}": {
			"get": {
				"summary": "GetTask",
				"description": "Retrieves details of a specific task by ID.",
				"operationId": "openapi.v1.OpenapiOauthService.GetTask",
				"parameters": [
					{
						"name": "task_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"description": "The ID of the task to retrieve"
						}
					},
					{
						"name": "convert",
						"in": "query",
						"schema": {
							"type": "boolean",
							"default": false,
							"description": "Whether to convert the task output. Currently only applies for pptx files."
						}
					}
				],
				"responses": {
					"200": {
						"description": "Task retrieved successfully.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Task"
								}
							}
						}
					}
				}
			},
			"put": {
				"summary": "UpdateTask",
				"description": "Updates a task's metadata.",
				"operationId": "openapi.v1.OpenapiOauthService.UpdateTask",
				"parameters": [
					{
						"name": "task_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"description": "The ID of the task to update"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"title": {
										"type": "string",
										"description": "New title for the task"
									},
									"enableShared": {
										"type": "boolean",
										"description": "Whether to enable public sharing"
									},
									"enableVisibleInTaskList": {
										"type": "boolean",
										"description": "Whether the task should be visible in the task list"
									}
								},
								"additionalProperties": false
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "Task updated successfully.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"task_id": {
											"type": "string"
										},
										"task_title": {
											"type": "string"
										},
										"task_url": {
											"type": "string"
										},
										"share_url": {
											"type": "string",
											"description": "Public share URL if sharing is enabled"
										}
									}
								}
							}
						}
					}
				}
			},
			"delete": {
				"summary": "DeleteTask",
				"description": "Deletes a task by ID.",
				"operationId": "openapi.v1.OpenapiOauthService.DeleteTask",
				"parameters": [
					{
						"name": "task_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"description": "The ID of the task to delete"
						}
					}
				],
				"responses": {
					"200": {
						"description": "Task deleted successfully.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"id": {
											"type": "string",
											"description": "The ID of the deleted task"
										},
										"object": {
											"type": "string",
											"description": "Always \"task.deleted\""
										},
										"deleted": {
											"type": "boolean",
											"description": "Always true if successful"
										}
									}
								}
							}
						}
					}
				}
			}
		},
		"/v1/webhooks/{webhook_id}": {
			"delete": {
				"summary": "DeleteWebhook",
				"description": "Deletes a webhook.",
				"operationId": "openapi.v1.OpenapiOauthService.DeleteWebhook",
				"parameters": [
					{
						"name": "webhook_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string"
						}
					}
				],
				"responses": {
					"204": {
						"description": "Webhook deleted successfully."
					}
				}
			}
		}
	},
	"components": {
		"securitySchemes": {
			"bearerAuth": {
				"type": "apiKey",
				"in": "header",
				"name": "API_KEY"
			}
		},
		"schemas": {
			"File": {
				"type": "object",
				"properties": {
					"id": {
						"type": "string",
						"description": "Unique identifier for the file"
					},
					"object": {
						"type": "string",
						"description": "Always \"file\""
					},
					"filename": {
						"type": "string",
						"description": "Name of the file"
					},
					"status": {
						"type": "string",
						"enum": [
							"pending",
							"uploaded",
							"deleted"
						],
						"description": "Current status of the file"
					},
					"created_at": {
						"type": "string",
						"format": "date-time",
						"description": "ISO 8601 timestamp when the file was created"
					}
				}
			},
			"FileCreate": {
				"type": "object",
				"properties": {
					"id": {
						"type": "string",
						"description": "Unique identifier for the file"
					},
					"object": {
						"type": "string",
						"description": "Always \"file\""
					},
					"filename": {
						"type": "string",
						"description": "Name of the file"
					},
					"status": {
						"type": "string",
						"description": "Initial status is \"pending\""
					},
					"upload_url": {
						"type": "string",
						"description": "Presigned S3 URL for uploading the file content (PUT request)"
					},
					"upload_expires_at": {
						"type": "string",
						"format": "date-time",
						"description": "ISO 8601 timestamp when the upload URL expires"
					},
					"created_at": {
						"type": "string",
						"format": "date-time",
						"description": "ISO 8601 timestamp when the file record was created"
					}
				}
			},
			"Task": {
				"type": "object",
				"properties": {
					"id": {
						"type": "string",
						"description": "Unique identifier for the task"
					},
					"object": {
						"type": "string",
						"description": "Always \"task\""
					},
					"created_at": {
						"type": "integer",
						"format": "int64",
						"description": "Unix timestamp (seconds) when the task was created"
					},
					"updated_at": {
						"type": "integer",
						"format": "int64",
						"description": "Unix timestamp (seconds) when the task was last updated"
					},
					"status": {
						"type": "string",
						"enum": [
							"pending",
							"running",
							"completed",
							"failed"
						],
						"description": "Current status of the task"
					},
					"error": {
						"type": "string",
						"description": "Error message if the task failed (optional)"
					},
					"incomplete_details": {
						"type": "string",
						"description": "Details about why the task is incomplete (optional)"
					},
					"instructions": {
						"type": "string",
						"description": "The original prompt/instructions for the task (optional)"
					},
					"max_output_tokens": {
						"type": "integer",
						"format": "int32",
						"description": "Maximum output tokens limit (optional)"
					},
					"model": {
						"type": "string",
						"description": "Model used for the task"
					},
					"metadata": {
						"type": "object",
						"properties": {
							"task_title": {
								"type": "string",
								"description": "Title of the task"
							},
							"task_url": {
								"type": "string",
								"description": "URL to view the task in Manus app (e.g., https://manus.im/app/cvL57MT3sh2McZRjTog8MZ)"
							}
						},
						"additionalProperties": {
							"type": "string"
						},
						"description": "Metadata containing task information and optional custom key-value pairs"
					},
					"output": {
						"type": "array",
						"items": {
							"$ref": "#/components/schemas/TaskMessage"
						},
						"description": "Array of task messages (conversation history)"
					},
					"locale": {
						"type": "string",
						"description": "User's preferred locale (optional)"
					},
					"credit_usage": {
						"type": "integer",
						"format": "int32",
						"description": "Credits consumed by this task (optional)"
					}
				}
			},
			"TaskMessage": {
				"type": "object",
				"properties": {
					"id": {
						"type": "string",
						"description": "Unique identifier for the message"
					},
					"status": {
						"type": "string",
						"description": "Status of the message"
					},
					"role": {
						"type": "string",
						"enum": [
							"user",
							"assistant"
						],
						"description": "Role of the message sender - \"assistant\" or \"user\""
					},
					"type": {
						"type": "string",
						"description": "Type here is \"message\""
					},
					"content": {
						"type": "array",
						"items": {
							"$ref": "#/components/schemas/MessageContent"
						},
						"description": "Array of message content items (text or files)"
					}
				}
			},
			"MessageContent": {
				"type": "object",
				"properties": {
					"type": {
						"type": "string",
						"enum": [
							"output_text",
							"output_file"
						],
						"description": "Content type - \"output_text\" or \"output_file\""
					},
					"text": {
						"type": "string",
						"description": "Text content (for output_text type)"
					},
					"fileUrl": {
						"type": "string",
						"description": "File URL (for output_file type)"
					},
					"fileName": {
						"type": "string",
						"description": "File name (for output_file type)"
					},
					"mimeType": {
						"type": "string",
						"description": "MIME type of the file (for output_file type)"
					}
				}
			},
			"Project": {
				"type": "object",
				"properties": {
					"id": {
						"type": "string",
						"description": "Unique identifier for the project"
					},
					"name": {
						"type": "string",
						"description": "Name of the project"
					},
					"instruction": {
						"type": "string",
						"description": "Default instruction applied to all tasks in this project"
					},
					"created_at": {
						"type": "integer",
						"format": "int64",
						"description": "Unix timestamp (seconds) when the project was created"
					}
				}
			}
		}
	}
}
