Skip to content
GitHubLog inStart free
cetra is not released yet. These docs describe the development version.

Create or update the organization's audit stream

PUT
/api/v1/orgs/{org}/audit-stream
curl --request PUT \
--url http://localhost:8080/api/v1/orgs/example/audit-stream \
--header 'Content-Type: application/json' \
--cookie cetra_session=<cetra_session> \
--data '{ "enabled": true, "header_name": "example", "header_value": "example", "url": "example" }'

Owners only, with a session, and the audit_log feature. Creating returns 201 with the signing secret, shown once; updating returns 200 and keeps the secret. The URL must be https and carry no user information; the header is one name and value (400 field_error). Records are sent from the destination’s creation on: history is not replayed.

org
required
string

Org UUID or slug.

Media typeapplication/json

PUT body of the stream. The URL must be https and carry no user information; the optional header is one name and one value, sealed and never returned. Without header_value, a stored header keeps its value when the name is unchanged.

object
enabled
required

Whether records are sent.

boolean
header_name

The optional header’s name, for example Authorization.

string
header_value

The header’s value, at most 1,024 bytes. Never returned.

string
url
required

The endpoint, an https URL of at most 2,048 bytes. Never returned.

string

Example generated

{
"enabled": true,
"header_name": "example",
"header_value": "example",
"url": "example"
}

The updated destination.

Media typeapplication/json

The SIEM stream destination of an org or of the instance (track EA M4, D-EA-11). The URL, the signing secret and the header value are never returned. An absent optional field is omitted, never null (spec 09).

object
enabled
required

Whether records are sent.

boolean
header_name

The optional header’s name. Its value is never returned. Omitted when there is none.

string
status
required

How the stream is doing. Records are sent oldest first, at least once.

object
failing_since

When the current run of failures began. Omitted when the last attempt worked.

string format: date-time
lag
required

Records not yet accepted by the endpoint.

integer format: int64
last_error

The class of the last failure, when the last attempt failed. Never a URL or a value.

string
last_success_at

The last delivery the endpoint accepted. Omitted until the first one.

string format: date-time
lost_records
required

Whether retention deleted records before they were sent.

boolean
url_host
required

The endpoint’s host.

string

Example generated

{
"enabled": true,
"header_name": "example",
"status": {
"failing_since": "2026-04-15T12:00:00Z",
"lag": 1,
"last_error": "example",
"last_success_at": "2026-04-15T12:00:00Z",
"lost_records": true
},
"url_host": "example"
}

The created destination and its signing secret.

Media typeapplication/json

201 of the create: the destination, and its signing secret, which is shown only here.

object
secret
required

The signing secret: verify X-Cetra-Signature with it. Shown once.

string
stream
required

The SIEM stream destination of an org or of the instance (track EA M4, D-EA-11). The URL, the signing secret and the header value are never returned. An absent optional field is omitted, never null (spec 09).

object
enabled
required

Whether records are sent.

boolean
header_name

The optional header’s name. Its value is never returned. Omitted when there is none.

string
status
required

How the stream is doing. Records are sent oldest first, at least once.

object
failing_since

When the current run of failures began. Omitted when the last attempt worked.

string format: date-time
lag
required

Records not yet accepted by the endpoint.

integer format: int64
last_error

The class of the last failure, when the last attempt failed. Never a URL or a value.

string
last_success_at

The last delivery the endpoint accepted. Omitted until the first one.

string format: date-time
lost_records
required

Whether retention deleted records before they were sent.

boolean
url_host
required

The endpoint’s host.

string

Example generated

{
"secret": "example",
"stream": {
"enabled": true,
"header_name": "example",
"status": {
"failing_since": "2026-04-15T12:00:00Z",
"lag": 1,
"last_error": "example",
"last_success_at": "2026-04-15T12:00:00Z",
"lost_records": true
},
"url_host": "example"
}
}

The request is malformed or a filter is invalid.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

No credentials, or the credentials are invalid.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The credentials do not allow this operation, or the organization’s plan does not include it (code plan_required).

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The resource does not exist.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The request conflicts with the current state.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

Too many requests.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}