Audit logs
Audit logs are a way to track changes in GroundControl. All actions performed to feature flags, and some actions performed on actors and segments are tracked in the audit logs.
Endpoints
GET/projects/{projectId}/events
List audit logs for a project
List the events of a project
Path parameters
- Name
projectId
- Type
- string
- Description
- Required The project id
Query parameters
- Name
before
- Type
- string
- Description
- Show results before this cursor
- Name
after
- Type
- string
- Description
- Show results after this cursor
Request
GET
/projects/{projectId}/eventsconst options = {method: 'GET', headers: {Authorization: 'Bearer YOUR_API_KEY'}};
fetch('https://api.groundcontrol.sh/projects/P091PL4M90ZWQUZ0/events', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Response
{
"data": [
{
"id": "E091PL4M90ZWQUZ0",
"user": {
"id": "U091PL4M90ZWQUZ0",
"firstName": "Alice",
"lastName": "Smith",
"email": "alice.smith@example.com",
"imageURL": "https://example.com/alice-smith.png"
},
"flagName": "my-flag",
"action": "flag_created",
"description": "The flag was created",
"createdAt": "2023-01-01T00:00:00.000Z"
}
],
"pagination": {
"before": "YWJjZDEyMzQ1Njc4OTB4eXo=",
"after": "MTIzNGFiY2RlZmdoaWprbG1ubw=="
}
}
GET/projects/{projectId}/flags/{flagName}/events
List audit logs for a flag
List the events of a flag
Path parameters
- Name
projectId
- Type
- string
- Description
- Required The project id
- Name
flagName
- Type
- string
- Description
- Required The flag name
Query parameters
- Name
before
- Type
- string
- Description
- Show results before this cursor
- Name
after
- Type
- string
- Description
- Show results after this cursor
Request
GET
/projects/{projectId}/flags/{flagName}/eventsconst options = {method: 'GET', headers: {Authorization: 'Bearer YOUR_API_KEY'}};
fetch('https://api.groundcontrol.sh/projects/P091PL4M90ZWQUZ0/flags/my-flag/events', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Response
{
"data": [
{
"id": "E091PL4M90ZWQUZ0",
"user": {
"id": "U091PL4M90ZWQUZ0",
"firstName": "Alice",
"lastName": "Smith",
"email": "alice.smith@example.com",
"imageURL": "https://example.com/alice-smith.png"
},
"flagName": "my-flag",
"action": "flag_created",
"description": "The flag was created",
"createdAt": "2023-01-01T00:00:00.000Z"
}
],
"pagination": {
"before": "YWJjZDEyMzQ1Njc4OTB4eXo=",
"after": "MTIzNGFiY2RlZmdoaWprbG1ubw=="
}
}