# List completed tasks the user is responsible for

`GET /api/user/{userId}/task/completed`

URL: https://repsona.com/api/get-user-userid-task-completed

## Parameters

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `userId` | path | integer | required | ID of the user. |

## Request

```sh
curl -X GET "https://<space>.repsona.com/api/user/{userId}/task/completed" \
  -H "Authorization: Bearer $REPSONA_API_KEY"
```

## Responses

- 200: Closed tasks ordered by latest update (within projects visible to the requester)
- 401: Authentication is required
- 404: User not found

## Example response

```json
{
  "tasks": [
    {
      "id": 100444,
      "name": "Set up the staging server",
      "projectName": "Beta Launch",
      "project": {
        "id": 297,
        "name": "beta-launch",
        "avatarUrl": null
      },
      "ancestorNames": [],
      "status": {
        "id": 197,
        "name": "Done",
        "color": null,
        "isClosed": true
      },
      "owner": {
        "id": 1126,
        "name": "reon",
        "fullName": "Reon Walls",
        "avatarUrl": null,
        "color": null
      },
      "tags": [],
      "dueDate": null,
      "priority": null
    }
  ]
}
```
