# Reorder records based on given input

`PATCH /api/task-statuses/reorder`

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

Schema: [ReorderRequestDTO](https://sourcey-gauzy.pages.dev/api-reference/models/reorderrequestdto/index.md)

- `tenant` (optional)
  Type: object

- `tenantId` (optional)
  Type: string

- `organization` (required)
  Type: object

- `organizationId` (required)
  Type: string

- `sentTo` (optional)
  Type: string

- `reorder` (required)
  Type: array
  
  List of reordering instructions
  
  Items:
    Reference: [ReorderDTO](https://sourcey-gauzy.pages.dev/api-reference/models/reorderdto/index.md); Type: object

Responses:

- 200: Reordering was successful.

- 400: Invalid input. Check your request body.

- 500: An error occurred during reordering.

## Examples

### cURL

```bash
curl -X PATCH 'http://localhost:3000/api/task-statuses/reorder' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "reorder": [
    {
      "id": "string",
      "order": 0
    }
  ]
}'
```

### JavaScript

```javascript
const body = `{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "reorder": [
    {
      "id": "string",
      "order": 0
    }
  ]
}`;

const response = await fetch('http://localhost:3000/api/task-statuses/reorder', {
  method: 'PATCH',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "reorder": [
    {
      "id": "string",
      "order": 0
    }
  ]
}'''

response = requests.patch(
    'http://localhost:3000/api/task-statuses/reorder',
    data=body.encode('utf-8'),
    headers={
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
