> For the complete documentation index, see [llms.txt](https://docs.platform.softwareone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.platform.softwareone.com/developer-resources/rest-api/task-api/task/set-task-status-to-failed.md).

# Set task status to failed

## Transition a task to Failed

> Transition a task to Failed.\
> Allowed only for the owner service or extension. Valid when status is Processing, Queued, or Rescheduled.

```json
{"openapi":"3.0.1","info":{"title":"Marketplace API","version":"5.9.245-gd8302a06"},"servers":[{"url":"https://api.platform.softwareone.com"}],"paths":{"/public/v1/system/tasks/{id}/fail":{"post":{"tags":["Tasks"],"summary":"Transition a task to Failed","description":"Transition a task to Failed.\nAllowed only for the owner service or extension. Valid when status is Processing, Queued, or Rescheduled.","parameters":[{"name":"id","in":"path","description":"The task ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}}}}}},"components":{"schemas":{"Task":{"type":"object","properties":{"id":{"type":"string"},"audit":{"allOf":[{"$ref":"#/components/schemas/TaskAuditBag"}]},"$meta":{"allOf":[{"$ref":"#/components/schemas/PlatformMetadata"}],"nullable":true},"name":{"type":"string"},"icon":{"type":"string","nullable":true},"revision":{"type":"integer","format":"int32"},"status":{"allOf":[{"$ref":"#/components/schemas/TaskStatus"}],"description":"Task status: a new task is created in the Queued (default) or Blocked status.","nullable":true},"code":{"type":"string","description":"Task code for the workflow, prefixed with the service namespace."},"queue":{"type":"string","description":"Queue name for task execution, prefixed with the controlling service namespace."},"object":{"allOf":[{"$ref":"#/components/schemas/TaskPlatform"}],"description":"Reference to the business object related to the task."},"description":{"type":"string","description":"Parameterized task description."},"parent":{"type":"object","allOf":[{"$ref":"#/components/schemas/TaskRef"}]},"progress":{"type":"number","description":"Progress in percent. 0-100 or not defined for not yet started task.","format":"float","nullable":true},"eta":{"type":"string","description":"Estimated finish time, if any.","format":"date-time","nullable":true},"parameters":{"description":"Optional parameters to store task-specific metadata.","nullable":true},"result":{"type":"string","description":"Result URI or reference to the result resource.","nullable":true},"externalId":{"type":"string","description":"External identifier for task correlation.","nullable":true},"owner":{"type":"object","allOf":[{"$ref":"#/components/schemas/PlatformIdentityRef"}]},"access":{"type":"array","items":{"$ref":"#/components/schemas/PlatformAccountRef"},"description":"List of accounts having access to the task and its result."}},"additionalProperties":false,"description":"The Task represents the state of an asynchronous, usually long running operation."},"TaskAuditBag":{"type":"object","properties":{"created":{"allOf":[{"$ref":"#/components/schemas/PlatformObjectEvent"}],"nullable":true},"updated":{"allOf":[{"$ref":"#/components/schemas/PlatformObjectEvent"}],"nullable":true},"started":{"allOf":[{"$ref":"#/components/schemas/PlatformObjectEvent"}],"nullable":true},"completed":{"allOf":[{"$ref":"#/components/schemas/PlatformObjectEvent"}],"nullable":true},"failed":{"allOf":[{"$ref":"#/components/schemas/PlatformObjectEvent"}],"nullable":true},"rescheduled":{"allOf":[{"$ref":"#/components/schemas/PlatformObjectEvent"}],"nullable":true},"queued":{"allOf":[{"$ref":"#/components/schemas/PlatformObjectEvent"}],"nullable":true}},"additionalProperties":false},"PlatformObjectEvent":{"type":"object","properties":{"at":{"type":"string","format":"date-time","nullable":true},"by":{"type":"object","allOf":[{"$ref":"#/components/schemas/PlatformIdentityRef"}]}},"additionalProperties":false},"PlatformIdentityRef":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string","nullable":true},"revision":{"type":"integer","format":"int32"}},"additionalProperties":false},"PlatformMetadata":{"type":"object","properties":{"omitted":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"TaskStatus":{"enum":["Queued","Processing","Completed","Failed","Rescheduled"],"type":"string"},"TaskPlatform":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"icon":{"type":"string","nullable":true}},"additionalProperties":false},"TaskRef":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string","nullable":true},"revision":{"type":"integer","format":"int32"},"status":{"allOf":[{"$ref":"#/components/schemas/TaskStatus"}],"description":"Task status: a new task is created in the Queued (default) or Blocked status.","nullable":true},"code":{"type":"string","description":"Task code for the workflow, prefixed with the service namespace."}},"additionalProperties":false,"description":"The Task represents the state of an asynchronous, usually long running operation."},"PlatformAccountRef":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string","nullable":true},"revision":{"type":"integer","format":"int32"},"type":{"allOf":[{"$ref":"#/components/schemas/AccountType"}],"nullable":true},"status":{"allOf":[{"$ref":"#/components/schemas/AccountStatus"}],"nullable":true}},"additionalProperties":false},"AccountType":{"enum":["Client","Vendor","Operations"],"type":"string"},"AccountStatus":{"enum":["Active","Enabled","Disabled"],"type":"string"}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.platform.softwareone.com/developer-resources/rest-api/task-api/task/set-task-status-to-failed.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
