Skip to content

Edit a sink

PATCH
/projects/{project}/sinks/{sink}
curl --request PATCH \
--url https://example.com/api/v1/projects/example/sinks/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "kind": "example", "clickhouse": { "url": "example", "database": "example", "table_prefix": "example", "username": "example", "password": "example", "tls_skip_verify": true, "create_tables": true, "settings": { "additionalProperty": "example" } }, "object_storage": { "endpoint": "example", "region": "example", "bucket": "example", "prefix": "example", "access_key_id": "example", "secret_access_key": "example", "path_style": true, "format": "example", "compression": "example" }, "webhook": { "url": "example", "headers": { "additionalProperty": "example" } }, "event_kinds": [ "example" ], "environments": [ "example" ], "batch_size": 1, "flush_interval": 1, "enabled": true }'

Changes each property present and leaves the others as they are. A sub-object of the sink’s kind replaces its configuration whole, so nothing of the earlier one lingers; the one exception is its secret: ***, as every read answers it, or no secret at all keeps the stored one, and any other value replaces it. The stored secret stays only for the target it was given for: an edit that changes a ClickHouse url, username or tls_skip_verify, or an object storage endpoint or access_key_id, must send the secret again, or is refused invalid_sink with a violation required at the secret. A sub-object of another kind, or a kind other than the sink’s own, is refused kind_immutable. enabled takes false only, which lets the attempt in progress finish and keeps the sink’s place; a sink is enabled with its own operation, which checks the target first. A new target is checked as on creation, and an edit that changes nothing stores and records nothing. An edit of batching or filters applies from the next batch.

project
required
string

The project’s key.

sink
required
string format: uuid

The sink’s identifier.

If-Match
string

The version of the entity this write is based on, as its ETag answered it ("7", or 7), read as RFC 9110 reads If-Match: * matches any current version, and a list ("6", "7") matches when it holds the current one. A weak tag (W/"7") matches nothing, as the comparison is strong. Required: without it the write is refused 428 precondition_required, and with no tag that is the current version 412 version_mismatch, both judged after the request is validated. A header that is neither * nor a list of entity tags is refused 400 invalid_request.

Media typeapplication/json

The properties to change; each absent one is left as it is.

object
name
string
kind

May be left out; naming a kind other than the sink’s own is refused kind_immutable.

string
clickhouse

A ClickHouse sink’s configuration as it is written. Required, and refused invalid_sink when absent: url, database, username and, when creating, password.

object
url
string
database
string
table_prefix

flagnetic when empty.

string
username
string
password

Sealed on arrival. *** or absent keeps the stored password when editing, unless url, username or tls_skip_verify changes, and then it must be sent again.

string
tls_skip_verify
boolean
create_tables

True when absent.

boolean
settings
object
key
additional properties
string
object_storage

An object storage sink’s configuration as it is written. Required, and refused invalid_sink when absent: bucket, access_key_id and, when creating, secret_access_key.

object
endpoint
string
region
string
bucket
string
prefix
string
access_key_id
string
secret_access_key

Sealed on arrival. *** or absent keeps the stored key when editing, unless endpoint or access_key_id changes, and then it must be sent again.

string
path_style
boolean
format

jsonl when empty.

string
compression

gzip for jsonl and zstd for parquet when empty.

string
webhook

A webhook sink’s configuration as it is written. url is required.

object
url
string
headers
object
key
additional properties
string
event_kinds
Array<string>
environments
Array<string>
batch_size
integer
flush_interval
integer
enabled

false only: a sink is enabled with its own operation.

boolean

Example generated

{
"name": "example",
"kind": "example",
"clickhouse": {
"url": "example",
"database": "example",
"table_prefix": "example",
"username": "example",
"password": "example",
"tls_skip_verify": true,
"create_tables": true,
"settings": {
"additionalProperty": "example"
}
},
"object_storage": {
"endpoint": "example",
"region": "example",
"bucket": "example",
"prefix": "example",
"access_key_id": "example",
"secret_access_key": "example",
"path_style": true,
"format": "example",
"compression": "example"
},
"webhook": {
"url": "example",
"headers": {
"additionalProperty": "example"
}
},
"event_kinds": [
"example"
],
"environments": [
"example"
],
"batch_size": 1,
"flush_interval": 1,
"enabled": true
}

The sink as it is now.

Media typeapplication/json

A project’s sink. It carries exactly the one of clickhouse, object_storage and webhook that its kind names. What a sink writes, with the compatibility promise, is in Exported events; how to run one is in Sinks.

One of:
object
id
string format: uuid
name
string
>= 1 characters <= 200 characters
kind

Which target a sink delivers to; fixed when the sink is created.

string
Allowed values: clickhouse object_storage webhook
clickhouse
required

A ClickHouse sink’s configuration, written to its HTTP interface. The platform creates {table_prefix}_exposures, _aliases and _evaluation_summaries when it enables the sink and create_tables is true.

object
url
required

Where the HTTP interface answers; http or https, without credentials.

string
database
required
string
table_prefix
required

Letters, digits and underscores, not starting with a digit.

string
username
required
string
password
required

Always ***; the stored password is never answered.

string
tls_skip_verify
required
boolean
create_tables
required
boolean
settings
required

ClickHouse settings sent with every insert. The ones delivery sets itself are refused.

object
key
additional properties
string
object_storage

An object storage sink’s configuration, for any S3-compatible service.

object
endpoint
required

A scheme, a host and a port; empty for AWS.

string
region
required

Empty asks the bucket.

string
bucket
required
string
prefix
required

Without outer slashes.

string
access_key_id
required
string
secret_access_key
required

Always ***; the stored key is never answered.

string
path_style
required
boolean
format
required
string
Allowed values: jsonl parquet
compression
required

For jsonl; parquet files are always zstd.

string
Allowed values: gzip zstd none
webhook

A webhook sink’s configuration. Its secret is the sink’s, drawn by the server.

object
url
required

Where every batch is posted: https unless the operator set FLAGNETIC_WEBHOOK_ALLOW_HTTP.

string
headers
required

Sent with every call, before the platform’s own. Names starting X-Flagnetic- are refused.

object
key
additional properties
string
event_kinds

The event kinds exported; empty for all of them.

Array<string>
Allowed values: exposure alias evaluation_summary
environments

The keys of the environments whose events are exported; empty for every one.

Array<string>
batch_size

The most events one delivery carries.

integer
flush_interval

Seconds the sink waits between deliveries once it has caught up.

integer
enabled
boolean
health

The first that holds: disabled by a member; stopped after the target kept rejecting batches, until resumed; failing while a stream cannot reach its target; degraded while a dead letter waits; lagging while the oldest undelivered event is older than the operator’s FLAGNETIC_SINK_LAG_WARNING; otherwise healthy.

string
Allowed values: disabled stopped failing degraded lagging healthy
at_risk

Whether retention is about to drop events the sink has not delivered.

boolean
lag_seconds

The age of the oldest undelivered event; null while the sink is disabled.

integer format: int64
nullable
dead_letters

The dead letters waiting to be redelivered or discarded.

integer
gaps

The gaps not yet dismissed.

integer
stopped_at
string format: date-time
nullable
warnings

What the last check of the target found wrong without making delivery impossible.

Array<string>
streams

One per event kind exported once the sink has been enabled; empty before.

Array<object>

One event kind’s delivery. Cursors are never exposed.

object
event_kind
required

A kind of raw event a sink exports, each delivered through a stream of its own. The columns of each kind’s rows, with their types, are in Exported events.

string
Allowed values: exposure alias evaluation_summary
last_delivered_at
required
string format: date-time
nullable
last_failure
required
object
class
required

Why a call to a target failed, from a closed list; a target’s own words are never kept or answered.

string
Allowed values: dns connect tls timeout refused_target redirect status rejected
status
required

The HTTP status the target answered, when it did.

integer
nullable
code
required

The protocol’s own error code, such as a ClickHouse exception or an S3 error code, when the target speaks one.

string
nullable
at
required
string format: date-time
created_at
string format: date-time
updated_at
string format: date-time
version

Counts the entity’s accepted changes, from 1; send it back in If-Match to change the entity.

integer format: int64
>= 1

Example

{
"kind": "clickhouse",
"object_storage": {
"format": "jsonl",
"compression": "gzip"
},
"event_kinds": [
"exposure"
],
"health": "disabled",
"streams": [
{
"event_kind": "exposure",
"last_failure": {
"class": "dns"
}
}
]
}
ETag
string

The entity’s version as a strong entity tag, such as "7", to send back in If-Match.

invalid_request: a parameter that is malformed or out of its range, such as a cursor this API did not return.

Media typeapplication/problem+json

A problem document (RFC 9457). Code-specific values are further members.

object
type
required
string
title
required
string
status
required
integer
code
required

Stable snake_case name of the problem, which clients branch on.

string
detail

An English explanation for humans; never what a client branches on.

string
request_id
required
string
retry_after

Seconds to wait before retrying, for a rate limit.

integer
permission

The permission the caller lacks, for forbidden, or the role’s permission the caller lacks, for role_not_allowed.

string
current_version

The version the entity has now, for version_mismatch.

integer format: int64
references

What still names what the write would remove or hide, for in_use.

Array<object>
object
kind
required

What names it, such as flag, segment or experiment.

string
key
required
string
environment
required

The key of the environment it is named in; null when it is named in every environment.

string
nullable
provider

The slug of the auth provider to sign in through instead, for sso_required.

string
used_by

What keeps an auth provider from being deleted, disabled or edited, for provider_in_use, such as identities, enforced domains or only way in (the only enabled provider while local login is disabled).

Array<string>
failure

Why a system the server asked did not answer as needed, for provider_unreachable; for sink_not_ready the failure class of the target’s check, such as connect or status.

string
failure_status

The HTTP status the target answered, for sink_not_ready, when it answered.

integer
failure_code

The target’s own error code, for sink_not_ready, when it speaks one, such as a ClickHouse exception or an S3 error code.

string
errors
Array<object>
object
pointer
required

JSON Pointer into the request body.

string
code
required
string
detail
required
string
params

The values of the rule broken, such as the bounds of a length, for a client to explain the violation in its own language.

object
key
additional properties
any

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"code": "example",
"detail": "example",
"request_id": "example",
"retry_after": 1,
"permission": "example",
"current_version": 1,
"references": [
{
"kind": "example",
"key": "example",
"environment": "example"
}
],
"provider": "example",
"used_by": [
"example"
],
"failure": "example",
"failure_status": 1,
"failure_code": "example",
"errors": [
{
"pointer": "example",
"code": "example",
"detail": "example",
"params": {}
}
]
}

No credential, or one that is not accepted: unauthenticated without a credential (a session cookie the server did not issue counts as none); invalid_token, token_revoked or token_expired for an API token, with a WWW-Authenticate header naming the code; session_expired for a session that has ended, whose cookie is cleared; invalid_credentials for a sign-in.

Media typeapplication/problem+json

A problem document (RFC 9457). Code-specific values are further members.

object
type
required
string
title
required
string
status
required
integer
code
required

Stable snake_case name of the problem, which clients branch on.

string
detail

An English explanation for humans; never what a client branches on.

string
request_id
required
string
retry_after

Seconds to wait before retrying, for a rate limit.

integer
permission

The permission the caller lacks, for forbidden, or the role’s permission the caller lacks, for role_not_allowed.

string
current_version

The version the entity has now, for version_mismatch.

integer format: int64
references

What still names what the write would remove or hide, for in_use.

Array<object>
object
kind
required

What names it, such as flag, segment or experiment.

string
key
required
string
environment
required

The key of the environment it is named in; null when it is named in every environment.

string
nullable
provider

The slug of the auth provider to sign in through instead, for sso_required.

string
used_by

What keeps an auth provider from being deleted, disabled or edited, for provider_in_use, such as identities, enforced domains or only way in (the only enabled provider while local login is disabled).

Array<string>
failure

Why a system the server asked did not answer as needed, for provider_unreachable; for sink_not_ready the failure class of the target’s check, such as connect or status.

string
failure_status

The HTTP status the target answered, for sink_not_ready, when it answered.

integer
failure_code

The target’s own error code, for sink_not_ready, when it speaks one, such as a ClickHouse exception or an S3 error code.

string
errors
Array<object>
object
pointer
required

JSON Pointer into the request body.

string
code
required
string
detail
required
string
params

The values of the rule broken, such as the bounds of a length, for a client to explain the violation in its own language.

object
key
additional properties
any

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"code": "example",
"detail": "example",
"request_id": "example",
"retry_after": 1,
"permission": "example",
"current_version": 1,
"references": [
{
"kind": "example",
"key": "example",
"environment": "example"
}
],
"provider": "example",
"used_by": [
"example"
],
"failure": "example",
"failure_status": 1,
"failure_code": "example",
"errors": [
{
"pointer": "example",
"code": "example",
"detail": "example",
"params": {}
}
]
}
WWW-Authenticate
string

The caller may not perform the operation: forbidden (with the missing permission), session_required, insufficient_scope, cross_origin for a request signed in by the session cookie, a read included, that the browser says comes from another origin, or, for a write, change_request_required when it would change what a protected environment’s SDKs receive; detail names those environments.

Media typeapplication/problem+json

A problem document (RFC 9457). Code-specific values are further members.

object
type
required
string
title
required
string
status
required
integer
code
required

Stable snake_case name of the problem, which clients branch on.

string
detail

An English explanation for humans; never what a client branches on.

string
request_id
required
string
retry_after

Seconds to wait before retrying, for a rate limit.

integer
permission

The permission the caller lacks, for forbidden, or the role’s permission the caller lacks, for role_not_allowed.

string
current_version

The version the entity has now, for version_mismatch.

integer format: int64
references

What still names what the write would remove or hide, for in_use.

Array<object>
object
kind
required

What names it, such as flag, segment or experiment.

string
key
required
string
environment
required

The key of the environment it is named in; null when it is named in every environment.

string
nullable
provider

The slug of the auth provider to sign in through instead, for sso_required.

string
used_by

What keeps an auth provider from being deleted, disabled or edited, for provider_in_use, such as identities, enforced domains or only way in (the only enabled provider while local login is disabled).

Array<string>
failure

Why a system the server asked did not answer as needed, for provider_unreachable; for sink_not_ready the failure class of the target’s check, such as connect or status.

string
failure_status

The HTTP status the target answered, for sink_not_ready, when it answered.

integer
failure_code

The target’s own error code, for sink_not_ready, when it speaks one, such as a ClickHouse exception or an S3 error code.

string
errors
Array<object>
object
pointer
required

JSON Pointer into the request body.

string
code
required
string
detail
required
string
params

The values of the rule broken, such as the bounds of a length, for a client to explain the violation in its own language.

object
key
additional properties
any

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"code": "example",
"detail": "example",
"request_id": "example",
"retry_after": 1,
"permission": "example",
"current_version": 1,
"references": [
{
"kind": "example",
"key": "example",
"environment": "example"
}
],
"provider": "example",
"used_by": [
"example"
],
"failure": "example",
"failure_status": 1,
"failure_code": "example",
"errors": [
{
"pointer": "example",
"code": "example",
"detail": "example",
"params": {}
}
]
}

not_found: no such project, or nothing under that identifier in it. An unknown project is answered before any permission is judged.

Media typeapplication/problem+json

A problem document (RFC 9457). Code-specific values are further members.

object
type
required
string
title
required
string
status
required
integer
code
required

Stable snake_case name of the problem, which clients branch on.

string
detail

An English explanation for humans; never what a client branches on.

string
request_id
required
string
retry_after

Seconds to wait before retrying, for a rate limit.

integer
permission

The permission the caller lacks, for forbidden, or the role’s permission the caller lacks, for role_not_allowed.

string
current_version

The version the entity has now, for version_mismatch.

integer format: int64
references

What still names what the write would remove or hide, for in_use.

Array<object>
object
kind
required

What names it, such as flag, segment or experiment.

string
key
required
string
environment
required

The key of the environment it is named in; null when it is named in every environment.

string
nullable
provider

The slug of the auth provider to sign in through instead, for sso_required.

string
used_by

What keeps an auth provider from being deleted, disabled or edited, for provider_in_use, such as identities, enforced domains or only way in (the only enabled provider while local login is disabled).

Array<string>
failure

Why a system the server asked did not answer as needed, for provider_unreachable; for sink_not_ready the failure class of the target’s check, such as connect or status.

string
failure_status

The HTTP status the target answered, for sink_not_ready, when it answered.

integer
failure_code

The target’s own error code, for sink_not_ready, when it speaks one, such as a ClickHouse exception or an S3 error code.

string
errors
Array<object>
object
pointer
required

JSON Pointer into the request body.

string
code
required
string
detail
required
string
params

The values of the rule broken, such as the bounds of a length, for a client to explain the violation in its own language.

object
key
additional properties
any

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"code": "example",
"detail": "example",
"request_id": "example",
"retry_after": 1,
"permission": "example",
"current_version": 1,
"references": [
{
"kind": "example",
"key": "example",
"environment": "example"
}
],
"provider": "example",
"used_by": [
"example"
],
"failure": "example",
"failure_status": 1,
"failure_code": "example",
"errors": [
{
"pointer": "example",
"code": "example",
"detail": "example",
"params": {}
}
]
}

version_mismatch: the entity changed since the version If-Match names; current_version is the version it has now.

Media typeapplication/problem+json

A problem document (RFC 9457). Code-specific values are further members.

object
type
required
string
title
required
string
status
required
integer
code
required

Stable snake_case name of the problem, which clients branch on.

string
detail

An English explanation for humans; never what a client branches on.

string
request_id
required
string
retry_after

Seconds to wait before retrying, for a rate limit.

integer
permission

The permission the caller lacks, for forbidden, or the role’s permission the caller lacks, for role_not_allowed.

string
current_version

The version the entity has now, for version_mismatch.

integer format: int64
references

What still names what the write would remove or hide, for in_use.

Array<object>
object
kind
required

What names it, such as flag, segment or experiment.

string
key
required
string
environment
required

The key of the environment it is named in; null when it is named in every environment.

string
nullable
provider

The slug of the auth provider to sign in through instead, for sso_required.

string
used_by

What keeps an auth provider from being deleted, disabled or edited, for provider_in_use, such as identities, enforced domains or only way in (the only enabled provider while local login is disabled).

Array<string>
failure

Why a system the server asked did not answer as needed, for provider_unreachable; for sink_not_ready the failure class of the target’s check, such as connect or status.

string
failure_status

The HTTP status the target answered, for sink_not_ready, when it answered.

integer
failure_code

The target’s own error code, for sink_not_ready, when it speaks one, such as a ClickHouse exception or an S3 error code.

string
errors
Array<object>
object
pointer
required

JSON Pointer into the request body.

string
code
required
string
detail
required
string
params

The values of the rule broken, such as the bounds of a length, for a client to explain the violation in its own language.

object
key
additional properties
any

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"code": "example",
"detail": "example",
"request_id": "example",
"retry_after": 1,
"permission": "example",
"current_version": 1,
"references": [
{
"kind": "example",
"key": "example",
"environment": "example"
}
],
"provider": "example",
"used_by": [
"example"
],
"failure": "example",
"failure_status": 1,
"failure_code": "example",
"errors": [
{
"pointer": "example",
"code": "example",
"detail": "example",
"params": {}
}
]
}

The request is well formed but breaks a rule; errors names each field to fix.

Media typeapplication/problem+json

A problem document (RFC 9457). Code-specific values are further members.

object
type
required
string
title
required
string
status
required
integer
code
required

Stable snake_case name of the problem, which clients branch on.

string
detail

An English explanation for humans; never what a client branches on.

string
request_id
required
string
retry_after

Seconds to wait before retrying, for a rate limit.

integer
permission

The permission the caller lacks, for forbidden, or the role’s permission the caller lacks, for role_not_allowed.

string
current_version

The version the entity has now, for version_mismatch.

integer format: int64
references

What still names what the write would remove or hide, for in_use.

Array<object>
object
kind
required

What names it, such as flag, segment or experiment.

string
key
required
string
environment
required

The key of the environment it is named in; null when it is named in every environment.

string
nullable
provider

The slug of the auth provider to sign in through instead, for sso_required.

string
used_by

What keeps an auth provider from being deleted, disabled or edited, for provider_in_use, such as identities, enforced domains or only way in (the only enabled provider while local login is disabled).

Array<string>
failure

Why a system the server asked did not answer as needed, for provider_unreachable; for sink_not_ready the failure class of the target’s check, such as connect or status.

string
failure_status

The HTTP status the target answered, for sink_not_ready, when it answered.

integer
failure_code

The target’s own error code, for sink_not_ready, when it speaks one, such as a ClickHouse exception or an S3 error code.

string
errors
Array<object>
object
pointer
required

JSON Pointer into the request body.

string
code
required
string
detail
required
string
params

The values of the rule broken, such as the bounds of a length, for a client to explain the violation in its own language.

object
key
additional properties
any

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"code": "example",
"detail": "example",
"request_id": "example",
"retry_after": 1,
"permission": "example",
"current_version": 1,
"references": [
{
"kind": "example",
"key": "example",
"environment": "example"
}
],
"provider": "example",
"used_by": [
"example"
],
"failure": "example",
"failure_status": 1,
"failure_code": "example",
"errors": [
{
"pointer": "example",
"code": "example",
"detail": "example",
"params": {}
}
]
}

precondition_required: the write names no version in If-Match.

Media typeapplication/problem+json

A problem document (RFC 9457). Code-specific values are further members.

object
type
required
string
title
required
string
status
required
integer
code
required

Stable snake_case name of the problem, which clients branch on.

string
detail

An English explanation for humans; never what a client branches on.

string
request_id
required
string
retry_after

Seconds to wait before retrying, for a rate limit.

integer
permission

The permission the caller lacks, for forbidden, or the role’s permission the caller lacks, for role_not_allowed.

string
current_version

The version the entity has now, for version_mismatch.

integer format: int64
references

What still names what the write would remove or hide, for in_use.

Array<object>
object
kind
required

What names it, such as flag, segment or experiment.

string
key
required
string
environment
required

The key of the environment it is named in; null when it is named in every environment.

string
nullable
provider

The slug of the auth provider to sign in through instead, for sso_required.

string
used_by

What keeps an auth provider from being deleted, disabled or edited, for provider_in_use, such as identities, enforced domains or only way in (the only enabled provider while local login is disabled).

Array<string>
failure

Why a system the server asked did not answer as needed, for provider_unreachable; for sink_not_ready the failure class of the target’s check, such as connect or status.

string
failure_status

The HTTP status the target answered, for sink_not_ready, when it answered.

integer
failure_code

The target’s own error code, for sink_not_ready, when it speaks one, such as a ClickHouse exception or an S3 error code.

string
errors
Array<object>
object
pointer
required

JSON Pointer into the request body.

string
code
required
string
detail
required
string
params

The values of the rule broken, such as the bounds of a length, for a client to explain the violation in its own language.

object
key
additional properties
any

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"code": "example",
"detail": "example",
"request_id": "example",
"retry_after": 1,
"permission": "example",
"current_version": 1,
"references": [
{
"kind": "example",
"key": "example",
"environment": "example"
}
],
"provider": "example",
"used_by": [
"example"
],
"failure": "example",
"failure_status": 1,
"failure_code": "example",
"errors": [
{
"pointer": "example",
"code": "example",
"detail": "example",
"params": {}
}
]
}