Skip to main content

audit_logs

Creates, updates, deletes, gets or lists an audit_logs resource.

Overview​

Nameaudit_logs
TypeResource
Idrailway.workspaces.audit_logs

Fields​

The following fields are returned by SELECT queries:

One AuditLog row.

NameDatatypeDescription
idstring
environment_idstring
project_idstring
workspace_idstring
contextobject
created_atstring (date-time)
environmentobjectEnvironment object
event_typestring
payloadobject
projectobjectProject object

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, workspace_idGet an audit log by ID. Backed by the Railway GraphQL query auditLog.
listselectworkspace_idend_date, environment_id, event_types, project_id, start_date, sortGets audit logs for a workspace. Backed by the Railway GraphQL query auditLogs.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
idstringThe ID of the audit log entry.
workspace_idstring
end_datestring (date-time)Filter events created on or before this date.
environment_idstringFilter events for a single environment.
event_typesstringList of event types to filter by. GraphQL list literal, for example ["a", "b"].
project_idstringFilter events for a single project.
sortstring
start_datestring (date-time)Filter events created on or after this date.

SELECT examples​

Get an audit log by ID. Backed by the Railway GraphQL query auditLog.

SELECT
id,
environment_id,
project_id,
workspace_id,
context,
created_at,
environment,
event_type,
payload,
project
FROM railway.workspaces.audit_logs
WHERE id = '{{ id }}' -- required
AND workspace_id = '{{ workspace_id }}' -- required
;