# Mobile API - Phase 12

## Base URL

```text
https://your-domain.com/api/v1
```

## Authentication

```text
Authorization: Bearer YOUR_TOKEN
Accept: application/json
```

## Firebase Device Token

Register a mobile device after login:

```text
POST /device-tokens
```

Body:

```json
{
  "token": "FCM_DEVICE_TOKEN",
  "platform": "android",
  "device_name": "Samsung Galaxy"
}
```

Remove a token:

```text
DELETE /device-tokens/{token}
```

## Patient API

Existing Phase 11 patient APIs remain available.

## Doctor Mobile API

Doctor tokens are created with the `doctor` ability.

### Doctor Appointments

```text
GET /doctor/appointments
```

Filters:

```text
GET /doctor/appointments?date=2026-08-12
GET /doctor/appointments?status=confirmed
```

### Appointment Details

```text
GET /doctor/appointments/{appointment}
```

### Update Appointment Status

```text
PATCH /doctor/appointments/{appointment}/status
```

Body:

```json
{
  "status": "completed"
}
```

Supported statuses:

```text
confirmed
cancelled
completed
```

### Join Online Consultation

```text
GET /doctor/appointments/{appointment}/join
```

## Push Notifications

Firebase Cloud Messaging notifications are queued.

Push events:

```text
confirmed
cancelled
payment_success
reminder
```

The mobile application should handle:

```text
type = appointment
```

Push data includes:

```text
event
appointment_id
appointment_number
```
