Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/joaomonteir0/printheritage/llms.txt

Use this file to discover all available pages before exploring further.

The audit log is PrintHeritage’s immutable record of every significant action performed on the platform. Each entry captures who did what, against which resource, and when. Access is intentionally restricted to users holding the SUPER_ADMIN role — any other authenticated user will receive a 403 response. Entries are returned in descending timestamp order so that the most recent activity always appears first.

GET /audit-logs

Retrieves the complete audit log, joining each entry’s user_id to the users table to resolve the actor’s email address at query time. The result set is ordered by timestamp DESC.
This endpoint is restricted to SUPER_ADMIN users only. Requests from users with any other role — including GENERAL_ADMIN — will receive a 403 Forbidden response.

Authentication

A valid Bearer token issued to a SUPER_ADMIN user must be supplied in the Authorization header.

Response

Returns a JSON array of audit log entry objects, ordered newest-first.
id
string (UUID)
Unique identifier of this audit log entry.
email
string
Email address of the user who performed the action, resolved from the users table via the user_id foreign key.
action
string
Identifier of the action that was performed. See the full reference table below for all possible values.
target_type
string | null
The category of resource affected by the action. Either "USER", "PROJECT", or null when no specific resource type is relevant.
target_id
string (UUID) | null
UUID of the specific resource that was affected, or null when not applicable.
details
string | null
Optional free-text context recorded alongside the action, such as the email address of a newly registered user. null when no extra detail was captured.
timestamp
string (ISO 8601)
UTC datetime at which the action was recorded, serialised as an ISO 8601 string, e.g. "2024-06-01T10:32:45.123456".

Action type reference

Every value that can appear in the action field is listed below, together with the target_type it is paired with and a description of when it is written.
Actiontarget_typeDescription
USER_LOGINUSERA user successfully authenticated via the /login endpoint.
USER_CREATEDUSERA new user account was registered via /register.
USER_UPDATEUSERA user profile field was updated via PATCH /users/{user_id}.
USER_DELETEUSERA user account was permanently deleted.
PROJECT_CREATEPROJECTA new project was created.
PROJECT_DATA_ADDPROJECTA dataset was added to or updated within a project.
PROJECT_DATA_DELETEPROJECTA dataset was permanently removed from a project.
PROJECT_MEMBER_INVITEUSERA user was invited to join a project (target is the invitee’s ID).
PROJECT_MEMBER_REMOVEUSERA member was removed from a project (target is the removed user’s ID).
INVITE_ACCEPTPROJECTA pending invitation was accepted.
INVITE_REJECTPROJECTA pending invitation was rejected.
PASSWORD_CHANGEUSERThe authenticated user changed their own password.

Example

curl "https://api.printheritage.io/audit-logs" \
  -H "Authorization: Bearer <super_admin_token>"
[
  {
    "id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
    "email": "super@print.com",
    "action": "PROJECT_DATA_DELETE",
    "target_type": "PROJECT",
    "target_id": "2b9e1f4a-3c5d-4e8f-a012-bc9d1234ef56",
    "details": null,
    "timestamp": "2024-06-01T14:55:12.008423"
  },
  {
    "id": "c9d8e7f6-a5b4-3210-fedc-ba9876543210",
    "email": "ana.ferreira@example.com",
    "action": "INVITE_ACCEPT",
    "target_type": "PROJECT",
    "target_id": "2b9e1f4a-3c5d-4e8f-a012-bc9d1234ef56",
    "details": null,
    "timestamp": "2024-06-01T11:20:04.771900"
  },
  {
    "id": "11223344-5566-7788-99aa-bbccddeeff00",
    "email": "novo.utilizador@example.com",
    "action": "USER_CREATED",
    "target_type": "USER",
    "target_id": "77889900-aabb-ccdd-eeff-112233445566",
    "details": "Email: novo.utilizador@example.com",
    "timestamp": "2024-06-01T09:03:47.330100"
  }
]

Error responses

StatusCondition
403Authenticated user does not hold the SUPER_ADMIN role.
401Missing or invalid Bearer token.

Build docs developers (and LLMs) love