Audit Event
audit_event objectAn immutable record of a single change to a resource, capturing who made the change, what changed, and when.
Audit events are recorded automatically as mutations happen; they cannot be created, edited, or deleted through the API. Recording is asynchronous, so an event may take a moment to become readable after the request that caused it has returned. An update that leaves every tracked field at its existing value records no event unless the mutation attaches metadata of its own — a password rotation, for example, records metadata and no field changes.
idstringAudit event ID.
objectstringenumValues:audit_eventResource type identifier.
actionstringenumValues:createupdateupsertThe type of action this event records.
create: the resource was created.update: one or more fields were changed.delete: the resource was deleted.restore: a previously deleted resource was restored.archive: the resource was archived.approve: a human approved a gated action, such as allowing a review-gated agent tool to run.deny: a human denied a gated action, such as rejecting a review-gated agent tool.
resource_typestringenumValues:accountactorentityResource type of the audited entity.
resource_idstringAudited resource ID.
actoractornullableActor who performed the mutation.
idstringUnique identifier of the actor.
objectstringenumValues:actorResource type identifier.
typestringenumValues:userapi_keyagentActor type.
user: a human user account.api_key: a programmatic caller authenticating with an API key.agent: an automated agent acting on the account's behalf.group: a shared group identity, such as a "Customer Service" persona, rather than a single individual.
namestringnullableThe actor's display name.
handlestringnullableHuman-readable handle identifying the actor.
- For
useractors: the user's email address. - For
api_keyactors: the redacted key value.
Other actor types carry no handle.
avatar_urlstringnullableURL of the actor's profile photo, if one is set.
Only populated for user actors.
The role the actor holds in the account, which determines what it is permitted to do.
null in this endpoint.accountaccountnullableAccount the audited mutation was performed against.
For a mutation on one of your own resources this is your account; when you act on a customer's or supplier's account, it is that account.
idstringAccount ID.
objectstringenumValues:accountResource type identifier.
namestringThe account's display name.
The address billed by default on orders for this account.
null in this endpoint.The address shipped to by default on orders for this account.
null in this endpoint.brandingaccount_brandingnullableCustomer-facing branding for the account, such as the logo, support contacts, and social links.
null in this endpoint.portalaccount_portalnullableThe account's customer portal settings, including the portal URL slug.
null in this endpoint.created_atstring (date-time)Creation timestamp.
updated_atstring (date-time)Last updated timestamp.
Field-level changes recorded for this event.
Only fields OpenMRP tracks for that resource type are compared, and only those whose value actually differs are listed. Actions that do not alter stored fields, such as approve and deny, generally record no changes.
objectstringenumValues:listResource type identifier.
page_infoobjectPagination metadata.
next_page_urlstringnullableRelative URL that fetches the next page of results.
previous_page_urlstringnullableRelative URL that fetches the previous page of results.
has_next_pagebooleanWhether more results exist after this page.
has_prev_pagebooleanWhether results exist before this page.
dataarray of audit_field_changeResources in this page.
objectstringenumValues:audit_field_changeResource type identifier.
fieldstringName of the changed field.
Field names come from the audited record's stored representation and can differ slightly from the corresponding field on the API resource — for example commission_policy_code rather than commission_policy.
old_valueobjectnullablePrevious value as a JSON fragment.
null on create events, where the field had no prior value.
Encoded as a JSON value (object, array, string, number, boolean, or null), not a JSON-encoded string.
new_valueobjectnullableNew value as a JSON fragment.
null on delete events, where the field has no remaining value.
Encoded as a JSON value (object, array, string, number, boolean, or null), not a JSON-encoded string.
metadataobjectnullableArbitrary JSON metadata for the mutation (e.g. reason, source, tags).
Encoded as a JSON value (object, array, string, number, boolean, or null), not a JSON-encoded string.
Log of the API request that caused the mutation.
Changes that did not originate from an API request have no originating request log.
idstringRequest log ID.
objectstringenumValues:request_logResource type identifier.
methodstringenumValues:GETPOSTPUTHTTP method.
hoststringRequest host.
Usually api.openmrp.ai.
pathstringThe exact path the request was made to, including path parameter values.
normalized_routestringThe route template the request matched, with path parameters left as placeholders.
For example /v1/sales/customers/{id} is the normalized route for the request path /v1/sales/customers/ac_.... Falls back to the raw path when the request did not match a registered route.
query_paramsobjectnullableQuery-string parameters the request was made with, as a JSON object.
Encoded as a JSON value (object, array, string, number, boolean, or null), not a JSON-encoded string.
status_codeintegerHTTP response status code (e.g. 200, 404).
latency_usintegerRequest latency in microseconds.
Measured at the API edge, from the moment the request was received until the response was written, so it excludes network time between your client and OpenMRP.
api_versionstringnullableThe API version the request was served with.
Taken from the OpenMRP-Version header the caller sent; requests rejected for omitting that header record no version.
client_ipstringnullableClient IP address the request came from.
Not recorded for requests an OpenMRP agent made on your behalf, since those originate inside OpenMRP's own network.
user_agentstringnullableUser agent.
referrerstringnullableReferrer header.
error_codestringnullableenumValues:expired_tokenapi_key_expiredapi_key_revokedMachine-readable API error code.
Matches the code of the error response the caller received. Populated only for failed requests.
error_messagestringnullableHuman-readable error message.
The same message the caller received. Populated only for failed requests.
occurred_atstring (date-time)When the request was received.
Request logs are ordered and date-filtered by this timestamp rather than by created_at.
created_atstring (date-time)When the log entry was written.
accountaccountnullableAccount targeted by the request: the account the request acted upon.
Results are scoped to logs where your account is either the acting account or the target account. Use the target_account_ids query parameter to filter by which account was acted upon, and actor_account_ids to filter by who acted.
null in this endpoint.actoractornullableActor who made the request.
null in this endpoint.idempotency_keystringnullableUser-provided idempotency key.
request_bodyobjectnullableThe JSON body the request was sent with.
Sensitive values such as passwords, tokens, and secrets are redacted before the body is stored. Bodies larger than 256 KB are not stored in full; a small marker object with _truncated set to true is stored in their place.
Encoded as a JSON value (object, array, string, number, boolean, or null), not a JSON-encoded string.
response_bodyobjectnullableThe JSON body OpenMRP responded with.
Sensitive values such as generated API key secrets are redacted before the body is stored. Bodies larger than 256 KB are not stored in full; a small marker object with _truncated set to true is stored in their place.
Encoded as a JSON value (object, array, string, number, boolean, or null), not a JSON-encoded string.
idempotency_keystringnullableIdempotency key of the originating request.
source_ipstringnullableOriginating client IP address.
occurred_atstring (date-time)When the audited mutation occurred.
Audit events are ordered and date-filtered by this timestamp rather than by created_at.
created_atstring (date-time)When the audit event record was written.
Slightly later than occurred_at, since events are recorded out of band from the request that caused them.