Skip to main content
Requires authentication

Endpoint

POST /documents

Request Body

FieldTypeRequiredDescription
urlstringYesURL to document file
typestringYesDocument type (NATIONAL, LICENSE, PASSPORT, RESIDENCE, OTHER)
expiryDatestringYesDocument expiry date (ISO string)
issuedBystringYesIssuing authority
adminIdUUIDNoLink document to an admin (required if userId not provided)
userIdUUIDNoLink document to a resident user (required if adminId not provided)

Example

{
  "url": "https://storage.example.com/national-id.pdf",
  "type": "NATIONAL",
  "expiryDate": "2025-12-31T00:00:00Z",
  "issuedBy": "Ministry of Interior",
  "adminId": "admin-uuid"
}

Response

{
  "success": true,
  "data": {
    "id": "uuid",
    "url": "https://storage.example.com/national-id.pdf",
    "type": "NATIONAL",
    "expiryDate": "2025-12-31T00:00:00Z",
    "issuedBy": "Ministry of Interior",
    "adminId": "admin-uuid",
    "userId": null
  }
}