Update a Statement
PUT/sql/v1/organizations/:organization_id/environments/:environment_id/statements/:statement_name
Make a request to update a statement. The request will fail with a 409 Conflict error if the Statement has changed since it was fetched. In this case, do a GET, reapply the modifications, and try the update again.
Request
Responses
- 202
- 400
- 401
- 403
- 404
- 429
- 500
A Statement is being updated.
Response Headers
The unique identifier for the API request.
Bad Request
Response Headers
The unique identifier for the API request.
The request lacks valid authentication credentials for this resource.
Response Headers
The unique identifier for the API request.
The unique identifier for the API request.
Basic error="invalid_key", error_description="The API Key is invalid"The access credentials were considered insufficient to grant access
Response Headers
The unique identifier for the API request.
Not Found
Response Headers
The unique identifier for the API request.
Rate Limit Exceeded
Response Headers
The unique identifier for the API request.
The maximum number of requests you're permitted to make per time period.
The number of requests remaining in the current rate limit window.
The relative time in seconds until the current rate-limit window resets.
Important: This differs from Github and Twitter's same-named header which uses UTC epoch seconds. We use relative time to avoid client/server time synchronization issues.
The number of seconds to wait until the rate limit window resets. Only sent when the rate limit is reached.
Oops, something went wrong!
Response Headers
The unique identifier for the API request.
OpenAPI definition (YAML)
paths:
/sql/v1/organizations/{organization_id}/environments/{environment_id}/statements/{statement_name}:
put:
x-lifecycle-stage: General Availability
x-self-access: true
x-request-access-name: SQL API v1
operationId: updateSqlv1Statement
description: '[](#section/Versioning/API-Lifecycle-Policy)
Make a request to update a statement.
The request will fail with a 409 Conflict error if the Statement has changed since it was fetched.
In this case, do a GET, reapply the modifications, and try the update again.'
parameters:
- in: path
name: organization_id
schema:
type: string
format: uuid
required: true
description: The unique identifier for the organization.
- in: path
name: environment_id
required: true
schema:
type: string
description: The unique identifier for the environment.
- name: statement_name
in: path
required: true
schema:
type: string
description: The unique identifier for the statement.
tags:
- Statements (sql/v1)
security:
- resource-api-key: []
- global-api-key: []
- external-access-token: []
responses:
'202':
description: A Statement is being updated.
headers:
X-Request-Id:
schema:
type: string
description: The unique identifier for the API request.
'400':
description: Bad Request
headers:
X-Request-Id:
schema:
type: string
description: The unique identifier for the API request.
content:
application/json:
schema:
type: object
description: Provides information about problems encountered while performing an operation.
required:
- errors
properties:
errors:
description: List of errors which caused this operation to fail
type: array
items:
type: object
description: Describes a particular error encountered while performing an operation.
properties:
id:
description: A unique identifier for this particular occurrence of the problem.
type: string
maxLength: 255
status:
description: The HTTP status code applicable to this problem, expressed as a
string value.
type: string
code:
description: An application-specific error code, expressed as a string value.
type: string
title:
description: A short, human-readable summary of the problem. It **SHOULD NOT**
change from occurrence to occurrence of the problem, except for purposes of
localization.
type: string
detail:
description: A human-readable explanation specific to this occurrence of the
problem.
type: string
source:
type: object
description: If this error was caused by a particular part of the API request,
the source will point to the query string parameter or request body property
that caused it.
properties:
pointer:
description: A JSON Pointer [RFC6901] to the associated entity in the request
document [e.g. "/spec" for a spec object, or "/spec/title" for a specific
field].
type: string
parameter:
description: A string indicating which query parameter caused the error.
type: string
error_code:
type: integer
format: int32
message:
type: string
nullable: true
additionalProperties: false
title: Error
uniqueItems: true
title: Failure
example:
errors:
- id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d
status: '400'
code: invalid_filter
title: Invalid Filter
detail: The 'delorean' resource can't be filtered by 'num_doors'
source:
parameter: num_doors
'401':
x-summary: Unauthorized
description: The request lacks valid authentication credentials for this resource.
headers:
X-Request-Id:
schema:
type: string
description: The unique identifier for the API request.
WWW-Authenticate:
schema:
type: string
description: The unique identifier for the API request.
example: Basic error="invalid_key", error_description="The API Key is invalid"
content:
application/json:
schema:
type: object
description: Provides information about problems encountered while performing an operation.
required:
- errors
properties:
errors:
description: List of errors which caused this operation to fail
type: array
items:
type: object
description: Describes a particular error encountered while performing an operation.
properties:
id:
description: A unique identifier for this particular occurrence of the problem.
type: string
maxLength: 255
status:
description: The HTTP status code applicable to this problem, expressed as a
string value.
type: string
code:
description: An application-specific error code, expressed as a string value.
type: string
title:
description: A short, human-readable summary of the problem. It **SHOULD NOT**
change from occurrence to occurrence of the problem, except for purposes of
localization.
type: string
detail:
description: A human-readable explanation specific to this occurrence of the
problem.
type: string
source:
type: object
description: If this error was caused by a particular part of the API request,
the source will point to the query string parameter or request body property
that caused it.
properties:
pointer:
description: A JSON Pointer [RFC6901] to the associated entity in the request
document [e.g. "/spec" for a spec object, or "/spec/title" for a specific
field].
type: string
parameter:
description: A string indicating which query parameter caused the error.
type: string
error_code:
type: integer
format: int32
message:
type: string
nullable: true
additionalProperties: false
title: Error
uniqueItems: true
title: Failure
example:
errors:
- id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d
status: '401'
code: user_unauthenticated
title: Authentication Required
detail: Valid authentication credentials must be provided
'403':
x-summary: Forbidden
description: The access credentials were considered insufficient to grant access
headers:
X-Request-Id:
schema:
type: string
description: The unique identifier for the API request.
content:
application/json:
schema:
type: object
description: Provides information about problems encountered while performing an operation.
required:
- errors
properties:
errors:
description: List of errors which caused this operation to fail
type: array
items:
type: object
description: Describes a particular error encountered while performing an operation.
properties:
id:
description: A unique identifier for this particular occurrence of the problem.
type: string
maxLength: 255
status:
description: The HTTP status code applicable to this problem, expressed as a
string value.
type: string
code:
description: An application-specific error code, expressed as a string value.
type: string
title:
description: A short, human-readable summary of the problem. It **SHOULD NOT**
change from occurrence to occurrence of the problem, except for purposes of
localization.
type: string
detail:
description: A human-readable explanation specific to this occurrence of the
problem.
type: string
source:
type: object
description: If this error was caused by a particular part of the API request,
the source will point to the query string parameter or request body property
that caused it.
properties:
pointer:
description: A JSON Pointer [RFC6901] to the associated entity in the request
document [e.g. "/spec" for a spec object, or "/spec/title" for a specific
field].
type: string
parameter:
description: A string indicating which query parameter caused the error.
type: string
error_code:
type: integer
format: int32
message:
type: string
nullable: true
additionalProperties: false
title: Error
uniqueItems: true
title: Failure
example:
errors:
- id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d
status: '403'
code: user_unauthorized
title: User Access Unauthorized
detail: The user 'mcfly' is not allowed to access the 'delorean' resource without the
'plutonium' role.
'404':
description: Not Found
headers:
X-Request-Id:
schema:
type: string
description: The unique identifier for the API request.
content:
application/json:
schema:
type: object
description: Provides information about problems encountered while performing an operation.
required:
- errors
properties:
errors:
description: List of errors which caused this operation to fail
type: array
items:
type: object
description: Describes a particular error encountered while performing an operation.
properties:
id:
description: A unique identifier for this particular occurrence of the problem.
type: string
maxLength: 255
status:
description: The HTTP status code applicable to this problem, expressed as a
string value.
type: string
code:
description: An application-specific error code, expressed as a string value.
type: string
title:
description: A short, human-readable summary of the problem. It **SHOULD NOT**
change from occurrence to occurrence of the problem, except for purposes of
localization.
type: string
detail:
description: A human-readable explanation specific to this occurrence of the
problem.
type: string
source:
type: object
description: If this error was caused by a particular part of the API request,
the source will point to the query string parameter or request body property
that caused it.
properties:
pointer:
description: A JSON Pointer [RFC6901] to the associated entity in the request
document [e.g. "/spec" for a spec object, or "/spec/title" for a specific
field].
type: string
parameter:
description: A string indicating which query parameter caused the error.
type: string
error_code:
type: integer
format: int32
message:
type: string
nullable: true
additionalProperties: false
title: Error
uniqueItems: true
title: Failure
example:
errors:
- id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d
status: '404'
title: Not Found
'429':
description: Rate Limit Exceeded
headers:
X-Request-Id:
schema:
type: string
description: The unique identifier for the API request.
X-RateLimit-Limit:
schema:
type: integer
description: The maximum number of requests you're permitted to make per time period.
X-RateLimit-Remaining:
schema:
type: integer
description: The number of requests remaining in the current rate limit window.
X-RateLimit-Reset:
schema:
type: integer
description: "The relative time in seconds until the current rate-limit window resets. \
\ \n \n**Important:** This differs from Github and Twitter's same-named header which\
\ uses UTC epoch seconds. We use relative time to avoid client/server time synchronization\
\ issues."
Retry-After:
schema:
type: integer
description: The number of seconds to wait until the rate limit window resets. Only sent
when the rate limit is reached.
'500':
description: Oops, something went wrong!
headers:
X-Request-Id:
schema:
type: string
description: The unique identifier for the API request.
content:
application/json:
schema:
type: object
description: Provides information about problems encountered while performing an operation.
required:
- errors
properties:
errors:
description: List of errors which caused this operation to fail
type: array
items:
type: object
description: Describes a particular error encountered while performing an operation.
properties:
id:
description: A unique identifier for this particular occurrence of the problem.
type: string
maxLength: 255
status:
description: The HTTP status code applicable to this problem, expressed as a
string value.
type: string
code:
description: An application-specific error code, expressed as a string value.
type: string
title:
description: A short, human-readable summary of the problem. It **SHOULD NOT**
change from occurrence to occurrence of the problem, except for purposes of
localization.
type: string
detail:
description: A human-readable explanation specific to this occurrence of the
problem.
type: string
source:
type: object
description: If this error was caused by a particular part of the API request,
the source will point to the query string parameter or request body property
that caused it.
properties:
pointer:
description: A JSON Pointer [RFC6901] to the associated entity in the request
document [e.g. "/spec" for a spec object, or "/spec/title" for a specific
field].
type: string
parameter:
description: A string indicating which query parameter caused the error.
type: string
error_code:
type: integer
format: int32
message:
type: string
nullable: true
additionalProperties: false
title: Error
uniqueItems: true
title: Failure
example:
errors:
- id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d
status: '500'
code: out_of_gas
title: DeLorean Out Of Gas
detail: The DeLorean has run out of gas, but Doc Brown will fill 'er up for you asap
requestBody:
content:
application/json:
schema:
allOf:
- type: object
description: '`Statement` represents a core resource used to model SQL statements for
execution.
A statement generalizes DDL, DML, DQL, etc., but doesn’t attempt to handle session
management or any higher-level functionality.
The API allows you to list, create, read, and delete your statements.
'
properties:
metadata:
allOf:
- description: The metadata of the statement.
required:
- self
properties:
self:
description: Self is a Uniform Resource Locator (URL) at which an object can
be addressed. This URL encodes the service location, API version, and other
particulars necessary to locate the resource at a point in time
type: string
format: uri
example: https://flink.us-west1.aws.confluent.cloud/sql/v1/environments/env-123/statements/my-statement
created_at:
type: string
format: date-time
example: '1996-03-19T01:02:03-04:05'
description: The date and time at which this object was created. It is represented
in RFC3339 format and is in UTC.
updated_at:
type: string
format: date-time
example: '2025-11-10T16:20:00Z'
description: The date and time at which this object was last updated. It is
represented in RFC3339 format and is in UTC.
uid:
type: string
example: 12345678-1234-1234-1234-123456789012
description: A system generated globally unique identifier for this resource.
resource_version:
type: string
example: a23av
description: A system generated string that uniquely identifies the version
of this resource.
labels:
type: object
description: A map of key-value pairs that describe the resource.
additionalProperties:
type: string
example:
user.confluent.io/hidden: 'true'
readOnly: true
title: StatementObjectMeta
- properties:
self:
example: https://flink.us-west1.aws.confluent.cloud/sql/v1/environments/env-123/statements/my-statement
uid:
example: 12345678-1234-1234-1234-123456789012
resource_version:
example: a23av
resource_name:
example: ''
labels:
type: object
additionalProperties:
type: string
spec:
type: object
description: The specs of the Statement
properties:
compute_pool_id:
type: string
example: fcp-00000
description: 'The id associated with the compute pool in context.
If not specified, the statement will use the default compute pool. The default
pool is automatically determined by the system.'
maxLength: 255
principal:
type: string
example: sa-abc123
description: "The id of the principal this statement runs as. Possible values:\n\
\n * `u-abc123` — user\n * `sa-abc123` — service account\n * `pool-abc123`\
\ — identity pool (OAuth caller authorized\n against a single pool, either\
\ explicitly supplied or\n resolved by the server)\n * an identity CRN equal\
\ to `status.identity` (OAuth caller\n authorized against multiple identity\
\ pools)\n\nCustomers typically supply one of the short prefixed ids and read\n\
the same value back. The CRN form is server-set in the multi-pool\ncase; clients\
\ should accept it when reading but should not need\nto construct it.\n\nThe\
\ principal can be changed after the statement is created by\nupdating the statement\
\ with a new value. When it is updated,\n`status.identity` is refreshed to reflect\
\ the caller that made\nthe change.\n"
maxLength: 1024
stopped:
type: boolean
description: Indicates whether the statement should be stopped.
example: false
scaling:
description: Mutable scaling configuration that can be updated for a running statement.
type: object
properties:
baseline_cfu:
type: integer
format: int32
description: 'The baseline number of Confluent Flink Units (CFUs) targeted
for the statement.
This is a best-effort target rather than a guarantee, and the statement
may auto-scale above it.
'
example: 2
minimum: 0
title: sql.v1.ScalingSpec
x-enable-listmeta: true
x-enable-objectmeta: true
title: sql.v1.StatementSpec
title: sql.v1.Statement
- type: object
required:
- spec
- metadata
properties:
spec:
type: object
required:
- stopped
metadata:
type: object
required:
- resource_version
servers:
- url: https://flink.region.provider.confluent.cloud
description: Flink Compute Pool Endpoint
jsonRequestBodyExample:
name: sql123
organization_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
environment_id: string
spec:
statement: SELECT * FROM TABLE WHERE VALUE1 = VALUE2;
properties:
sql.current-catalog: my_environment
sql.current-database: my_kafka_cluster
compute_pool_id: fcp-00000
principal: sa-abc123
stopped: false
scaling:
baseline_cfu: 2