JavaScript
import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
const auditEvents = await client.auditEvents.list();
console.log(auditEvents.paging);import os
from courier import Courier
client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # This is the default and can be omitted
)
audit_events = client.audit_events.list()
print(audit_events.paging)package main
import (
"context"
"fmt"
"github.com/trycourier/courier-go"
"github.com/trycourier/courier-go/option"
)
func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
auditEvents, err := client.AuditEvents.List(context.TODO(), courier.AuditEventListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", auditEvents.Paging)
}package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.auditevents.AuditEventListParams;
import com.courier.models.auditevents.AuditEventListResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
AuditEventListResponse auditEvents = client.auditEvents().list();
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
audit_events = courier.audit_events.list
puts(audit_events)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Courier\Client;
use Courier\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('COURIER_API_KEY') ?: 'My API Key');
try {
$auditEvents = $client->auditEvents->list(cursor: 'cursor');
var_dump($auditEvents);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using TryCourier;
using TryCourier.Models.AuditEvents;
CourierClient client = new();
AuditEventListParams parameters = new();
var auditEvents = await client.AuditEvents.List(parameters);
Console.WriteLine(auditEvents);courier audit-events list \
--api-key 'My API Key'curl --request GET \
--url https://api.courier.com/audit-events \
--header 'Authorization: Bearer <token>'{
"paging": {
"cursor": "MTpFWUNFRkRRN0c1WERTRTU2",
"more": true
},
"results": [
{
"auditEventId": "abc-123",
"actor": {
"id": "abc-123",
"email": "user@example.com"
},
"target": "string",
"source": "string",
"timestamp": "2024-01-15T10:30:00.000Z",
"type": "string"
}
]
}Audit Events
Get all audit events
Fetch the list of audit events
GET
/
audit-events
JavaScript
import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
const auditEvents = await client.auditEvents.list();
console.log(auditEvents.paging);import os
from courier import Courier
client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # This is the default and can be omitted
)
audit_events = client.audit_events.list()
print(audit_events.paging)package main
import (
"context"
"fmt"
"github.com/trycourier/courier-go"
"github.com/trycourier/courier-go/option"
)
func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
auditEvents, err := client.AuditEvents.List(context.TODO(), courier.AuditEventListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", auditEvents.Paging)
}package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.auditevents.AuditEventListParams;
import com.courier.models.auditevents.AuditEventListResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
AuditEventListResponse auditEvents = client.auditEvents().list();
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
audit_events = courier.audit_events.list
puts(audit_events)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Courier\Client;
use Courier\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('COURIER_API_KEY') ?: 'My API Key');
try {
$auditEvents = $client->auditEvents->list(cursor: 'cursor');
var_dump($auditEvents);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using TryCourier;
using TryCourier.Models.AuditEvents;
CourierClient client = new();
AuditEventListParams parameters = new();
var auditEvents = await client.AuditEvents.List(parameters);
Console.WriteLine(auditEvents);courier audit-events list \
--api-key 'My API Key'curl --request GET \
--url https://api.courier.com/audit-events \
--header 'Authorization: Bearer <token>'{
"paging": {
"cursor": "MTpFWUNFRkRRN0c1WERTRTU2",
"more": true
},
"results": [
{
"auditEventId": "abc-123",
"actor": {
"id": "abc-123",
"email": "user@example.com"
},
"target": "string",
"source": "string",
"timestamp": "2024-01-15T10:30:00.000Z",
"type": "string"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
A unique identifier that allows for fetching the next set of audit events.
⌘I