# Deletes a project role and migrates members.

POST https://api.awork.com/api/v1/projectroles/{projectRoleId}/delete

Deletes the specified project role and moves its members to the role selected in the request.

<Check title="Required Permissions" icon="key">The user must be an admin or have `workspace-manage-config:write` permissions.</Check>

## Request example

```sh
curl -X POST --globoff 'https://api.awork.com/api/v1/projectroles/{projectRoleId}/delete' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  --data '{
  "newProjectRoleId": "123e4567-e89b-12d3-a456-426614174000"
}'
```

- path parameter `projectRoleId`: string (required). The id of the project role.

## Request body (application/json)

- `newProjectRoleId`: string or null

## Response 200

OK

## Response 400

Bad Request

application/json

```json
{
  "code": "not-found",
  "description": "There is no matching path for this URL.",
  "link": "https://developers.awork.com",
  "details": [
    "No project with the id '123' exists."
  ],
  "validationErrors": [
    {
      "property": "FirstName",
      "message": "FirstName is required."
    }
  ],
  "traceId": "a65ce5745df02af216715ff06661fb3a"
}
```

## Response 404

Not Found

application/json

```json
{
  "code": "not-found",
  "description": "There is no matching path for this URL.",
  "link": "https://developers.awork.com",
  "details": [
    "No project with the id '123' exists."
  ],
  "validationErrors": [
    {
      "property": "FirstName",
      "message": "FirstName is required."
    }
  ],
  "traceId": "a65ce5745df02af216715ff06661fb3a"
}
```
