A queued video-generation request can be cancelled through the dedicated cancel-or-delete task operation documented by the MiniMax Open Platform API. The application should first query the task, then call that dedicated operation with the task identifier and confirm the returned state rather than assuming that stopping a client-side poll has cancelled the server-side job. This distinction matters when a request is waiting in the queue after a prompt, reference image, parameter, or business rule has changed. Stopping a client-side polling loop only stops the client from waiting. It does not send a cancellation command to the platform, stop the queued workload, or create a terminal cancellation record. A replacement request can also coexist with the earlier task, so both may later produce results and both may be subject to the billing rules stated in the applicable official documentation. The practical answer is therefore operational rather than absolute: preserve the original task identifier, inspect the request state through the documented query interface, and document the decision to abandon or replace the task. If the old result is still acceptable, continue waiting for it. If it is no longer useful, request cancellation while it is still queued and confirm the outcome before deciding whether a replacement is needed. Running tasks cannot be cancelled through this operation. The article explains this contract, the smallest viable workflow for tracking a request, the cutover checks for replacing one, and the point where a human must decide whether duplicate work is acceptable. ## Other candidates to compare Runway offers video-generation tools and an API, providing another candidate alongside MiniMax. Compare the selected models on supported inputs, duration, resolution, task states and cost. Verify features such as end frames, cancellation and reference inputs individually rather than transferring one API’s behavior to another. ## 1. Environment and API contract The relevant interface is the MiniMax Open Platform video-generation API. A request is created through the video-generation endpoint, and the platform returns a task identifier that can be used with the query, list, and cancel-or-delete task operations. The task identifier is the stable reference for an asynchronous job; it should be stored with the request inputs, creation time, intended use, and any internal business identifier. The MiniMax Open Platform console is the relevant product entry point for the account using this API. For the international API, the documented status operation follows this form: GET https://api.minimax.io/v2/query/video_generation/{task_id} The request must be sent with the authentication required for the reader’s account and API region. Responses describe the task’s current state and the generated result when the task has completed. The state vocabulary includes queued or processing conditions and terminal success or failure conditions, so integrations should compare returned status values with the schema published for the applicable interface rather than infer a result from an HTTP response alone. The documented API surface separates task creation, task retrieval, task listing, and the dedicated cancel-or-delete task operation. A query request is read-only: it reports state and may also return the completed output URL or associated result data. To stop queued work, use the separate cancel-or-delete operation, then query the task again to verify the server-side result. This distinction also applies to local abstractions. A wrapper function named cancelVideo, a Boolean cancellation flag, or a stopped polling task may help an application ignore a result, but they are not substitutes for the dedicated server-side cancel-or-delete operation or a subsequent status query that confirms the resulting state. ## 2. Minimal input and observable outcome A minimal integration needs only enough information to create, track, and decide about one video request: | Item | Purpose | Required handling | |---|---|---| | Valid API credential | Authenticate the request | Keep it server-side and out of logs | | Video-generation inputs | Define the requested output | Store the exact submitted parameters | | Returned task_id | Identify the asynchronous task | Persist it with request metadata | | Documented query endpoint | Inspect current state | Check the response status and result fields | | Internal decision record | Explain why a task is retained or replaced | Record acceptance criteria before cutover | The observable outcome of a cancellation attempt is not merely that the client stopped polling. The application should record the cancel-or-delete response and then query the task to determine which of these outcomes applies: - The task is still waiting or processing and has no result yet. - The task completed successfully and exposes the expected result fields. - The task ended in failure and exposes an error or failed status. - The query itself failed, was rejected, or returned a response that does not match the expected schema. Those outcomes should map to different application states. Do not convert a missing result, an unreadable response, or a timeout into a cancellation. Keep the task identifier, record the last confirmed state, and retry the status operation according to the integration’s backoff policy. Retrying a query is operationally different from retrying video creation: repeating the creation call without controlling duplicate tasks can create additional jobs. A small internal record is often sufficient: request_id, task_id, submitted_inputs, current_status, last_checked_at, result_reference, and disposition The disposition field can remain active, awaiting_result, failed, or replaced_by_another_task. Avoid a cancelled value unless cancellation is supported by a documented interface and confirmed by the returned task state. This naming discipline prevents dashboards and support reports from claiming that queued work was stopped when the client merely stopped waiting. ## 3. Implementation workflow ### Step 1: Define what “replace” means before submission Start with the smallest set of corrected inputs needed for the new output. If the prompt or reference material changed, preserve the original request as an audit record but create a new task with the revised values. If only a downstream routing decision changed, the original generation request may still be usable; query it instead of creating unnecessary duplicate work. This decision belongs before submission because the creation operation starts an independent asynchronous unit of work. A replacement task does not inherit the queue position, task identity, or output of the earlier request. ### Step 2: Submit once and capture the returned identifier After integration and authentication, call the MiniMax video-generation API with the validated model, prompt or media inputs, and applicable generation parameters. Treat the response as meaningful only after checking that it contains a task identifier and conforms to the expected response schema. Store that identifier immediately, together with the inputs used for submission. If the creation response is ambiguous because the network fails after the request was sent, do not immediately resubmit the same creation payload. Query by any task identifier received and use an idempotency or reconciliation mechanism where the surrounding system supports one. Otherwise, a retry may create a second task while the first remains queued. ### Step 3: Poll with backoff and validate every response Use the documented query endpoint with the stored task identifier. Poll often enough to satisfy the application’s freshness requirement, but add backoff so that a long queue does not generate unnecessary traffic. Treat the response body as authoritative, not merely its HTTP status. A practical state mapping looks like this: | Returned condition | Application action | |---|---| | Queued or processing | Keep the task active and check again later | | Success with expected result fields | Retrieve or persist the result according to the application’s data policy | | Failure with an error field | Record the failure and apply the business retry policy | | Missing or unrecognised state | Log the response shape for compatibility review; do not fabricate a terminal state | | Query rejection or transport failure | Retry the query with backoff; do not recreate the generation task automatically | After integration and authentication, call the MiniMax video-generation API to query a queued task by its task identifier, and when cancellation is required, use the dedicated cancel-or-delete task operation and inspect the subsequent status response for confirmation. ### Step 4: Apply the decision rule Query the task before acting. If it has already reached a terminal state, retain that result and do not send a redundant cancellation request. If it is still queued or running and the output is no longer required, call the dedicated cancel-or-delete operation, then query the task again to confirm the resulting state. If cancellation is rejected or the state remains unchanged, follow the returned error or documented task-management path rather than creating an automatic replacement. This rule is more dependable than attempting to cancel because it acknowledges the actual interface boundary. It also gives the operator a defensible audit trail: the original task, the last confirmed state, the reason for replacement, and the identifier of the replacement task. ## 4. Cutover, rollback, and duplicate handling For a queued request that must be replaced, use the original task identifier as the baseline and the replacement task identifier as the cutover point. The cutover is not an instantaneous server-side handoff. It is an application decision to begin tracking a new task while the older task may continue independently. A controlled cutover sequence is: 1. Freeze the original inputs and retain its task identifier. 2. Confirm the last known state through the query operation. 3. Decide whether the original output remains usable. 4. Correct only the necessary inputs and submit one replacement task. 5. Confirm that the replacement response includes a new task identifier. 6. Track the replacement separately until it reaches a terminal state. 7. Reconcile both task records before closing the incident or change request. The rollback trigger should be explicit: return to the original task if the replacement cannot be submitted, if the replacement fails for a condition that does not affect the original, or if the replacement output violates requirements that the original still satisfies. Returning to the original does not cancel the replacement, so it may also require later reconciliation. If duplicate outputs or duplicate execution are unacceptable, the safest cutover is to avoid submitting the replacement and continue tracking the original. Never remove the original task identifier merely because a replacement was created. Removing it can conceal queued work, prevent later reconciliation, and make cost or resource reporting less accurate. The applicable official plan and billing information should determine how concurrent tasks are handled; the API status interface alone should not be used to infer financial treatment. ## 5. Verification and human judgement Automated checks can confirm that a request was accepted, that a task identifier exists, that a status response matches the expected schema, and that a terminal result contains the expected fields. They can also detect a task that remains queued for longer than the application’s operational threshold. They cannot decide whether an obsolete but technically successful video is still commercially useful. That final decision needs human or business criteria. A reviewer should compare the original and corrected inputs, the intended audience, whether the output can be edited or reused, the consequence of duplicate execution, and the cost policy that applies to the account. The reviewer should then record one of three decisions: retain and wait, replace while accepting concurrent work, or stop the replacement process and continue with the original task. The same principle applies to failure handling. A failed task does not automatically justify another submission. Check whether the failure is transient, whether the input was valid, whether the account has the required access, and whether the documentation identifies a corrective action. Avoid automatic task recreation when the cause is an invalid request or a policy restriction, because repeated calls can add more concurrent work without resolving the original error. ## 6. Models, tools, and applicable boundaries Model choice affects the video request, but it does not change the cancellation contract described here. The model identifier, modality, supported parameters, and regional availability should be checked against the official documentation for the target account. The task tracking workflow should remain separate from those choices so that a later model change does not alter how task identifiers are stored or how queued states are interpreted. The API is the relevant integration surface for this question. A console control, a client library wrapper, or a separately operated service may have different lifecycle rules, but those behaviors should not be attributed to the documented API without direct evidence. The same applies to support or administrative actions: they are not part of an application integration unless their behavior and authorization model are documented for that environment. This approach also does not apply to media already generated and stored outside the platform, or to a third-party workflow that exposes its own documented cancellation operation. For those cases, follow the interface that owns the job. Within the MiniMax Open Platform video-generation flow, however, queue management, status retrieval, replacement, and reconciliation are the applicable operations. ## Conclusion Begin with one queued task, preserve its returned identifier, and perform one authenticated status query before changing course. If the output is still acceptable, retain the task; if it is not, create one corrected replacement and track both records. The actionable rule is to manage queued video work through status-aware reconciliation rather than describing a stopped poll or abandoned task as an active cancellation.
Backend
Source:https://dev.to/rtykdj/queued-video-requests-can-be-cancelled-through-the-dedicated-task-api-j0k
Queued video requests can be cancelled through the dedicated task API
dev.to0 views
PreviousProject 4: Netflix Landing Page on EC2 using NginxNext$55,000 debt overnight on a cheap model: why GCP alerts fail
Related posts
5 Hidden Bugs That Break n8n & MCP AI Workflows in Production (+ Free Browser Auditor)
0dev.to
Server-Side Validation in Roblox: Lessons From 4 Years of Luau Systems
0dev.to
Beyond Writing Code: My Journey Building Products and Moving to Linux
0dev.to
How to OCR a scanned Arabic PDF into editable Word text
0dev.to
Writing a zero-dependency stdio MCP server in pure Python stdlib (lessons from DingCode)
0dev.to
Stop Giving AI Agents Direct Database Access: A Safer Way to Build SQL Tools
0dev.to