# Close a session

`POST https://api.parklio.com/v2/sessions/{id}/close`

Ends a session now: sets `ended_at`, and `exit` with type `account` (API token) or `attendant` (user token). No body.

It doesn't check that the session is still open, and doesn't change the zone's `occupied_count`: check `ended_at` first.

**Auth:** `Authorization: Bearer <token>`

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | The session's `id`. |

## Responses

### 200

```json
{
  "success": true,
  "data": {
    "id": 501,
    "public_id": "K7Q2M9X4TB",
    "duration": 7200,
    "amount_paid": 0,
    "exit_allowed": false,
    "entry_license_plate": {
      "id": 9001,
      "plate": "ZG1234AB",
      "image_url": null,
      "cropped_image_url": null
    },
    "created_at": "2026-03-02T08:12:41.000Z",
    "entry": {
      "id": 3,
      "type": "account"
    },
    "zone_id": 9,
    "ended_at": "2026-03-02T10:12:41.000Z",
    "exit": {
      "id": 3,
      "type": "account"
    }
  }
}
```

### 401 — Account user is not logged in and they should log in again.

```json
{
  "success": false,
  "errors": [
    {
      "code": 1,
      "message": "Unauthorized access."
    }
  ]
}
```

### 403 — User does not have permission to access requested resource.

```json
{
  "success": false,
  "errors": [
    {
      "code": 4,
      "message": "No permission."
    }
  ]
}
```

### 404 — Resource that has been requested does not exist. User should not try to repeat this request.

```json
{
  "success": false,
  "errors": [
    {
      "code": 6,
      "message": "Resource not found."
    }
  ]
}
```

