REST /api/v1/declaration-encryption 8 endpoints
GET /api/v1/declaration-encryption/api/v1/declaration-encryption

List encryption key metadata across all organisations (no key material returned)

Public

Response Example

{
  "data": [
    {
      "org_id": "org_812",
      "key_id": "key_v2_org812",
      "algorithm": "AES-256-GCM",
      "created_at": "2026-01-10T00:00:00Z",
      "rotated_at": null,
      "status": "active"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 8
  }
}
GET /api/v1/declaration-encryption/api/v1/declaration-encryption/:org_id

Get encryption key metadata for a specific organisation

Public

Response Example

{
  "org_id": "org_812",
  "key_id": "key_v2_org812",
  "algorithm": "AES-256-GCM",
  "created_at": "2026-01-10T00:00:00Z",
  "rotated_at": null,
  "status": "active"
}
POST /api/v1/declaration-encryption/api/v1/declaration-encryption/encrypt

Encrypt declaration content for an organisation

Public

Request Example

{
  "org_id": "org_812",
  "content": "Jeg bekrefter at jeg har lest og forstått taushetserklæringen..."
}

Response Example

{
  "org_id": "org_812",
  "key_id": "key_v2_org812",
  "encrypted_blob": "AQIDAHiZ...base64encoded...==",
  "algorithm": "AES-256-GCM",
  "encrypted_at": "2026-03-26T09:00:00Z"
}
PUT /api/v1/declaration-encryption/api/v1/declaration-encryption/:org_id

Re-encrypt content with the latest key after rotation

Public

Request Example

{
  "encrypted_blob": "AQIDAHiZ...oldblob...=="
}

Response Example

{
  "org_id": "org_812",
  "key_id": "key_v3_org812",
  "encrypted_blob": "BRJDEXkZ...newblob...==",
  "re_encrypted_at": "2026-03-26T10:00:00Z"
}
DELETE /api/v1/declaration-encryption/api/v1/declaration-encryption/:org_id

Revoke and delete encryption keys for an organisation (irreversible, data-loss warning)

Public

Response Example

{
  "org_id": "org_812",
  "key_id": "key_v2_org812",
  "revoked": true,
  "revoked_at": "2026-03-26T11:00:00Z"
}
POST /api/v1/declaration-encryption/api/v1/declaration-encryption/decrypt

Decrypt an encrypted declaration blob

Public

Request Example

{
  "org_id": "org_812",
  "encrypted_blob": "AQIDAHiZ...base64encoded...=="
}

Response Example

{
  "org_id": "org_812",
  "content": "Jeg bekrefter at jeg har lest og forstått taushetserklæringen...",
  "decrypted_at": "2026-03-26T09:01:00Z"
}
POST /api/v1/declaration-encryption/api/v1/declaration-encryption/:org_id/keys

Generate a new encryption key for an organisation

Public

Response Example

{
  "org_id": "org_812",
  "key_id": "key_v2_org812",
  "algorithm": "AES-256-GCM",
  "created_at": "2026-03-26T09:00:00Z",
  "status": "active"
}
POST /api/v1/declaration-encryption/api/v1/declaration-encryption/:org_id/keys/rotate

Rotate the encryption key for an organisation

Public

Response Example

{
  "org_id": "org_812",
  "previous_key_id": "key_v2_org812",
  "new_key_id": "key_v3_org812",
  "rotated_at": "2026-03-26T09:30:00Z"
}

Additional Metadata

{
  "contract_summary": {
    "total_contracts": 410,
    "total_endpoints": 2416,
    "api_styles_used": [
      "rest"
    ]
  },
  "generated_at": "2026-03-26T06:55:53.316Z"
}