# Workflow operations

## Overview

OData services are using the standard configuration for workflow.

> info  **PREREQUISITES**: To make requests for workflow-related actions, you must have configured workflow in Sitefinity CMS.\
> For more information, see [Define workflows](https://www.progress.com/documentation/sitefinity-cms/define-workflows).

## Lock an item

It is important to lock an item before modifying it, because this way other users can see that this item is being edited by someone else and they will see a message that it is currently not available for modifications on their end.

To lock an item, execute a `POST` request to the following endpoint:

`{baseurl}/api/default/{entity}({itemId})/Default.SaveTemp()`

Where:

* `{entity}` is the entity of the module that you are working with.
* `{itemId}` is the ID of the item.

**Sample request**

> success  **POST** `http://mysite.com/api/default/newsitems(3b177186-8b09-497c-8def-58613183d670)/ Default.SaveTemp()`

<SfDetails summary="Request body">

```JSON
{
  "model": {}
}
```

</SfDetails>

When you send an empty `model`, if the item is not already locked, it is locked.

**Sample response**

<SfDetails summary="Status code: 204 No Content">

No response body

</SfDetails>

## Unlock an item

After you have finished editing an item, you must unlock it.

To do this, execute a `POST` request to the following endpoint

`{baseurl}/api/default/{entity}({itemId})/operation`

Where:

* `{entity}` is the entity of the module that you are working with.
* `{itemId}` is the ID of the item.

**Sample request**

> success  **POST** `http://mysite.com/api/default/newsitems(3b177186-8b09-497c-8def-58613183d670)/operation`

<SfDetails summary="Request body">

```JSON
{
    "action": "Unlock"
}
```

</SfDetails>

**Sample response**

<SfDetails summary="Status code: 204 No Content">

No response body
</SfDetails>

## Send an item for approval

To do this, execute a `POST` request to the following endpoint:

`{baseurl}/api/default/{entity}({itemId})/operation`

Where:

* `{entity}` is the entity of the module that you are working with.
* `{itemId}` is the ID of the item.

**Sample request**

> success  **POST** `http://mysite.com/api/default/newsitems(3b177186-8b09-497c-8def-58613183d670)/operation`

<SfDetails summary="Request body">

```JSON
{
    "action": "SendForApproval"
}
```

</SfDetails>

**Sample response**

<SfDetails summary="Status code: 200 OK">

```JSON
{
}
```

</SfDetails>

## Send an item for publishing

To do this, execute a `POST` request to the following endpoint:

`{baseurl}/api/default/{entity}({itemId})/operation`

Where:

* `{entity}` is the entity of the module that you are working with.
* `{itemId}` is the ID of the item.

**Sample request**

> success  **POST** `http://mysite.com/api/default/newsitems(3b177186-8b09-497c-8def-58613183d670)/operation`

<SfDetails summary="Request body">

```JSON
{
    "action": "SendForPublishing"
}
```

</SfDetails>

**Sample response**

<SfDetails summary="Status code: 200 OK">

```JSON
{
}
```

</SfDetails>

## Reject an item

To do this, execute a `POST` request to the following endpoint:

`{baseurl}/api/default/{entity}({itemId})/operation`

Where:

* `{entity}` is the entity of the module that you are working with.
* `{itemId}` is the ID of the item.

**Sample request**

> success  **POST** `http://mysite.com/api/default/newsitems(3b177186-8b09-497c-8def-58613183d670)/operation`

<SfDetails summary="Request body">

```JSON
{
  "action": "Reject",
  "actionParameters": {
    "Note": "This item is rejected, because it contains inappropriate words."
  }
}
```

</SfDetails>

**Sample response**

<SfDetails summary="Status code: 200 OK">

```JSON
{
}
```

</SfDetails>
