# User Address API

## Overview

The User Address API provides verified address information associated with an authenticated citizen.

The API is exposed through the TRIDENT Verified Data Gateway (VDG) and follows the VDG Façade API pattern.

## Purpose

Return the user's parish and address after validating an OAuth2 Access Token issued by ACG.

## Authorization

A valid OAuth 2.0 Access Token issued by TRIDENT IDP is required.

### Required Scope

`ebc.address`

## Endpoint

GET /facade-vdg/api/v1/ebc/user-address

## Request Headers

Authorization: Bearer <rse_access_token>

## Successful Response

```json
{
  "parish": "Saint Michael",
  "address": "Main Street 123"
}
```

## Response Fields

| Field 	| Description 
|-----------|-------------
| parish 	| Registered parish 
| address 	| Registered address 

## Error Responses

### 401 Unauthorized

```json
{
  "error": "invalid_token",
  "message": "The access token is invalid or inactive"
}
```

### 403 Forbidden

```json
{
  "error": "insufficient_scope",
  "message": "Required scopes: ebc.address"
}
```

### 404 Not Found

```json
{
  "error": "data_not_found",
  "message": "Address data was not found for the user"
}
```

## Security Model

- Validates Access Tokens issued by TRIDENT IDP.
- Verifies required scopes.
- Retrieves data from authoritative sources.
- Returns only approved information.

## Data Minimization

Only the minimum address attributes required for the approved use case are returned.

## Related Documentation

Refer to the TRIDENT IDP Integration Guide.
