# Security

10 endpoints at `https://api.kosa8.com`, sent with `Authorization: Bearer $KOSA8_API_KEY`. Generated from the API's own [OpenAPI description](https://api.kosa8.com/openapi.json), which a test holds to the router.

## The org's security checklist from its own settings, with passed/total[#]

GET`/v1/security/posture`scope audit:read

Responses

200401403

```
curl -s -X GET https://api.kosa8.com/v1/security/posture \
  -H "Authorization: Bearer $KOSA8_API_KEY"
```

## Every API key and member, with the sandboxes and functions each made[#]

GET`/v1/security/inventory`scope audit:read

Responses

200401403

```
curl -s -X GET https://api.kosa8.com/v1/security/inventory \
  -H "Authorization: Bearer $KOSA8_API_KEY"
```

## A JSON bundle of the posture and audit events in a range, with its SHA-256[#]

GET`/v1/security/evidence`scope audit:read

Parameters

`since`query · string

since

`until`query · string

until

Responses

200400401403

```
curl -s -X GET https://api.kosa8.com/v1/security/evidence \
  -H "Authorization: Bearer $KOSA8_API_KEY"
```

## Whether the org is frozen[#]

GET`/v1/security/freeze`any key

Responses

200401403

```
curl -s -X GET https://api.kosa8.com/v1/security/freeze \
  -H "Authorization: Bearer $KOSA8_API_KEY"
```

## Freeze the org: refuse new work, sleep running sandboxes, optionally suspend keys[#]

POST`/v1/security/freeze`scope admin

JSON body

`confirm`requiredstring

The organization's name, typed

`reason`string

—

`suspend_keys`boolean

—

Responses

200400401403409

```
curl -s -X POST https://api.kosa8.com/v1/security/freeze \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json
```

## Unfreeze the org; suspended keys are restored unless restore_keys is false[#]

POST`/v1/security/unfreeze`scope admin

JSON body

`confirm`requiredstring

—

`restore_keys`boolean

—

Responses

200400401403409

```
curl -s -X POST https://api.kosa8.com/v1/security/unfreeze \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json
```

## Where the audit log streams[#]

GET`/v1/security/siem`scope admin

Responses

200401403

```
curl -s -X GET https://api.kosa8.com/v1/security/siem \
  -H "Authorization: Bearer $KOSA8_API_KEY"
```

## Stream the audit log as OCSF API Activity to a webhook (any HTTPS endpoint), Splunk HEC, Datadog, or an S3 or R2 bucket[#]

POST`/v1/security/siem`scope admin

JSON body

`kind`required"webhook" | "splunk_hec" | "datadog" | "s3" | "r2"

—

`name`string

—

`url`string

—

`bucket`string

s3, r2

`region`string

s3 (default us-east-1)

`endpoint`string

s3: an S3-compatible store's https origin

`account_id`string

r2: your Cloudflare account id

`jurisdiction`"eu" | "fedramp"

r2

`access_key_id`string

—

`secret_access_key`string

—

`prefix`string

s3, r2: default kosa8-audit/; objects are <prefix><org_id>/YYYY/MM/DD/<seq range>.ndjson

`token`string

—

`api_key`string

—

`site`string

—

`index`string

—

`sourcetype`string

—

`start`"beginning" | "now"

—

Responses

200400401403409

```
curl -s -X POST https://api.kosa8.com/v1/security/siem \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json
```

## Stop streaming to a destination[#]

DELETE`/v1/security/siem/{id}`scope admin

Parameters

`id`requiredpath · string

Id

Responses

200401403404

```
curl -s -X DELETE https://api.kosa8.com/v1/security/siem/$SBX \
  -H "Authorization: Bearer $KOSA8_API_KEY"
```

## Send one test event now[#]

POST`/v1/security/siem/{id}/test`scope admin

Parameters

`id`requiredpath · string

Id

Responses

200401403404

```
curl -s -X POST https://api.kosa8.com/v1/security/siem/$SBX/test \
  -H "Authorization: Bearer $KOSA8_API_KEY"
```

---
Source: https://docs.kosa8.com/api/security/
