> For the complete documentation index, see [llms.txt](https://knowledge.out-smart.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledge.out-smart.com/openapi/advanced-filters/deleteentity-deleteentity-token-software_token-delete_all-entity-key-value.md).

# DeleteEntity \[/DeleteEntity/{?token,software\_token,delete\_all,entity,key,value}]

This API is used to delete an entity from WorkorderApp.

Allowed keys for each entity:

| Entity                                  | Key            | Description                                                                               |
| --------------------------------------- | -------------- | ----------------------------------------------------------------------------------------- |
| workorder, employee, material, relation | db\_row        | Row id of the entity                                                                      |
| workorder                               | workorder\_no  | External workorder number added when using the PostWorkorders API.                        |
| workorder                               | order\_no      | Order number given in the PostWorkorders API or added by the employee in the application. |
| employee                                | number         | Employee number added in the when using the employees POST method.                        |
| material                                | code           | Material code added in the when using the materials POST method.                          |
| material                                | description    | Material description added in the when using the materials POST method.                   |
| relation                                | name           | Company/relation name added when using the relations POST method.                         |
| relation                                | debtor\_number | Debtor number added when using the relations POST method.                                 |
| project                                 | code           | Code added when using the projects POST method.                                           |
| hourtype                                | code           | Code added when using the hourtype POST method.                                           |
| category                                | code           | Code added when using the categories POST method.                                         |
| address                                 | code           | Code added when using the addresses POST method.                                          |
| contactperson                           | code           | Code added when using the contactpersons POST method.                                     |
| object                                  | code           | Code added when using the objects POST method.                                            |
| location                                | identifier     | Identifier added when using the locations POST method.                                    |
| material\_category                      | mct\_mat\_code | Material code added when using the material\_categories POST method.                      |
| material\_category                      | mct\_cat\_code | Category code added when using the material\_categories POST method.                      |
| error                                   | code           | Code added when using the errors POST method.                                             |
| priority                                | code           | Code added when using the priorities POST method.                                         |
| solution                                | code           | Code added when using the solutions POST method.                                          |
| region                                  | code           | Code added when using the regions POST method.                                            |
| vehicle                                 | license\_plate | License plate added when using the vehicles POST method.                                  |
| object\_part                            | obj\_code      | Object code when added with the POST method.                                              |
| object\_part                            | prt\_code      | Part code when added with the POST method.                                                |
| object\_part                            | serial\_number | Serial number when added with the POST method.                                            |

Since object\_part uses composite primary key it is allowed to add keys and values as an array:\
\&delete\_all=false\&entity=object\_part\&key\[]=prt\_code\&value\[]=0010\&key\[]=obj\_code\&value\[]=2

#### Delete an entity \[GET]

object will contain the amount of affected rows.

* Parameters
  * token (string,required ,`0f24d1e07c8609c0fb111fbcc168f9aaa`) ... WorkorderApp customer token
  * software\_token (string,required , `c316c4532fa7cccdcd572491d9552f80945a51366`) ... WorkorderApp external software token
  * delete\_all (boolean,required, `false`) ... true or false
  * entity (string,required, `workorder`) ... workorder, employee, material, relation, project or hourtype
  * key (string,required, `workorder_no`) ... A key that is allowed for the given entity.
  * value (string,required,`AB756X`) ... Value of the given key
* Request Correct request(application/json)
* Response 200 (application/json)
  * { "code": 200, "messages": \[], "response": 1 }
* Request Request with wrong entity (application/json)
* Response 200 (application/json)
  * { "code": 1600, "messages": \[ "Entity: materials not found" ], "response": null }
* Request Request with wrong key for entity (application/json)
* Response 200 (application/json)
  * { "code": 1600, "messages": \[ "Key: codes not allowed for entity: material" ], "response": null }
* Request Request with delete all true while entity is workorder (application/json)
* Response 200 (application/json)
  * { "code": 1600, "messages": \[ "Delete all not allowed on Workorder entity" ], "response": null }
* Request Request with delete all true while entity is relation (application/json)
* Response 200 (application/json)
  * { "code": 200, "messages": \[], "response": 60 }


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://knowledge.out-smart.com/openapi/advanced-filters/deleteentity-deleteentity-token-software_token-delete_all-entity-key-value.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
