# Mark a support request as solved

`POST /api/v1/support-requests/{supportRequest}/solution`

Tell the support team the request needs nothing more. Its status becomes solved. Writing to it again reopens it.

A request that is already solved answers 422 on status with the message This request is already solved.

## Path parameters

- `supportRequest` (uuid, required): The id of the request. One belonging to another account answers 404.

## Returns

The support request object as it stands now, without its messages. A request of another account answers 404.

- `data` (object): The support request.
- `data.type` (string): Always support_request. It names the kind of record, so a caller holding several kinds can tell them apart without looking at where they came from.
- `data.id` (string): The id of this record, as a string even when it reads as a number. It is what every endpoint naming this record takes.
- `data.attributes` (object): Everything the record holds.
- `data.attributes.reference` (string): The reference to quote when writing to the support team, such as MON-482913.
- `data.attributes.category` (string): What the request is about: feature, billing, email, question or technical.
- `data.attributes.subject` (string): The title the request was opened with.
- `data.attributes.status` (string): Where the request stands: to_handle when the support team has yet to answer, waiting_on_user when it has and awaits you, or solved.
- `data.attributes.status_label` (string): The status as the application words it for the person who asked, in the language of the account.
- `data.attributes.opened_at` (timestamp): When the request was opened, as a count of seconds since 1970.
- `data.attributes.last_activity_at` (timestamp): When anybody last wrote in it, the person who asked or the support team, as a count of seconds since 1970. A change of status alone does not move it.
- `data.attributes.solved_at` (timestamp): When it was marked as solved, as a count of seconds since 1970, or null while it is open.
- `data.links` (object): Where to find this record.
- `data.links.self` (string): The absolute address this record is read from.

## Rate limit

Sixty requests per minute, per user, shared by every key and device. Every answer carries the budget left in `X-RateLimit-Remaining`.

## Request

```sh
curl https://my.monicahq.com/api/v1/support-requests/7c1e4a92-5b3d-4f08-a6e1-93d2c8b05f17/solution \
  -X POST \
  -H "Authorization: Bearer $MONICA_TOKEN"
```

```javascript
const response = await fetch('https://my.monicahq.com/api/v1/support-requests/7c1e4a92-5b3d-4f08-a6e1-93d2c8b05f17/solution', {
  method: 'POST',
  headers: { Authorization: `Bearer ${token}` },
})
const data = await response.json()
```

```php
$response = Http::withToken($token)->post('https://my.monicahq.com/api/v1/support-requests/7c1e4a92-5b3d-4f08-a6e1-93d2c8b05f17/solution');
```

## Response

`200`

```json
{
    "data": {
        "type": "support_request",
        "id": "7c1e4a92-5b3d-4f08-a6e1-93d2c8b05f17",
        "attributes": {
            "reference": "MON-482913",
            "category": "question",
            "subject": "My conference room reminder never arrived",
            "status": "solved",
            "status_label": "Solved",
            "opened_at": 1791547200,
            "last_activity_at": 1791558000,
            "solved_at": 1791558000
        },
        "links": {
            "self": "https://my.monicahq.com/api/v1/support-requests/7c1e4a92-5b3d-4f08-a6e1-93d2c8b05f17"
        }
    }
}
```
