Skip to Content
kosemdocs
ReferenceAPIAudit log settings

Update audit log settings in organization

Changes the audit log settings of an organization or a project. The body is a JSON merge patch (RFC 7396), sent as application/merge-patch+json: a setting left out keeps its value, null unsets it, so that it takes what the level above makes apply, and a value replaces it, a list's whole. With If-Match, the update fails with failed_precondition, as 412, if the settings changed since it was read.

PATCH
/v1/organizations/{organization}/settings/auditLog

Changes the audit log settings of an organization or a project.

The body is a JSON merge patch (RFC 7396), sent as application/merge-patch+json: a setting left out keeps its value, null unsets it, so that it takes what the level above makes apply, and a value replaces it, a list's whole. With If-Match, the update fails with failed_precondition, as 412, if the settings changed since it was read.

Authorization

bearer
headerAuthorizationBearer <token>

An access token, or an API key.

Path Parameters

organization*string

The organization's ID.

Match^org_[0-7][0-9a-hjkmnp-tv-z]{25}$

Header Parameters

If-Match?string

The ETag of the settings as they were read: the update fails with failed_precondition, as 412, if they changed since.

Request Body

application/merge-patch+json
  1. body
dataAccess?array<>|

Which calls Data Access records, by service, each at most once, replacing those set; or null to record nothing besides what the level above records.

Items1 <= items
dataAccessRetentionDays?|

How many days Data Access entries are kept, from 1 to 400, or null for 30. Organizations only. Keeping them for less time deletes the older ones within the hour.

Formatint32
Range1 <= value <= 400

Response Body

OK

application/json
  1. response
dataAccess?array<>

Which calls Data Access records, by service, as set here, besides what the level above records; absent while unset, which adds nothing to it. Reads of audit logs are recorded whatever it says.

dataAccessRetentionDays?integer

How many days Data Access entries are kept, those of the organization's projects included; absent while unset, which keeps them 30 days. Organizations only.

Formatint32
effective*

What the level above makes apply, which this level adds to and cannot turn off: for a project, its organization's effective settings; for an organization, kosem's defaults, which record nothing and keep Data Access entries 30 days.

inherited*

What the level above makes apply, which this level adds to and cannot turn off: for a project, its organization's effective settings; for an organization, kosem's defaults, which record nothing and keep Data Access entries 30 days.

name*string

Resource name, organizations/{organization_id}/settings/auditLog or projects/{project_id}/settings/auditLog.

updateTime?string

When the settings set here last changed; absent if they never did.

Formatdate-time
Example Request
curl -X PATCH 'https://api.kosem.ai/v1/organizations/string/settings/auditLog' \
  -H 'Content-Type: application/merge-patch+json' \
  -d '{}'
Example Response
{
  "dataAccess": [
    {
      "service": "string",
      "types": [
        "ADMIN_READ"
      ]
    }
  ],
  "dataAccessRetentionDays": 0,
  "effective": {
    "dataAccess": [
      {
        "service": "string",
        "types": [
          {
            "source": "organization",
            "value": "ADMIN_READ"
          }
        ]
      }
    ],
    "dataAccessRetentionDays": {
      "source": "organization",
      "value": 0
    }
  },
  "inherited": {
    "dataAccess": [
      {
        "service": "string",
        "types": [
          {
            "source": "organization",
            "value": "ADMIN_READ"
          }
        ]
      }
    ],
    "dataAccessRetentionDays": {
      "source": "organization",
      "value": 0
    }
  },
  "name": "string",
  "updateTime": "2019-08-24T14:15:22Z"
}