{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","results":{"codes":[]},"settings":"","params":[]},"next":{"description":"","pages":[]},"title":"Audit API","type":"basic","slug":"audit-api","excerpt":"","body":"The Audit API provides endpoints for your application to read and write audit events into the audit log.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Audit API Endpoint\",\n  \"body\": \"The Audit API is part of the [Integration API](doc:integration-api-reference).  To discover the Integration API base endpoint, query the `REPLICATED_INTEGRATIONAPI` environment variable from inside your container.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"post\",\n  \"title\": \"/audit/v1/event\"\n}\n[/block]\nRecords audit event information.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-2\": \"Description\",\n    \"h-1\": \"Type\",\n    \"0-0\": \"name\",\n    \"2-0\": \"description\",\n    \"3-0\": \"ip_address\",\n    \"4-0\": \"action\",\n    \"3-1\": \"String\",\n    \"4-1\": \"String\",\n    \"2-1\": \"String\",\n    \"0-1\": \"String\",\n    \"3-2\": \"IP Address of the user who took the action.\",\n    \"4-2\": \"Machine readable name of the event.\",\n    \"0-2\": \"Name of the event.\",\n    \"2-2\": \"Human readable description of the event.\",\n    \"1-0\": \"title\",\n    \"1-1\": \"String\",\n    \"1-2\": \"Title of the event\"\n  },\n  \"cols\": 3,\n  \"rows\": 5\n}\n[/block]\n### Example request: \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -k -X POST $REPLICATED_INTEGRATIONAPI/audit/v1/event -H \\\"Content-Type: application/json\\\" -d '{\\\"action\\\":\\\"user.login.success\\\", \\\"description\\\":\\\"john:::at:::example.com logged in\\\", \\\"title\\\":\\\"User Login Success\\\", \\\"name\\\":\\\"login\\\"}'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{  \\n    \\\"name\\\":\\\"user.login\\\",\\n    \\\"description\\\":\\\"[email protected] logged in successfully\\\",\\n  \\t\\\"title\\\":\\\"User Login Success\\\",\\n    \\\"action\\\":\\\"user.login.success\\\",\\n  \\t\\\"ip_address\\\":\\\"192.30.252.12\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n### Example response:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"HTTP/1.1 201 Created\\nDate: Tue, 16 Jun 2015 17:59:25 GMT\\nContent-Length: 0\\nContent-Type: text/plain; charset=utf-8\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]","updates":["58113f59da6ae90f00561eb6"],"order":1,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5702deb796fc8d2b001a663a","githubsync":"","__v":1,"category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Integration API","slug":"integration-api","order":7,"from_sync":false,"reference":false,"_id":"5702deb696fc8d2b001a661d","project":"550f1e4021de720d005b8cbb","version":"5702deb696fc8d2b001a6615","createdAt":"2015-03-22T20:15:45.359Z","__v":0},"project":"550f1e4021de720d005b8cbb","user":"550f1e3161d9d30d00af9dc8","version":{"version":"2.0","version_clean":"2.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5702deb696fc8d2b001a6616","5702deb696fc8d2b001a6617","5702deb696fc8d2b001a6618","5702deb696fc8d2b001a6619","5702deb696fc8d2b001a661a","5702deb696fc8d2b001a661b","5702deb696fc8d2b001a661c","5702deb696fc8d2b001a661d","5702deb696fc8d2b001a661e"],"_id":"5702deb696fc8d2b001a6615","createdAt":"2016-04-04T21:37:58.778Z","hasReference":true,"releaseDate":"2016-04-04T21:37:58.778Z","__v":1,"project":"550f1e4021de720d005b8cbb","hasDoc":true},"createdAt":"2015-03-22T20:37:04.633Z","parentDoc":null}
The Audit API provides endpoints for your application to read and write audit events into the audit log. [block:callout] { "type": "info", "title": "Audit API Endpoint", "body": "The Audit API is part of the [Integration API](doc:integration-api-reference). To discover the Integration API base endpoint, query the `REPLICATED_INTEGRATIONAPI` environment variable from inside your container." } [/block] [block:api-header] { "type": "post", "title": "/audit/v1/event" } [/block] Records audit event information. [block:parameters] { "data": { "h-0": "Name", "h-2": "Description", "h-1": "Type", "0-0": "name", "2-0": "description", "3-0": "ip_address", "4-0": "action", "3-1": "String", "4-1": "String", "2-1": "String", "0-1": "String", "3-2": "IP Address of the user who took the action.", "4-2": "Machine readable name of the event.", "0-2": "Name of the event.", "2-2": "Human readable description of the event.", "1-0": "title", "1-1": "String", "1-2": "Title of the event" }, "cols": 3, "rows": 5 } [/block] ### Example request: [block:code] { "codes": [ { "code": "curl -k -X POST $REPLICATED_INTEGRATIONAPI/audit/v1/event -H \"Content-Type: application/json\" -d '{\"action\":\"user.login.success\", \"description\":\"[email protected] logged in\", \"title\":\"User Login Success\", \"name\":\"login\"}'", "language": "curl" } ] } [/block] [block:code] { "codes": [ { "code": "{ \n \"name\":\"user.login\",\n \"description\":\"[email protected] logged in successfully\",\n \t\"title\":\"User Login Success\",\n \"action\":\"user.login.success\",\n \t\"ip_address\":\"192.30.252.12\"\n}", "language": "json" } ] } [/block] ### Example response: [block:code] { "codes": [ { "code": "HTTP/1.1 201 Created\nDate: Tue, 16 Jun 2015 17:59:25 GMT\nContent-Length: 0\nContent-Type: text/plain; charset=utf-8", "language": "http" } ] } [/block]