---
updatedAt: 2025-09-24T21:20:00.000Z
agentTools:
  projectIndex: https://www.getmason.dev/llms.txt
---

# Creative Task

Post creative generation task. It receives creative task creation requests and processes them asynchronously and returns batch id of the task

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Task API",
    "version": "0.1.0"
  },
  "paths": {
    "/v1/task/creative": {
      "post": {
        "tags": [
          "Images"
        ],
        "summary": "Creative Task",
        "description": "Post creative generation task. It receives creative task creation requests and processes them asynchronously and returns batch id of the task",
        "operationId": "Creative_task_v1_task_creative_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreativeTaskModel"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Creative generation task response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreativeTaskResponse"
                },
                "examples": {
                  "response": {
                    "value": {
                      "status": "<IN_PROCESS>",
                      "batch_id": "<batch_id>",
                      "duplicate_tasks": {
                        "count": 2,
                        "ids": [
                          {
                            "task_id": "task1",
                            "batch_id": "<>"
                          },
                          {
                            "task_id": "task2",
                            "batch_id": "<>"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Unauthorized call to the API",
            "content": {
              "application/json": {
                "examples": {
                  "response": {
                    "value": {
                      "status": "error",
                      "message": "task_id is not present in one or more creative data"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized call to the API",
            "content": {
              "application/json": {
                "examples": {
                  "response": {
                    "value": {
                      "status": "error",
                      "message": "Authentication check failed. Please check the Authorization header"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CreativeTaskModel": {
        "properties": {
          "count": {
            "type": "integer",
            "title": "count: Count",
            "description": "Total number of creative sent in the data json"
          },
          "data": {
            "items": {},
            "type": "array",
            "title": "data: Data",
            "description": "List of creative input object"
          }
        },
        "type": "object",
        "required": [
          "count",
          "data"
        ],
        "title": "CreativeTaskModel"
      },
      "CreativeTaskResponse": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "batch_id": {
            "type": "string",
            "title": "Batch Id"
          },
          "duplicate_tasks": {
            "$ref": "#/components/schemas/DuplicateTaskIdResponse"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "title": "CreativeTaskResponse"
      },
      "DuplicateTaskIdResponse": {
        "properties": {
          "count": {
            "type": "integer",
            "title": "Count"
          },
          "ids": {
            "items": {
              "$ref": "#/components/schemas/DuplicateTaskIds"
            },
            "type": "array",
            "title": "Ids"
          }
        },
        "type": "object",
        "required": [
          "count",
          "ids"
        ],
        "title": "DuplicateTaskIdResponse"
      },
      "DuplicateTaskIds": {
        "properties": {
          "task_id": {
            "type": "string",
            "title": "Task Id"
          },
          "batch_id": {
            "type": "string",
            "title": "Batch Id"
          }
        },
        "type": "object",
        "required": [
          "task_id",
          "batch_id"
        ],
        "title": "DuplicateTaskIds"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    }
  },
  "servers": [
    {
      "url": "https://api.getmason.io"
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```