Skip to main content

Request to Alter the Connector Offsets

POST 

/connect/v1/environments/:environment_id/clusters/:kafka_cluster_id/connectors/:connector_name/offsets/request

General Availability

Request to alter the offsets of a connector. This supports the ability to PATCH/DELETE the offsets of a connector. Note, you will see momentary downtime as this will internally stop the connector, while the offsets are being altered. You can only make one alter offsets request at a time for a connector.

Request

Responses

Accepted

OpenAPI definition (YAML)
paths:
  /connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connectors/{connector_name}/offsets/request:
    post:
      x-lifecycle-stage: General Availability
      operationId: alterConnectv1ConnectorOffsetsRequest
      description: '[![General Availability](https://img.shields.io/badge/Lifecycle%20Stage-General%20Availability-%2345c6e8)](#section/Versioning/API-Lifecycle-Policy)


        Request to alter the offsets of a connector. This supports the ability to PATCH/DELETE the offsets
        of a connector.

        Note, you will see momentary downtime as this will internally stop the connector, while the offsets
        are being altered.

        You can only make one alter offsets request at a time for a connector.'
      tags:
      - Offsets (connect/v1)
      security:
      - cloud-api-key: []
      - confluent-sts-access-token: []
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                type: object
                description: The request made to alter offsets.
                properties:
                  id:
                    type: string
                    description: The ID of the connector.
                  name:
                    type: string
                    description: The name of the connector.
                  offsets:
                    type: array
                    description: Array of offsets which are categorised into partitions.
                    items:
                      type: object
                      properties:
                        partition:
                          type: object
                          additionalProperties: true
                          description: "The partition information. For sink connectors this is the kafka\
                            \ topic and \npartition. For source connectors this is depends on the partitions\
                            \ defined by the \nsource connector. For example, the table which this task\
                            \ is pulling data from in a\nJDBC based MySQL source connector.\nPlease refer\
                            \ to the [documentation](https://docs.confluent.io/cloud/current/connectors/offsets.html#manage-offsets-for-fully-managed-connectors-in-ccloud)\
                            \ for \nmore information."
                        offset:
                          type: object
                          additionalProperties: true
                          description: "The offset of the partition. For sink connectors this is the kafka\
                            \ offset. For \nsource connectors this is depends on the offset defined by\
                            \ the source connector. \nFor example, the timestamp and incrementing column\
                            \ info in a table, for a JDBC based \nMySQL source connector.\nPlease refer\
                            \ to the [documentation](https://docs.confluent.io/cloud/current/connectors/offsets.html#manage-offsets-for-fully-managed-connectors-in-ccloud)\
                            \ for \nmore information."
                    title: connect.v1.Offsets
                  requested_at:
                    type: string
                    format: date-time
                    readOnly: true
                    example: '2024-02-20 15:14:19+00:00'
                    description: The time at which the request was made. The time is in UTC, ISO 8601
                      format.
                  type:
                    type: string
                    enum:
                    - PATCH
                    - DELETE
                    description: "The type of alter operation. PATCH will update the offset to the provided\
                      \ values.\nThe update will only happen for the partitions provided in the request.\
                      \ \nDELETE will delete the offset for the provided partitions and reset them back\
                      \ to the\nbase state. It is as if, a fresh new connector was created.\n\nFor sink\
                      \ connectors PATCH/DELETE will move the offsets to the provided point in the \n\
                      topic partition. If the offset provided is not present in the topic partition it\
                      \ will\nby default reset to the earliest offset in the topic partition.\n\nFor source\
                      \ connectors, post PATCH/DELETE the connector will attempt to read from the \nposition\
                      \ defined in the altered offsets."
                    title: connect.v1.AlterOffsetRequestType
                required:
                - id
                - name
                - type
                - requested_at
                title: connect.v1.AlterOffsetRequestInfo
              examples:
                patch:
                  value:
                    id: lcc-sa32er
                    name: MySinkConnector
                    offsets:
                    - partition:
                        kafka_partition: 0
                        kafka_topic: topic_A
                      offset:
                        kafka_offset: 1000
                    requested_at: '2024-02-20 15:14:19+00:00'
                    type: PATCH
                delete:
                  value:
                    id: lcc-234ds
                    name: MySourceConnector
                    offsets: []
                    requested_at: '2024-02-20 15:14:19+00:00'
                    type: DELETE
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    description: Connector Error with error code and message.
                    properties:
                      code:
                        type: integer
                        description: Error code for the type of error
                      message:
                        type: string
                        description: Human readable error message
                title: connect.v1.ConnectorError
              example:
                error:
                  code: 400
                  message: Bad Request
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    description: Connector Error with error code and message.
                    properties:
                      code:
                        type: integer
                        description: Error code for the type of error
                      message:
                        type: string
                        description: Human readable error message
                title: connect.v1.ConnectorError
              example:
                error:
                  code: 401
                  message: Unauthorized
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    description: Connector Error with error code and message.
                    properties:
                      code:
                        type: integer
                        description: Error code for the type of error
                      message:
                        type: string
                        description: Human readable error message
                title: connect.v1.ConnectorError
              example:
                error:
                  code: 403
                  message: Forbidden
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    description: Connector Error with error code and message.
                    properties:
                      code:
                        type: integer
                        description: Error code for the type of error
                      message:
                        type: string
                        description: Human readable error message
                title: connect.v1.ConnectorError
              example:
                error:
                  code: 404
                  message: resource 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: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    description: Connector Error with error code and message.
                    properties:
                      code:
                        type: integer
                        description: Error code for the type of error
                      message:
                        type: string
                        description: Human readable error message
                title: connect.v1.ConnectorError
              example:
                error:
                  code: 500
                  message: Oops, something went wrong
      requestBody:
        content:
          application/json:
            schema:
              type: object
              description: Request to alter the offset of a connector. The offsets parameter is options
                for DELETE type.
              properties:
                type:
                  type: string
                  enum:
                  - PATCH
                  - DELETE
                  description: "The type of alter operation. PATCH will update the offset to the provided\
                    \ values.\nThe update will only happen for the partitions provided in the request.\
                    \ \nDELETE will delete the offset for the provided partitions and reset them back\
                    \ to the\nbase state. It is as if, a fresh new connector was created.\n\nFor sink\
                    \ connectors PATCH/DELETE will move the offsets to the provided point in the \ntopic\
                    \ partition. If the offset provided is not present in the topic partition it will\n\
                    by default reset to the earliest offset in the topic partition.\n\nFor source connectors,\
                    \ post PATCH/DELETE the connector will attempt to read from the \nposition defined\
                    \ in the altered offsets."
                  title: connect.v1.AlterOffsetRequestType
                offsets:
                  type: array
                  description: Array of offsets which are categorised into partitions.
                  items:
                    type: object
                    properties:
                      partition:
                        type: object
                        additionalProperties: true
                        description: "The partition information. For sink connectors this is the kafka\
                          \ topic and \npartition. For source connectors this is depends on the partitions\
                          \ defined by the \nsource connector. For example, the table which this task\
                          \ is pulling data from in a\nJDBC based MySQL source connector.\nPlease refer\
                          \ to the [documentation](https://docs.confluent.io/cloud/current/connectors/offsets.html#manage-offsets-for-fully-managed-connectors-in-ccloud)\
                          \ for \nmore information."
                      offset:
                        type: object
                        additionalProperties: true
                        description: "The offset of the partition. For sink connectors this is the kafka\
                          \ offset. For \nsource connectors this is depends on the offset defined by the\
                          \ source connector. \nFor example, the timestamp and incrementing column info\
                          \ in a table, for a JDBC based \nMySQL source connector.\nPlease refer to the\
                          \ [documentation](https://docs.confluent.io/cloud/current/connectors/offsets.html#manage-offsets-for-fully-managed-connectors-in-ccloud)\
                          \ for \nmore information."
                  title: connect.v1.Offsets
              required:
              - type
              title: connect.v1.AlterOffsetRequest
            examples:
              patch sink:
                value:
                  type: PATCH
                  offsets:
                  - partition:
                      kafka_partition: 0
                      kafka_topic: topic_A
                    offset:
                      kafka_offset: 1000
              patch source:
                value:
                  type: PATCH
                  offsets:
                  - partition:
                      protocol: 1
                      table: sourcedb.sourcetable
                    offset:
                      timestamp_nanos: 0
                      incrementing: 3
                      timestamp: 1699000000000
              delete:
                value:
                  type: DELETE
      parameters:
      - name: connector_name
        in: path
        schema:
          type: string
        required: true
        description: The unique name of the connector.
      - name: environment_id
        in: path
        schema:
          type: string
        required: true
        description: The unique identifier of the environment this resource belongs to.
      - name: kafka_cluster_id
        in: path
        schema:
          type: string
        required: true
        description: The unique identifier for the Kafka cluster.
      servers:
      - url: https://api.confluent.cloud
        description: Confluent Cloud API
      jsonRequestBodyExample:
        type: PATCH
        offsets:
        - partition: {}
          offset: {}