Location Consent Service
API Contract
REST
/api/v1/location-consents
5 endpoints
GET
/api/v1/location-consents/api/v1/location-consents
List all consent records for the organization
Public
Response Example
{
"data": [
{
"mentor_id": "mentor_7f3a2b",
"consent_status": "granted",
"granted_at": "2026-01-15T10:00:00Z",
"revoked_at": null,
"expires_at": "2026-07-15T10:00:00Z",
"policy_version": "2.1.0"
},
{
"mentor_id": "mentor_4c91de",
"consent_status": "revoked",
"granted_at": "2025-11-01T09:00:00Z",
"revoked_at": "2026-02-10T14:30:00Z",
"expires_at": null,
"policy_version": "2.0.0"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 2
}
}
GET
/api/v1/location-consents/api/v1/location-consents/:mentor_id
Get the current consent record for a specific mentor
Public
Response Example
{
"mentor_id": "mentor_7f3a2b",
"consent_status": "granted",
"granted_at": "2026-01-15T10:00:00Z",
"revoked_at": null,
"expires_at": "2026-07-15T10:00:00Z",
"policy_version": "2.1.0",
"ip_address_hash": "3a7bc9f1",
"user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0)"
}
POST
/api/v1/location-consents/api/v1/location-consents
Grant location consent for a mentor
Public
Request Example
{
"mentor_id": "mentor_7f3a2b",
"policy_version": "2.1.0",
"ip_address_hash": "3a7bc9f1",
"user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0)"
}
Response Example
{
"mentor_id": "mentor_7f3a2b",
"consent_status": "granted",
"granted_at": "2026-03-26T09:15:00Z",
"expires_at": "2026-09-26T09:15:00Z",
"policy_version": "2.1.0",
"created_at": "2026-03-26T09:15:00Z"
}
PUT
/api/v1/location-consents/api/v1/location-consents/:mentor_id
Update consent record (e.g., renew or change policy version)
Public
Request Example
{
"consent_status": "granted",
"policy_version": "2.2.0"
}
Response Example
{
"mentor_id": "mentor_7f3a2b",
"consent_status": "granted",
"granted_at": "2026-03-26T09:20:00Z",
"expires_at": "2026-09-26T09:20:00Z",
"policy_version": "2.2.0",
"updated_at": "2026-03-26T09:20:00Z"
}
DELETE
/api/v1/location-consents/api/v1/location-consents/:mentor_id
Revoke consent and queue location data deletion for a mentor
Public
Response Example
{
"mentor_id": "mentor_7f3a2b",
"consent_status": "revoked",
"revoked_at": "2026-03-26T09:25:00Z",
"location_deletion_queued": true
}