Create audit event
curl --request POST \
--url https://api.clinikapi.com/v1/audit-events \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"type": "<string>",
"recorded": "<string>",
"agent": [
{
"who": "<string>",
"requestor": true,
"name": "<string>",
"role": "<string>",
"networkAddress": "<string>"
}
],
"source": {
"observer": "<string>",
"site": "<string>",
"type": "<string>"
},
"subtype": [
"<string>"
],
"action": "<string>",
"outcome": "<string>",
"outcomeDesc": "<string>",
"purposeOfEvent": [
"<string>"
],
"entity": [
{
"what": "<string>",
"type": "<string>",
"role": "<string>",
"name": "<string>",
"description": "<string>"
}
]
}
'import requests
url = "https://api.clinikapi.com/v1/audit-events"
payload = {
"type": "<string>",
"recorded": "<string>",
"agent": [
{
"who": "<string>",
"requestor": True,
"name": "<string>",
"role": "<string>",
"networkAddress": "<string>"
}
],
"source": {
"observer": "<string>",
"site": "<string>",
"type": "<string>"
},
"subtype": ["<string>"],
"action": "<string>",
"outcome": "<string>",
"outcomeDesc": "<string>",
"purposeOfEvent": ["<string>"],
"entity": [
{
"what": "<string>",
"type": "<string>",
"role": "<string>",
"name": "<string>",
"description": "<string>"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: '<string>',
recorded: '<string>',
agent: [
{
who: '<string>',
requestor: true,
name: '<string>',
role: '<string>',
networkAddress: '<string>'
}
],
source: {observer: '<string>', site: '<string>', type: '<string>'},
subtype: ['<string>'],
action: '<string>',
outcome: '<string>',
outcomeDesc: '<string>',
purposeOfEvent: ['<string>'],
entity: [
{
what: '<string>',
type: '<string>',
role: '<string>',
name: '<string>',
description: '<string>'
}
]
})
};
fetch('https://api.clinikapi.com/v1/audit-events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.clinikapi.com/v1/audit-events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => '<string>',
'recorded' => '<string>',
'agent' => [
[
'who' => '<string>',
'requestor' => true,
'name' => '<string>',
'role' => '<string>',
'networkAddress' => '<string>'
]
],
'source' => [
'observer' => '<string>',
'site' => '<string>',
'type' => '<string>'
],
'subtype' => [
'<string>'
],
'action' => '<string>',
'outcome' => '<string>',
'outcomeDesc' => '<string>',
'purposeOfEvent' => [
'<string>'
],
'entity' => [
[
'what' => '<string>',
'type' => '<string>',
'role' => '<string>',
'name' => '<string>',
'description' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.clinikapi.com/v1/audit-events"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"recorded\": \"<string>\",\n \"agent\": [\n {\n \"who\": \"<string>\",\n \"requestor\": true,\n \"name\": \"<string>\",\n \"role\": \"<string>\",\n \"networkAddress\": \"<string>\"\n }\n ],\n \"source\": {\n \"observer\": \"<string>\",\n \"site\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"subtype\": [\n \"<string>\"\n ],\n \"action\": \"<string>\",\n \"outcome\": \"<string>\",\n \"outcomeDesc\": \"<string>\",\n \"purposeOfEvent\": [\n \"<string>\"\n ],\n \"entity\": [\n {\n \"what\": \"<string>\",\n \"type\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.clinikapi.com/v1/audit-events")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"recorded\": \"<string>\",\n \"agent\": [\n {\n \"who\": \"<string>\",\n \"requestor\": true,\n \"name\": \"<string>\",\n \"role\": \"<string>\",\n \"networkAddress\": \"<string>\"\n }\n ],\n \"source\": {\n \"observer\": \"<string>\",\n \"site\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"subtype\": [\n \"<string>\"\n ],\n \"action\": \"<string>\",\n \"outcome\": \"<string>\",\n \"outcomeDesc\": \"<string>\",\n \"purposeOfEvent\": [\n \"<string>\"\n ],\n \"entity\": [\n {\n \"what\": \"<string>\",\n \"type\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clinikapi.com/v1/audit-events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"<string>\",\n \"recorded\": \"<string>\",\n \"agent\": [\n {\n \"who\": \"<string>\",\n \"requestor\": true,\n \"name\": \"<string>\",\n \"role\": \"<string>\",\n \"networkAddress\": \"<string>\"\n }\n ],\n \"source\": {\n \"observer\": \"<string>\",\n \"site\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"subtype\": [\n \"<string>\"\n ],\n \"action\": \"<string>\",\n \"outcome\": \"<string>\",\n \"outcomeDesc\": \"<string>\",\n \"purposeOfEvent\": [\n \"<string>\"\n ],\n \"entity\": [\n {\n \"what\": \"<string>\",\n \"type\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyAudit Events
Create Audit Event
POST
/
v1
/
audit-events
Create audit event
curl --request POST \
--url https://api.clinikapi.com/v1/audit-events \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"type": "<string>",
"recorded": "<string>",
"agent": [
{
"who": "<string>",
"requestor": true,
"name": "<string>",
"role": "<string>",
"networkAddress": "<string>"
}
],
"source": {
"observer": "<string>",
"site": "<string>",
"type": "<string>"
},
"subtype": [
"<string>"
],
"action": "<string>",
"outcome": "<string>",
"outcomeDesc": "<string>",
"purposeOfEvent": [
"<string>"
],
"entity": [
{
"what": "<string>",
"type": "<string>",
"role": "<string>",
"name": "<string>",
"description": "<string>"
}
]
}
'import requests
url = "https://api.clinikapi.com/v1/audit-events"
payload = {
"type": "<string>",
"recorded": "<string>",
"agent": [
{
"who": "<string>",
"requestor": True,
"name": "<string>",
"role": "<string>",
"networkAddress": "<string>"
}
],
"source": {
"observer": "<string>",
"site": "<string>",
"type": "<string>"
},
"subtype": ["<string>"],
"action": "<string>",
"outcome": "<string>",
"outcomeDesc": "<string>",
"purposeOfEvent": ["<string>"],
"entity": [
{
"what": "<string>",
"type": "<string>",
"role": "<string>",
"name": "<string>",
"description": "<string>"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: '<string>',
recorded: '<string>',
agent: [
{
who: '<string>',
requestor: true,
name: '<string>',
role: '<string>',
networkAddress: '<string>'
}
],
source: {observer: '<string>', site: '<string>', type: '<string>'},
subtype: ['<string>'],
action: '<string>',
outcome: '<string>',
outcomeDesc: '<string>',
purposeOfEvent: ['<string>'],
entity: [
{
what: '<string>',
type: '<string>',
role: '<string>',
name: '<string>',
description: '<string>'
}
]
})
};
fetch('https://api.clinikapi.com/v1/audit-events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.clinikapi.com/v1/audit-events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => '<string>',
'recorded' => '<string>',
'agent' => [
[
'who' => '<string>',
'requestor' => true,
'name' => '<string>',
'role' => '<string>',
'networkAddress' => '<string>'
]
],
'source' => [
'observer' => '<string>',
'site' => '<string>',
'type' => '<string>'
],
'subtype' => [
'<string>'
],
'action' => '<string>',
'outcome' => '<string>',
'outcomeDesc' => '<string>',
'purposeOfEvent' => [
'<string>'
],
'entity' => [
[
'what' => '<string>',
'type' => '<string>',
'role' => '<string>',
'name' => '<string>',
'description' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.clinikapi.com/v1/audit-events"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"recorded\": \"<string>\",\n \"agent\": [\n {\n \"who\": \"<string>\",\n \"requestor\": true,\n \"name\": \"<string>\",\n \"role\": \"<string>\",\n \"networkAddress\": \"<string>\"\n }\n ],\n \"source\": {\n \"observer\": \"<string>\",\n \"site\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"subtype\": [\n \"<string>\"\n ],\n \"action\": \"<string>\",\n \"outcome\": \"<string>\",\n \"outcomeDesc\": \"<string>\",\n \"purposeOfEvent\": [\n \"<string>\"\n ],\n \"entity\": [\n {\n \"what\": \"<string>\",\n \"type\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.clinikapi.com/v1/audit-events")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"recorded\": \"<string>\",\n \"agent\": [\n {\n \"who\": \"<string>\",\n \"requestor\": true,\n \"name\": \"<string>\",\n \"role\": \"<string>\",\n \"networkAddress\": \"<string>\"\n }\n ],\n \"source\": {\n \"observer\": \"<string>\",\n \"site\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"subtype\": [\n \"<string>\"\n ],\n \"action\": \"<string>\",\n \"outcome\": \"<string>\",\n \"outcomeDesc\": \"<string>\",\n \"purposeOfEvent\": [\n \"<string>\"\n ],\n \"entity\": [\n {\n \"what\": \"<string>\",\n \"type\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clinikapi.com/v1/audit-events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"<string>\",\n \"recorded\": \"<string>\",\n \"agent\": [\n {\n \"who\": \"<string>\",\n \"requestor\": true,\n \"name\": \"<string>\",\n \"role\": \"<string>\",\n \"networkAddress\": \"<string>\"\n }\n ],\n \"source\": {\n \"observer\": \"<string>\",\n \"site\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"subtype\": [\n \"<string>\"\n ],\n \"action\": \"<string>\",\n \"outcome\": \"<string>\",\n \"outcomeDesc\": \"<string>\",\n \"purposeOfEvent\": [\n \"<string>\"\n ],\n \"entity\": [\n {\n \"what\": \"<string>\",\n \"type\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Your ClinikAPI secret key (clk_live_* or clk_test_*)
Body
application/json
Event type code (e.g. rest, login, export)
Maximum string length:
200ISO 8601 timestamp
Maximum string length:
50Required array length:
1 - 20 elementsShow child attributes
Show child attributes
Show child attributes
Show child attributes
Maximum array length:
10Maximum string length:
200C, R, U, D, E
Maximum string length:
100=success, 4=minor, 8=serious, 12=major
Maximum string length:
10Maximum string length:
2000Maximum array length:
10Maximum string length:
200Maximum array length:
20Show child attributes
Show child attributes
Response
201
Audit event created
⌘I