# K2K Apps

Kafka 2 Kafka application management

## GET /api/v0/apps/k2k/{name}

> Retrieves a single K2KApp by name.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.2"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_K2KAppWithOptionalMetrics":{"description":"Extends a K2KApp with additional metrics, if available.","allOf":[{"$ref":"#/components/schemas/hq_K2KApp"},{"type":"object","properties":{"metrics":{"$ref":"#/components/schemas/hq_K2KAppMetrics"}}}]},"hq_K2KApp":{"description":"Defines a K2KApp (Kafka-to-Kafka application).","allOf":[{"$ref":"#/components/schemas/hq_BaseManifest"},{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/hq_K2KAppSpec"},"status":{"$ref":"#/components/schemas/hq_K2KAppStatus"}},"required":["spec"]}]},"hq_BaseManifest":{"type":"object","description":"Contains common fields shared by HQ manifests.","properties":{"apiVersion":{"type":"string","minLength":1},"kind":{"type":"string","minLength":1},"metadata":{"$ref":"#/components/schemas/hq_BaseManifestMetadata"}},"required":["apiVersion","kind","metadata"]},"hq_BaseManifestMetadata":{"type":"object","description":"Contains the metadata for a BaseManifest.","properties":{"name":{"type":"string","format":"hq-resource-name"},"displayName":{"type":"string","maxLength":150},"description":{"type":"string","description":"Has the description of the object.","maxLength":280},"id":{"type":"string","description":"Is a unique, read-only identifier.","readOnly":true},"lrn":{"type":"string","description":"Holds the LRN. Read-only.","readOnly":true},"creationTimestamp":{"type":"string","format":"date-time","description":"Is set to the time instant of creation. Read-only.","readOnly":true},"generation":{"type":"integer","description":"Is increased everytime the spec is updated. Read-only.","readOnly":true}},"required":["name"]},"hq_K2KAppSpec":{"type":"object","description":"Specifies a K2KApp (Kafka-to-Kafka application).","properties":{"sourceKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the source KafkaConnection LRN to read from."},"targetKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the target KafkaConnection LRN to write to."},"topics":{"type":"array","description":"Sets the topic(s) to replicate.","minItems":1,"items":{"type":"string","format":"kafka-topic","minLength":1}},"deploymentNamespaceLRN":{"type":"string","format":"kubernetes-namespace-lrn","description":"Defines the Kubernetes namespace to deploy to."},"replicas":{"type":"integer"},"kubernetes":{"$ref":"#/components/schemas/hq_K8sDeploymentOverrides"},"replicator":{"$ref":"#/components/schemas/hq_K2KReplicatorSettings"},"targetTopicMapping":{"$ref":"#/components/schemas/hq_K2KTargetTopicMapping"},"paused":{"type":"boolean","description":"Halts replication by scaling down to zero pods."},"configOverrides":{"$ref":"#/components/schemas/hq_K2KConfigOverrides"},"startFrom":{"$ref":"#/components/schemas/hq_K2KAppStartFrom"}},"required":["sourceKafkaLRN","targetKafkaLRN","deploymentNamespaceLRN","topics"]},"hq_K8sDeploymentOverrides":{"type":"object","properties":{"commonMetadata":{"$ref":"#/components/schemas/hq_K8sMetadata"},"securityContext":{"$ref":"#/components/schemas/hq_K8sSecurityContext"},"imagePullSecrets":{"type":"array","description":"Are passed to the Deployment's imagePullSecrets.","items":{"$ref":"#/components/schemas/hq_K8sLocalObjectReference"}},"serviceAccount":{"type":"string","description":"Is the name of the ServiceAccount to use to run pods.","format":"K8sDns1123Subdomain"},"image":{"type":"string","description":"Overrides the default image deployed."},"resources":{"$ref":"#/components/schemas/hq_K8sResourceRequirements"}}},"hq_K8sMetadata":{"type":"object","description":"Bundles K8s labels and annotations.","properties":{"labels":{"$ref":"#/components/schemas/hq_K8sStringMap"},"annotations":{"$ref":"#/components/schemas/hq_K8sStringMap"}}},"hq_K8sStringMap":{"type":"object","description":"Maps string keys to string values. Used for K8s labels and annotations.","additionalProperties":{"type":"string"}},"hq_K8sSecurityContext":{"type":"object","description":"Allows customisation of a deployment's SecurityContext. Partially\nmirrors a K8s core v1 SecurityContext.\n","properties":{"runAsUser":{"type":"integer","format":"int64","description":"Sets the UID to run the entrypoint of the container process."},"runAsGroup":{"type":"integer","format":"int64","description":"Sets the GID to run the entrypoint of the container process."},"runAsNonRoot":{"type":"boolean","description":"Indicates that the container must run as a non-root user."}}},"hq_K8sLocalObjectReference":{"type":"object","description":"Mirrors a K8s core v1 LocalObjectReference.","properties":{"name":{"type":"string","description":"Name of the referent.","format":"K8sDns1123Subdomain"}},"required":["name"]},"hq_K8sResourceRequirements":{"type":"object","description":"Mirrors a K8s core v1 ResourceRequirements.","properties":{"requests":{"$ref":"#/components/schemas/hq_K8sResourceList"},"limits":{"$ref":"#/components/schemas/hq_K8sResourceList"}}},"hq_K8sResourceList":{"type":"object","description":"Mirrors a K8s core v1 ResourceList.","properties":{"cpu":{"type":"string","format":"K8sResourceQuantity"},"memory":{"type":"string","format":"K8sResourceQuantity"}}},"hq_K2KReplicatorSettings":{"type":"object","description":"Provides additional control knobs for the K2K replicator.","properties":{"schemaMapping":{"type":"boolean","description":"Enables schema replication."},"exactlyOnce":{"type":"boolean","description":"Enables exactly-once processing."},"headerReplication":{"type":"boolean","description":"Replicates the record headers."},"autoCreateTopics":{"type":"boolean","description":"Enables auto creation of topics."},"autoCreateControlTopics":{"type":"boolean","description":"Enables auto creation of control topics."},"keepRecordCreationTimestamp":{"type":"boolean","description":"Enables preserving record timestamps."},"errorHandling":{"$ref":"#/components/schemas/hq_K2KErrorHandlingSettings"},"tracingHeaders":{"$ref":"#/components/schemas/hq_K2KTracingHeadersSettings"},"coordination":{"$ref":"#/components/schemas/hq_K2KCoordinationSettings"},"bidirectional":{"$ref":"#/components/schemas/hq_K2KBidirectionalSettings"}}},"hq_K2KErrorHandlingSettings":{"type":"object","description":"Controls K2K error handling behavior.","properties":{"onCommitSyncTimeout":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"},"onControlMessageDeserializationError":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"}}},"hq_K2KErrorHandlingBehavior":{"type":"string","description":"Specifies error handling behavior.","enum":["fail","ignore"]},"hq_K2KTracingHeadersSettings":{"type":"object","description":"Controls which tracing headers are enabled.","properties":{"partition":{"type":"boolean","description":"Enables the partition tracing header."},"offset":{"type":"boolean","description":"Enables the offset tracing header."},"topic":{"type":"boolean","description":"Enables the topic tracing header."},"pipeline":{"type":"boolean","description":"Enables the pipeline tracing header."}}},"hq_K2KCoordinationSettings":{"type":"object","description":"Controls coordination behavior.","properties":{"commit":{"$ref":"#/components/schemas/hq_K2KCommitCoordinationSettings"},"assignment":{"$ref":"#/components/schemas/hq_K2KAssignmentCoordinationSettings"}}},"hq_K2KCommitCoordinationSettings":{"type":"object","description":"Controls commit coordination settings.","properties":{"topic":{"type":"string","description":"Topic for offset commits."},"syncTimeoutSeconds":{"type":"integer","description":"Time limit in seconds to wait for catchup when reading from the offset control topic.","minimum":1},"batchSize":{"type":"integer","description":"Number of records after which an offset is committed.","minimum":1},"batchTimeoutSeconds":{"type":"integer","description":"Time in seconds to wait before injecting a commit record.","minimum":1}}},"hq_K2KAssignmentCoordinationSettings":{"type":"object","description":"Controls assignment coordination settings.","properties":{"topic":{"type":"string","description":"Topic used for assignment coordination."},"graceWindowSeconds":{"type":"integer","description":"Time in seconds to wait before the application actively fences off other applications.","minimum":1},"fencingMaxParallelism":{"type":"integer","description":"Max parallelism when fencing slow/zombie producers.","minimum":1}}},"hq_K2KBidirectionalSettings":{"type":"object","description":"Controls bidirectional replication behavior.","properties":{"enabled":{"type":"boolean","description":"Enables bidirectional replication."},"mode":{"$ref":"#/components/schemas/hq_K2KBidirectionalMode"},"headerName":{"type":"string","description":"Header name for bidirectional replication detection."}}},"hq_K2KBidirectionalMode":{"type":"string","description":"Controls the bidirectional replication detection identifier. This\nprevents records that are already present in both clusters from being\nreplicated. \"cluster\" uses the source broker's ID; \"pipeline\" uses the\npipeline name set in the configuration.\n","enum":["cluster","pipeline"]},"hq_K2KTargetTopicMapping":{"description":"Controls how source environment topics are mapped to target environment topics.","oneOf":[{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingSourceTopicName"},{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingPrefixSuffix"},{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingRename"},{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingPatternRouting"}],"discriminator":{"propertyName":"type","mapping":{"sourceTopicName":"#/components/schemas/hq_K2KTargetTopicMappingSourceTopicName","prefixSuffix":"#/components/schemas/hq_K2KTargetTopicMappingPrefixSuffix","rename":"#/components/schemas/hq_K2KTargetTopicMappingRename","patternRouting":"#/components/schemas/hq_K2KTargetTopicMappingPatternRouting"}}},"hq_K2KTargetTopicMappingSourceTopicName":{"type":"object","description":"Preserves source topic names (1-to-1 mapping).","required":[]},"hq_K2KTargetTopicMappingPrefixSuffix":{"type":"object","description":"Modifies target topic names by adding a prefix and/or suffix.","anyOf":[{"required":["prefix"]},{"required":["suffix"]}],"properties":{"prefix":{"type":"string","description":"Prefix to prepend to the target topic name.","minLength":1,"format":"kafka-topic-chars"},"suffix":{"type":"string","description":"Suffix to append to the target topic name.","minLength":1,"format":"kafka-topic-chars"}}},"hq_K2KTargetTopicMappingRename":{"type":"object","description":"Renames topics using explicit source-to-target pairs. Use for simple renames that don't fit the prefixSuffix pattern.","properties":{"topics":{"type":"object","description":"A map of source topic names to target topic names.","additionalProperties":{"type":"string","format":"kafka-topic"}}},"required":["topics"]},"hq_K2KTargetTopicMappingPatternRouting":{"type":"object","description":"Routes topics to targets using ordered regex pattern matching rules. The first matching rule wins.","properties":{"rules":{"type":"array","description":"Ordered list of pattern-to-topic mapping rules.","minItems":1,"items":{"$ref":"#/components/schemas/hq_K2KPatternRoutingRule"}}},"required":["rules"]},"hq_K2KPatternRoutingRule":{"type":"object","description":"A single regex pattern-to-topic routing rule.","properties":{"pattern":{"type":"string","description":"Regex pattern to match source topic names.","minLength":1},"topic":{"type":"string","format":"kafka-topic","description":"Target topic name for matched source topics."}},"required":["pattern","topic"]},"hq_K2KConfigOverrides":{"type":"object","description":"Contains arbitrary data that gets merged into the replicator's config.","additionalProperties":{}},"hq_K2KAppStartFrom":{"type":"string","description":"Replication start position. Accepts \"earliest\", \"latest\", or RFC3339 timestamp (e.g., \"2025-01-14T10:00:00Z\"). Only used during app creation."},"hq_K2KAppStatus":{"type":"object","description":"Contains the most recently observed status of a K2KApp. Read-only for clients.","properties":{"updatedAt":{"type":"string","format":"date-time","description":"Contains the time instant this object was updated."},"state":{"$ref":"#/components/schemas/hq_K2KAppState"},"statusLastTransitionAt":{"type":"string","format":"date-time","description":"Contains the time instant the status was changed."},"statusMessage":{"type":"string","description":"Is a human-readable message indicating details about last the transition."},"observedGeneration":{"type":"integer","description":"Reflects the generation of the spec that this status corresponds to."},"deployment":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatus"},"kafka":{"$ref":"#/components/schemas/hq_K2KAppKafkaStatus"}},"required":["updatedAt","state","statusLastTransitionAt","statusMessage","observedGeneration","deployment","kafka"]},"hq_K2KAppState":{"type":"string","description":"Enumerates K2KApp state types.","enum":["deploying","starting","running","paused","error","deleting"]},"hq_KubernetesDeploymentStatus":{"type":"object","description":"Provides information about a Kubernetes deployment.","properties":{"inSync":{"type":"boolean"},"managedResources":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusResource"}},"pods":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusPod"}}},"required":["inSync","managedResources","pods"]},"hq_KubernetesDeploymentStatusResource":{"type":"object","description":"Provides information about a Kubernetes resource.","properties":{"name":{"type":"string","description":"Holds the resource name."},"namespace":{"type":"string","description":"Is set to the resource's namespace."},"kind":{"type":"string","description":"Is set to the resource's kind, e.g. Deployment, ConfigMap, etc."},"status":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Created, Updated, InSync, Error."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way."}},"required":["name","namespace","kind","status"]},"hq_KubernetesDeploymentStatusPod":{"type":"object","properties":{"name":{"type":"string","description":"Holds the Pod name."},"namespace":{"type":"string","description":"Is set to the Pod's namespace."},"state":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Terminating, CrashLoopBackOff, Running, etc."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way, if possible."},"lastTermination":{"$ref":"#/components/schemas/hq_PodTerminationDetails"}},"required":["name","namespace","state"]},"hq_PodTerminationDetails":{"type":"object","properties":{"message":{"type":"string","description":"Last termination message of the pod's container."},"time":{"type":"string","format":"date-time","description":"When the last termination happened for the pod's container."}}},"hq_K2KAppKafkaStatus":{"type":"object","properties":{"consumerGroup":{"type":"string","description":"Holds the name of the consumer group that this K2KApp uses."}},"required":["consumerGroup"]},"hq_K2KAppMetrics":{"type":"object","description":"Tracks metrics for a K2KApp.","properties":{"state":{"$ref":"#/components/schemas/hq_K2KAppMetricsState"},"updated_at":{"format":"date-time","type":"string","description":"Contains the time instant this object as a whole was updated."},"error_message":{"type":"string","description":"Contains the error message if the state is \"error\"."},"source_topics":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KSourceTopic"}},"destination_topics":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KDestinationTopic"}},"errors":{"type":"array","items":{"type":"string"}},"stalled":{"type":"boolean","description":"Whether the pipeline is stalled and likely not progressing."},"stall_message":{"type":"string","description":"Contains the stall message if stalled is true."}},"required":["topic_metrics","updated_at","state","error_message","source_topics","destination_topics","errors","stalled"]},"hq_K2KAppMetricsState":{"type":"string","description":"Enumerates K2KApp metrics states.","enum":["unknown","success","error"]},"hq_K2KSourceTopic":{"type":"object","description":"Tracks metrics for K2K source topics.","properties":{"lrn":{"type":"string"},"name":{"type":"string"},"throughput":{"$ref":"#/components/schemas/hq_K2KSourceThroughput"},"offsets":{"$ref":"#/components/schemas/hq_K2KSourceOffsets"}},"required":["lrn","name"]},"hq_K2KSourceThroughput":{"type":"object","description":"Aggregates throughput metrics for a source topic.","properties":{"updated_at":{"type":"string","format":"date-time"},"bytes_per_second":{"type":"number","format":"double"},"records_per_second":{"type":"number","format":"double"}},"required":["updated_at","bytes_per_second","records_per_second"]},"hq_K2KSourceOffsets":{"type":"object","description":"Aggregates offsets data for a source topic.","properties":{"updated_at":{"type":"string","format":"date-time"},"partitions":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KSourcePartitionOffsets"}}},"required":["updated_at","partitions"]},"hq_K2KSourcePartitionOffsets":{"type":"object","description":"Groups offsets and lag per source partition.","properties":{"partition":{"type":"integer","format":"int64"},"log_end_offset":{"type":"integer","format":"int64","description":"The log end offset of the source topic partition."},"consumer_offset":{"type":"integer","format":"int64","description":"The last offset committed by the K2K consumer on this partition, as stored in K2K's internal control topic (not Kafka's standard __consumer_offsets topic). Absent until the consumer has committed at least once."},"lag":{"type":"integer","format":"int64","description":"Difference between log_end_offset and consumer_offset. Absent when consumer_offset is not yet available."},"truncated":{"type":"boolean","description":"Whether this partition's source topic log was truncated since the previous HQ tick (e.g. broker restart with RF=1)."}},"required":["partition","log_end_offset","truncated"]},"hq_K2KDestinationTopic":{"type":"object","description":"Tracks metrics for K2K destination topics.","properties":{"lrn":{"type":"string"},"name":{"type":"string"},"throughput":{"$ref":"#/components/schemas/hq_K2KDestinationThroughput"},"offsets":{"$ref":"#/components/schemas/hq_K2KDestinationOffsets"}},"required":["lrn","name"]},"hq_K2KDestinationThroughput":{"type":"object","description":"Aggregates throughput metrics for a destination topic.","properties":{"updated_at":{"type":"string","format":"date-time"},"bytes_per_second":{"type":"number","format":"double"},"records_per_second":{"type":"number","format":"double"}},"required":["updated_at","bytes_per_second","records_per_second"]},"hq_K2KDestinationOffsets":{"type":"object","description":"Aggregates offsets and lag data for a destination topic.","properties":{"updated_at":{"type":"string","format":"date-time"},"partitions":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KDestinationPartitionOffsets"}}},"required":["updated_at","partitions"]},"hq_K2KDestinationPartitionOffsets":{"type":"object","description":"Groups offsets and lag data per destination partition.","properties":{"partition":{"type":"integer","format":"int64"},"log_end_offset":{"type":"integer","format":"int64","description":"The log end offset of this partition on the destination Kafka cluster. Represents the actual broker LEO, not the replicated position. Absent when the topic does not yet exist on the destination cluster."},"lag":{"type":"integer","format":"int64","description":"Deprecated: lag is now reported on the source partition. Populated only for 1:1 replication where source and destination share the same topic name and partition layout; absent for repartitioned or renamed topologies.","deprecated":true}},"required":["partition","log_end_offset"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v0/apps/k2k/{name}":{"get":{"description":"Retrieves a single K2KApp by name.","operationId":"getK2KAppV0","parameters":[{"in":"path","name":"name","required":true,"schema":{"type":"string"}},{"in":"query","name":"expand_metrics","required":false,"description":"Includes metrics in the response, if available.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Happy response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KAppWithOptionalMetrics"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_k2kapps"]}}}}
```

## PUT /api/v0/apps/k2k/{name}

> Creates a new K2KApp or updates an existing one.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.2"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_K2KAppWithoutStatus":{"description":"Defines a K2KApp (Kafka-to-Kafka application).","allOf":[{"$ref":"#/components/schemas/hq_BaseManifest"},{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/hq_K2KAppSpec"}},"required":["spec"]}]},"hq_BaseManifest":{"type":"object","description":"Contains common fields shared by HQ manifests.","properties":{"apiVersion":{"type":"string","minLength":1},"kind":{"type":"string","minLength":1},"metadata":{"$ref":"#/components/schemas/hq_BaseManifestMetadata"}},"required":["apiVersion","kind","metadata"]},"hq_BaseManifestMetadata":{"type":"object","description":"Contains the metadata for a BaseManifest.","properties":{"name":{"type":"string","format":"hq-resource-name"},"displayName":{"type":"string","maxLength":150},"description":{"type":"string","description":"Has the description of the object.","maxLength":280},"id":{"type":"string","description":"Is a unique, read-only identifier.","readOnly":true},"lrn":{"type":"string","description":"Holds the LRN. Read-only.","readOnly":true},"creationTimestamp":{"type":"string","format":"date-time","description":"Is set to the time instant of creation. Read-only.","readOnly":true},"generation":{"type":"integer","description":"Is increased everytime the spec is updated. Read-only.","readOnly":true}},"required":["name"]},"hq_K2KAppSpec":{"type":"object","description":"Specifies a K2KApp (Kafka-to-Kafka application).","properties":{"sourceKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the source KafkaConnection LRN to read from."},"targetKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the target KafkaConnection LRN to write to."},"topics":{"type":"array","description":"Sets the topic(s) to replicate.","minItems":1,"items":{"type":"string","format":"kafka-topic","minLength":1}},"deploymentNamespaceLRN":{"type":"string","format":"kubernetes-namespace-lrn","description":"Defines the Kubernetes namespace to deploy to."},"replicas":{"type":"integer"},"kubernetes":{"$ref":"#/components/schemas/hq_K8sDeploymentOverrides"},"replicator":{"$ref":"#/components/schemas/hq_K2KReplicatorSettings"},"targetTopicMapping":{"$ref":"#/components/schemas/hq_K2KTargetTopicMapping"},"paused":{"type":"boolean","description":"Halts replication by scaling down to zero pods."},"configOverrides":{"$ref":"#/components/schemas/hq_K2KConfigOverrides"},"startFrom":{"$ref":"#/components/schemas/hq_K2KAppStartFrom"}},"required":["sourceKafkaLRN","targetKafkaLRN","deploymentNamespaceLRN","topics"]},"hq_K8sDeploymentOverrides":{"type":"object","properties":{"commonMetadata":{"$ref":"#/components/schemas/hq_K8sMetadata"},"securityContext":{"$ref":"#/components/schemas/hq_K8sSecurityContext"},"imagePullSecrets":{"type":"array","description":"Are passed to the Deployment's imagePullSecrets.","items":{"$ref":"#/components/schemas/hq_K8sLocalObjectReference"}},"serviceAccount":{"type":"string","description":"Is the name of the ServiceAccount to use to run pods.","format":"K8sDns1123Subdomain"},"image":{"type":"string","description":"Overrides the default image deployed."},"resources":{"$ref":"#/components/schemas/hq_K8sResourceRequirements"}}},"hq_K8sMetadata":{"type":"object","description":"Bundles K8s labels and annotations.","properties":{"labels":{"$ref":"#/components/schemas/hq_K8sStringMap"},"annotations":{"$ref":"#/components/schemas/hq_K8sStringMap"}}},"hq_K8sStringMap":{"type":"object","description":"Maps string keys to string values. Used for K8s labels and annotations.","additionalProperties":{"type":"string"}},"hq_K8sSecurityContext":{"type":"object","description":"Allows customisation of a deployment's SecurityContext. Partially\nmirrors a K8s core v1 SecurityContext.\n","properties":{"runAsUser":{"type":"integer","format":"int64","description":"Sets the UID to run the entrypoint of the container process."},"runAsGroup":{"type":"integer","format":"int64","description":"Sets the GID to run the entrypoint of the container process."},"runAsNonRoot":{"type":"boolean","description":"Indicates that the container must run as a non-root user."}}},"hq_K8sLocalObjectReference":{"type":"object","description":"Mirrors a K8s core v1 LocalObjectReference.","properties":{"name":{"type":"string","description":"Name of the referent.","format":"K8sDns1123Subdomain"}},"required":["name"]},"hq_K8sResourceRequirements":{"type":"object","description":"Mirrors a K8s core v1 ResourceRequirements.","properties":{"requests":{"$ref":"#/components/schemas/hq_K8sResourceList"},"limits":{"$ref":"#/components/schemas/hq_K8sResourceList"}}},"hq_K8sResourceList":{"type":"object","description":"Mirrors a K8s core v1 ResourceList.","properties":{"cpu":{"type":"string","format":"K8sResourceQuantity"},"memory":{"type":"string","format":"K8sResourceQuantity"}}},"hq_K2KReplicatorSettings":{"type":"object","description":"Provides additional control knobs for the K2K replicator.","properties":{"schemaMapping":{"type":"boolean","description":"Enables schema replication."},"exactlyOnce":{"type":"boolean","description":"Enables exactly-once processing."},"headerReplication":{"type":"boolean","description":"Replicates the record headers."},"autoCreateTopics":{"type":"boolean","description":"Enables auto creation of topics."},"autoCreateControlTopics":{"type":"boolean","description":"Enables auto creation of control topics."},"keepRecordCreationTimestamp":{"type":"boolean","description":"Enables preserving record timestamps."},"errorHandling":{"$ref":"#/components/schemas/hq_K2KErrorHandlingSettings"},"tracingHeaders":{"$ref":"#/components/schemas/hq_K2KTracingHeadersSettings"},"coordination":{"$ref":"#/components/schemas/hq_K2KCoordinationSettings"},"bidirectional":{"$ref":"#/components/schemas/hq_K2KBidirectionalSettings"}}},"hq_K2KErrorHandlingSettings":{"type":"object","description":"Controls K2K error handling behavior.","properties":{"onCommitSyncTimeout":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"},"onControlMessageDeserializationError":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"}}},"hq_K2KErrorHandlingBehavior":{"type":"string","description":"Specifies error handling behavior.","enum":["fail","ignore"]},"hq_K2KTracingHeadersSettings":{"type":"object","description":"Controls which tracing headers are enabled.","properties":{"partition":{"type":"boolean","description":"Enables the partition tracing header."},"offset":{"type":"boolean","description":"Enables the offset tracing header."},"topic":{"type":"boolean","description":"Enables the topic tracing header."},"pipeline":{"type":"boolean","description":"Enables the pipeline tracing header."}}},"hq_K2KCoordinationSettings":{"type":"object","description":"Controls coordination behavior.","properties":{"commit":{"$ref":"#/components/schemas/hq_K2KCommitCoordinationSettings"},"assignment":{"$ref":"#/components/schemas/hq_K2KAssignmentCoordinationSettings"}}},"hq_K2KCommitCoordinationSettings":{"type":"object","description":"Controls commit coordination settings.","properties":{"topic":{"type":"string","description":"Topic for offset commits."},"syncTimeoutSeconds":{"type":"integer","description":"Time limit in seconds to wait for catchup when reading from the offset control topic.","minimum":1},"batchSize":{"type":"integer","description":"Number of records after which an offset is committed.","minimum":1},"batchTimeoutSeconds":{"type":"integer","description":"Time in seconds to wait before injecting a commit record.","minimum":1}}},"hq_K2KAssignmentCoordinationSettings":{"type":"object","description":"Controls assignment coordination settings.","properties":{"topic":{"type":"string","description":"Topic used for assignment coordination."},"graceWindowSeconds":{"type":"integer","description":"Time in seconds to wait before the application actively fences off other applications.","minimum":1},"fencingMaxParallelism":{"type":"integer","description":"Max parallelism when fencing slow/zombie producers.","minimum":1}}},"hq_K2KBidirectionalSettings":{"type":"object","description":"Controls bidirectional replication behavior.","properties":{"enabled":{"type":"boolean","description":"Enables bidirectional replication."},"mode":{"$ref":"#/components/schemas/hq_K2KBidirectionalMode"},"headerName":{"type":"string","description":"Header name for bidirectional replication detection."}}},"hq_K2KBidirectionalMode":{"type":"string","description":"Controls the bidirectional replication detection identifier. This\nprevents records that are already present in both clusters from being\nreplicated. \"cluster\" uses the source broker's ID; \"pipeline\" uses the\npipeline name set in the configuration.\n","enum":["cluster","pipeline"]},"hq_K2KTargetTopicMapping":{"description":"Controls how source environment topics are mapped to target environment topics.","oneOf":[{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingSourceTopicName"},{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingPrefixSuffix"},{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingRename"},{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingPatternRouting"}],"discriminator":{"propertyName":"type","mapping":{"sourceTopicName":"#/components/schemas/hq_K2KTargetTopicMappingSourceTopicName","prefixSuffix":"#/components/schemas/hq_K2KTargetTopicMappingPrefixSuffix","rename":"#/components/schemas/hq_K2KTargetTopicMappingRename","patternRouting":"#/components/schemas/hq_K2KTargetTopicMappingPatternRouting"}}},"hq_K2KTargetTopicMappingSourceTopicName":{"type":"object","description":"Preserves source topic names (1-to-1 mapping).","required":[]},"hq_K2KTargetTopicMappingPrefixSuffix":{"type":"object","description":"Modifies target topic names by adding a prefix and/or suffix.","anyOf":[{"required":["prefix"]},{"required":["suffix"]}],"properties":{"prefix":{"type":"string","description":"Prefix to prepend to the target topic name.","minLength":1,"format":"kafka-topic-chars"},"suffix":{"type":"string","description":"Suffix to append to the target topic name.","minLength":1,"format":"kafka-topic-chars"}}},"hq_K2KTargetTopicMappingRename":{"type":"object","description":"Renames topics using explicit source-to-target pairs. Use for simple renames that don't fit the prefixSuffix pattern.","properties":{"topics":{"type":"object","description":"A map of source topic names to target topic names.","additionalProperties":{"type":"string","format":"kafka-topic"}}},"required":["topics"]},"hq_K2KTargetTopicMappingPatternRouting":{"type":"object","description":"Routes topics to targets using ordered regex pattern matching rules. The first matching rule wins.","properties":{"rules":{"type":"array","description":"Ordered list of pattern-to-topic mapping rules.","minItems":1,"items":{"$ref":"#/components/schemas/hq_K2KPatternRoutingRule"}}},"required":["rules"]},"hq_K2KPatternRoutingRule":{"type":"object","description":"A single regex pattern-to-topic routing rule.","properties":{"pattern":{"type":"string","description":"Regex pattern to match source topic names.","minLength":1},"topic":{"type":"string","format":"kafka-topic","description":"Target topic name for matched source topics."}},"required":["pattern","topic"]},"hq_K2KConfigOverrides":{"type":"object","description":"Contains arbitrary data that gets merged into the replicator's config.","additionalProperties":{}},"hq_K2KAppStartFrom":{"type":"string","description":"Replication start position. Accepts \"earliest\", \"latest\", or RFC3339 timestamp (e.g., \"2025-01-14T10:00:00Z\"). Only used during app creation."},"hq_K2KApp":{"description":"Defines a K2KApp (Kafka-to-Kafka application).","allOf":[{"$ref":"#/components/schemas/hq_BaseManifest"},{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/hq_K2KAppSpec"},"status":{"$ref":"#/components/schemas/hq_K2KAppStatus"}},"required":["spec"]}]},"hq_K2KAppStatus":{"type":"object","description":"Contains the most recently observed status of a K2KApp. Read-only for clients.","properties":{"updatedAt":{"type":"string","format":"date-time","description":"Contains the time instant this object was updated."},"state":{"$ref":"#/components/schemas/hq_K2KAppState"},"statusLastTransitionAt":{"type":"string","format":"date-time","description":"Contains the time instant the status was changed."},"statusMessage":{"type":"string","description":"Is a human-readable message indicating details about last the transition."},"observedGeneration":{"type":"integer","description":"Reflects the generation of the spec that this status corresponds to."},"deployment":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatus"},"kafka":{"$ref":"#/components/schemas/hq_K2KAppKafkaStatus"}},"required":["updatedAt","state","statusLastTransitionAt","statusMessage","observedGeneration","deployment","kafka"]},"hq_K2KAppState":{"type":"string","description":"Enumerates K2KApp state types.","enum":["deploying","starting","running","paused","error","deleting"]},"hq_KubernetesDeploymentStatus":{"type":"object","description":"Provides information about a Kubernetes deployment.","properties":{"inSync":{"type":"boolean"},"managedResources":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusResource"}},"pods":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusPod"}}},"required":["inSync","managedResources","pods"]},"hq_KubernetesDeploymentStatusResource":{"type":"object","description":"Provides information about a Kubernetes resource.","properties":{"name":{"type":"string","description":"Holds the resource name."},"namespace":{"type":"string","description":"Is set to the resource's namespace."},"kind":{"type":"string","description":"Is set to the resource's kind, e.g. Deployment, ConfigMap, etc."},"status":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Created, Updated, InSync, Error."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way."}},"required":["name","namespace","kind","status"]},"hq_KubernetesDeploymentStatusPod":{"type":"object","properties":{"name":{"type":"string","description":"Holds the Pod name."},"namespace":{"type":"string","description":"Is set to the Pod's namespace."},"state":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Terminating, CrashLoopBackOff, Running, etc."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way, if possible."},"lastTermination":{"$ref":"#/components/schemas/hq_PodTerminationDetails"}},"required":["name","namespace","state"]},"hq_PodTerminationDetails":{"type":"object","properties":{"message":{"type":"string","description":"Last termination message of the pod's container."},"time":{"type":"string","format":"date-time","description":"When the last termination happened for the pod's container."}}},"hq_K2KAppKafkaStatus":{"type":"object","properties":{"consumerGroup":{"type":"string","description":"Holds the name of the consumer group that this K2KApp uses."}},"required":["consumerGroup"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v0/apps/k2k/{name}":{"put":{"description":"Creates a new K2KApp or updates an existing one.","operationId":"applyK2KAppV0","parameters":[{"in":"path","name":"name","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/yaml":{"schema":{"$ref":"#/components/schemas/hq_K2KAppWithoutStatus"}},"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KAppWithoutStatus"}}}},"responses":{"201":{"description":"Happy response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KApp"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_k2kapps"]}}}}
```

## DELETE /api/v0/apps/k2k/{name}

> Deletes a single K2KApp by name.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.2"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_K2KApp":{"description":"Defines a K2KApp (Kafka-to-Kafka application).","allOf":[{"$ref":"#/components/schemas/hq_BaseManifest"},{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/hq_K2KAppSpec"},"status":{"$ref":"#/components/schemas/hq_K2KAppStatus"}},"required":["spec"]}]},"hq_BaseManifest":{"type":"object","description":"Contains common fields shared by HQ manifests.","properties":{"apiVersion":{"type":"string","minLength":1},"kind":{"type":"string","minLength":1},"metadata":{"$ref":"#/components/schemas/hq_BaseManifestMetadata"}},"required":["apiVersion","kind","metadata"]},"hq_BaseManifestMetadata":{"type":"object","description":"Contains the metadata for a BaseManifest.","properties":{"name":{"type":"string","format":"hq-resource-name"},"displayName":{"type":"string","maxLength":150},"description":{"type":"string","description":"Has the description of the object.","maxLength":280},"id":{"type":"string","description":"Is a unique, read-only identifier.","readOnly":true},"lrn":{"type":"string","description":"Holds the LRN. Read-only.","readOnly":true},"creationTimestamp":{"type":"string","format":"date-time","description":"Is set to the time instant of creation. Read-only.","readOnly":true},"generation":{"type":"integer","description":"Is increased everytime the spec is updated. Read-only.","readOnly":true}},"required":["name"]},"hq_K2KAppSpec":{"type":"object","description":"Specifies a K2KApp (Kafka-to-Kafka application).","properties":{"sourceKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the source KafkaConnection LRN to read from."},"targetKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the target KafkaConnection LRN to write to."},"topics":{"type":"array","description":"Sets the topic(s) to replicate.","minItems":1,"items":{"type":"string","format":"kafka-topic","minLength":1}},"deploymentNamespaceLRN":{"type":"string","format":"kubernetes-namespace-lrn","description":"Defines the Kubernetes namespace to deploy to."},"replicas":{"type":"integer"},"kubernetes":{"$ref":"#/components/schemas/hq_K8sDeploymentOverrides"},"replicator":{"$ref":"#/components/schemas/hq_K2KReplicatorSettings"},"targetTopicMapping":{"$ref":"#/components/schemas/hq_K2KTargetTopicMapping"},"paused":{"type":"boolean","description":"Halts replication by scaling down to zero pods."},"configOverrides":{"$ref":"#/components/schemas/hq_K2KConfigOverrides"},"startFrom":{"$ref":"#/components/schemas/hq_K2KAppStartFrom"}},"required":["sourceKafkaLRN","targetKafkaLRN","deploymentNamespaceLRN","topics"]},"hq_K8sDeploymentOverrides":{"type":"object","properties":{"commonMetadata":{"$ref":"#/components/schemas/hq_K8sMetadata"},"securityContext":{"$ref":"#/components/schemas/hq_K8sSecurityContext"},"imagePullSecrets":{"type":"array","description":"Are passed to the Deployment's imagePullSecrets.","items":{"$ref":"#/components/schemas/hq_K8sLocalObjectReference"}},"serviceAccount":{"type":"string","description":"Is the name of the ServiceAccount to use to run pods.","format":"K8sDns1123Subdomain"},"image":{"type":"string","description":"Overrides the default image deployed."},"resources":{"$ref":"#/components/schemas/hq_K8sResourceRequirements"}}},"hq_K8sMetadata":{"type":"object","description":"Bundles K8s labels and annotations.","properties":{"labels":{"$ref":"#/components/schemas/hq_K8sStringMap"},"annotations":{"$ref":"#/components/schemas/hq_K8sStringMap"}}},"hq_K8sStringMap":{"type":"object","description":"Maps string keys to string values. Used for K8s labels and annotations.","additionalProperties":{"type":"string"}},"hq_K8sSecurityContext":{"type":"object","description":"Allows customisation of a deployment's SecurityContext. Partially\nmirrors a K8s core v1 SecurityContext.\n","properties":{"runAsUser":{"type":"integer","format":"int64","description":"Sets the UID to run the entrypoint of the container process."},"runAsGroup":{"type":"integer","format":"int64","description":"Sets the GID to run the entrypoint of the container process."},"runAsNonRoot":{"type":"boolean","description":"Indicates that the container must run as a non-root user."}}},"hq_K8sLocalObjectReference":{"type":"object","description":"Mirrors a K8s core v1 LocalObjectReference.","properties":{"name":{"type":"string","description":"Name of the referent.","format":"K8sDns1123Subdomain"}},"required":["name"]},"hq_K8sResourceRequirements":{"type":"object","description":"Mirrors a K8s core v1 ResourceRequirements.","properties":{"requests":{"$ref":"#/components/schemas/hq_K8sResourceList"},"limits":{"$ref":"#/components/schemas/hq_K8sResourceList"}}},"hq_K8sResourceList":{"type":"object","description":"Mirrors a K8s core v1 ResourceList.","properties":{"cpu":{"type":"string","format":"K8sResourceQuantity"},"memory":{"type":"string","format":"K8sResourceQuantity"}}},"hq_K2KReplicatorSettings":{"type":"object","description":"Provides additional control knobs for the K2K replicator.","properties":{"schemaMapping":{"type":"boolean","description":"Enables schema replication."},"exactlyOnce":{"type":"boolean","description":"Enables exactly-once processing."},"headerReplication":{"type":"boolean","description":"Replicates the record headers."},"autoCreateTopics":{"type":"boolean","description":"Enables auto creation of topics."},"autoCreateControlTopics":{"type":"boolean","description":"Enables auto creation of control topics."},"keepRecordCreationTimestamp":{"type":"boolean","description":"Enables preserving record timestamps."},"errorHandling":{"$ref":"#/components/schemas/hq_K2KErrorHandlingSettings"},"tracingHeaders":{"$ref":"#/components/schemas/hq_K2KTracingHeadersSettings"},"coordination":{"$ref":"#/components/schemas/hq_K2KCoordinationSettings"},"bidirectional":{"$ref":"#/components/schemas/hq_K2KBidirectionalSettings"}}},"hq_K2KErrorHandlingSettings":{"type":"object","description":"Controls K2K error handling behavior.","properties":{"onCommitSyncTimeout":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"},"onControlMessageDeserializationError":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"}}},"hq_K2KErrorHandlingBehavior":{"type":"string","description":"Specifies error handling behavior.","enum":["fail","ignore"]},"hq_K2KTracingHeadersSettings":{"type":"object","description":"Controls which tracing headers are enabled.","properties":{"partition":{"type":"boolean","description":"Enables the partition tracing header."},"offset":{"type":"boolean","description":"Enables the offset tracing header."},"topic":{"type":"boolean","description":"Enables the topic tracing header."},"pipeline":{"type":"boolean","description":"Enables the pipeline tracing header."}}},"hq_K2KCoordinationSettings":{"type":"object","description":"Controls coordination behavior.","properties":{"commit":{"$ref":"#/components/schemas/hq_K2KCommitCoordinationSettings"},"assignment":{"$ref":"#/components/schemas/hq_K2KAssignmentCoordinationSettings"}}},"hq_K2KCommitCoordinationSettings":{"type":"object","description":"Controls commit coordination settings.","properties":{"topic":{"type":"string","description":"Topic for offset commits."},"syncTimeoutSeconds":{"type":"integer","description":"Time limit in seconds to wait for catchup when reading from the offset control topic.","minimum":1},"batchSize":{"type":"integer","description":"Number of records after which an offset is committed.","minimum":1},"batchTimeoutSeconds":{"type":"integer","description":"Time in seconds to wait before injecting a commit record.","minimum":1}}},"hq_K2KAssignmentCoordinationSettings":{"type":"object","description":"Controls assignment coordination settings.","properties":{"topic":{"type":"string","description":"Topic used for assignment coordination."},"graceWindowSeconds":{"type":"integer","description":"Time in seconds to wait before the application actively fences off other applications.","minimum":1},"fencingMaxParallelism":{"type":"integer","description":"Max parallelism when fencing slow/zombie producers.","minimum":1}}},"hq_K2KBidirectionalSettings":{"type":"object","description":"Controls bidirectional replication behavior.","properties":{"enabled":{"type":"boolean","description":"Enables bidirectional replication."},"mode":{"$ref":"#/components/schemas/hq_K2KBidirectionalMode"},"headerName":{"type":"string","description":"Header name for bidirectional replication detection."}}},"hq_K2KBidirectionalMode":{"type":"string","description":"Controls the bidirectional replication detection identifier. This\nprevents records that are already present in both clusters from being\nreplicated. \"cluster\" uses the source broker's ID; \"pipeline\" uses the\npipeline name set in the configuration.\n","enum":["cluster","pipeline"]},"hq_K2KTargetTopicMapping":{"description":"Controls how source environment topics are mapped to target environment topics.","oneOf":[{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingSourceTopicName"},{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingPrefixSuffix"},{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingRename"},{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingPatternRouting"}],"discriminator":{"propertyName":"type","mapping":{"sourceTopicName":"#/components/schemas/hq_K2KTargetTopicMappingSourceTopicName","prefixSuffix":"#/components/schemas/hq_K2KTargetTopicMappingPrefixSuffix","rename":"#/components/schemas/hq_K2KTargetTopicMappingRename","patternRouting":"#/components/schemas/hq_K2KTargetTopicMappingPatternRouting"}}},"hq_K2KTargetTopicMappingSourceTopicName":{"type":"object","description":"Preserves source topic names (1-to-1 mapping).","required":[]},"hq_K2KTargetTopicMappingPrefixSuffix":{"type":"object","description":"Modifies target topic names by adding a prefix and/or suffix.","anyOf":[{"required":["prefix"]},{"required":["suffix"]}],"properties":{"prefix":{"type":"string","description":"Prefix to prepend to the target topic name.","minLength":1,"format":"kafka-topic-chars"},"suffix":{"type":"string","description":"Suffix to append to the target topic name.","minLength":1,"format":"kafka-topic-chars"}}},"hq_K2KTargetTopicMappingRename":{"type":"object","description":"Renames topics using explicit source-to-target pairs. Use for simple renames that don't fit the prefixSuffix pattern.","properties":{"topics":{"type":"object","description":"A map of source topic names to target topic names.","additionalProperties":{"type":"string","format":"kafka-topic"}}},"required":["topics"]},"hq_K2KTargetTopicMappingPatternRouting":{"type":"object","description":"Routes topics to targets using ordered regex pattern matching rules. The first matching rule wins.","properties":{"rules":{"type":"array","description":"Ordered list of pattern-to-topic mapping rules.","minItems":1,"items":{"$ref":"#/components/schemas/hq_K2KPatternRoutingRule"}}},"required":["rules"]},"hq_K2KPatternRoutingRule":{"type":"object","description":"A single regex pattern-to-topic routing rule.","properties":{"pattern":{"type":"string","description":"Regex pattern to match source topic names.","minLength":1},"topic":{"type":"string","format":"kafka-topic","description":"Target topic name for matched source topics."}},"required":["pattern","topic"]},"hq_K2KConfigOverrides":{"type":"object","description":"Contains arbitrary data that gets merged into the replicator's config.","additionalProperties":{}},"hq_K2KAppStartFrom":{"type":"string","description":"Replication start position. Accepts \"earliest\", \"latest\", or RFC3339 timestamp (e.g., \"2025-01-14T10:00:00Z\"). Only used during app creation."},"hq_K2KAppStatus":{"type":"object","description":"Contains the most recently observed status of a K2KApp. Read-only for clients.","properties":{"updatedAt":{"type":"string","format":"date-time","description":"Contains the time instant this object was updated."},"state":{"$ref":"#/components/schemas/hq_K2KAppState"},"statusLastTransitionAt":{"type":"string","format":"date-time","description":"Contains the time instant the status was changed."},"statusMessage":{"type":"string","description":"Is a human-readable message indicating details about last the transition."},"observedGeneration":{"type":"integer","description":"Reflects the generation of the spec that this status corresponds to."},"deployment":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatus"},"kafka":{"$ref":"#/components/schemas/hq_K2KAppKafkaStatus"}},"required":["updatedAt","state","statusLastTransitionAt","statusMessage","observedGeneration","deployment","kafka"]},"hq_K2KAppState":{"type":"string","description":"Enumerates K2KApp state types.","enum":["deploying","starting","running","paused","error","deleting"]},"hq_KubernetesDeploymentStatus":{"type":"object","description":"Provides information about a Kubernetes deployment.","properties":{"inSync":{"type":"boolean"},"managedResources":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusResource"}},"pods":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusPod"}}},"required":["inSync","managedResources","pods"]},"hq_KubernetesDeploymentStatusResource":{"type":"object","description":"Provides information about a Kubernetes resource.","properties":{"name":{"type":"string","description":"Holds the resource name."},"namespace":{"type":"string","description":"Is set to the resource's namespace."},"kind":{"type":"string","description":"Is set to the resource's kind, e.g. Deployment, ConfigMap, etc."},"status":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Created, Updated, InSync, Error."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way."}},"required":["name","namespace","kind","status"]},"hq_KubernetesDeploymentStatusPod":{"type":"object","properties":{"name":{"type":"string","description":"Holds the Pod name."},"namespace":{"type":"string","description":"Is set to the Pod's namespace."},"state":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Terminating, CrashLoopBackOff, Running, etc."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way, if possible."},"lastTermination":{"$ref":"#/components/schemas/hq_PodTerminationDetails"}},"required":["name","namespace","state"]},"hq_PodTerminationDetails":{"type":"object","properties":{"message":{"type":"string","description":"Last termination message of the pod's container."},"time":{"type":"string","format":"date-time","description":"When the last termination happened for the pod's container."}}},"hq_K2KAppKafkaStatus":{"type":"object","properties":{"consumerGroup":{"type":"string","description":"Holds the name of the consumer group that this K2KApp uses."}},"required":["consumerGroup"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v0/apps/k2k/{name}":{"delete":{"description":"Deletes a single K2KApp by name.","operationId":"deleteK2KAppV0","parameters":[{"in":"path","name":"name","required":true,"schema":{"type":"string"}},{"in":"query","name":"force","required":false,"description":"Deletes the K2KApp instantly and skips waiting for deletion of any corresponding K8s resources.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Happy response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KApp"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_k2kapps"]}}}}
```

## PATCH /api/v0/apps/k2k/{name}

> Updates an existing K2KApp.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.2"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_K2KAppWithoutStatus":{"description":"Defines a K2KApp (Kafka-to-Kafka application).","allOf":[{"$ref":"#/components/schemas/hq_BaseManifest"},{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/hq_K2KAppSpec"}},"required":["spec"]}]},"hq_BaseManifest":{"type":"object","description":"Contains common fields shared by HQ manifests.","properties":{"apiVersion":{"type":"string","minLength":1},"kind":{"type":"string","minLength":1},"metadata":{"$ref":"#/components/schemas/hq_BaseManifestMetadata"}},"required":["apiVersion","kind","metadata"]},"hq_BaseManifestMetadata":{"type":"object","description":"Contains the metadata for a BaseManifest.","properties":{"name":{"type":"string","format":"hq-resource-name"},"displayName":{"type":"string","maxLength":150},"description":{"type":"string","description":"Has the description of the object.","maxLength":280},"id":{"type":"string","description":"Is a unique, read-only identifier.","readOnly":true},"lrn":{"type":"string","description":"Holds the LRN. Read-only.","readOnly":true},"creationTimestamp":{"type":"string","format":"date-time","description":"Is set to the time instant of creation. Read-only.","readOnly":true},"generation":{"type":"integer","description":"Is increased everytime the spec is updated. Read-only.","readOnly":true}},"required":["name"]},"hq_K2KAppSpec":{"type":"object","description":"Specifies a K2KApp (Kafka-to-Kafka application).","properties":{"sourceKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the source KafkaConnection LRN to read from."},"targetKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the target KafkaConnection LRN to write to."},"topics":{"type":"array","description":"Sets the topic(s) to replicate.","minItems":1,"items":{"type":"string","format":"kafka-topic","minLength":1}},"deploymentNamespaceLRN":{"type":"string","format":"kubernetes-namespace-lrn","description":"Defines the Kubernetes namespace to deploy to."},"replicas":{"type":"integer"},"kubernetes":{"$ref":"#/components/schemas/hq_K8sDeploymentOverrides"},"replicator":{"$ref":"#/components/schemas/hq_K2KReplicatorSettings"},"targetTopicMapping":{"$ref":"#/components/schemas/hq_K2KTargetTopicMapping"},"paused":{"type":"boolean","description":"Halts replication by scaling down to zero pods."},"configOverrides":{"$ref":"#/components/schemas/hq_K2KConfigOverrides"},"startFrom":{"$ref":"#/components/schemas/hq_K2KAppStartFrom"}},"required":["sourceKafkaLRN","targetKafkaLRN","deploymentNamespaceLRN","topics"]},"hq_K8sDeploymentOverrides":{"type":"object","properties":{"commonMetadata":{"$ref":"#/components/schemas/hq_K8sMetadata"},"securityContext":{"$ref":"#/components/schemas/hq_K8sSecurityContext"},"imagePullSecrets":{"type":"array","description":"Are passed to the Deployment's imagePullSecrets.","items":{"$ref":"#/components/schemas/hq_K8sLocalObjectReference"}},"serviceAccount":{"type":"string","description":"Is the name of the ServiceAccount to use to run pods.","format":"K8sDns1123Subdomain"},"image":{"type":"string","description":"Overrides the default image deployed."},"resources":{"$ref":"#/components/schemas/hq_K8sResourceRequirements"}}},"hq_K8sMetadata":{"type":"object","description":"Bundles K8s labels and annotations.","properties":{"labels":{"$ref":"#/components/schemas/hq_K8sStringMap"},"annotations":{"$ref":"#/components/schemas/hq_K8sStringMap"}}},"hq_K8sStringMap":{"type":"object","description":"Maps string keys to string values. Used for K8s labels and annotations.","additionalProperties":{"type":"string"}},"hq_K8sSecurityContext":{"type":"object","description":"Allows customisation of a deployment's SecurityContext. Partially\nmirrors a K8s core v1 SecurityContext.\n","properties":{"runAsUser":{"type":"integer","format":"int64","description":"Sets the UID to run the entrypoint of the container process."},"runAsGroup":{"type":"integer","format":"int64","description":"Sets the GID to run the entrypoint of the container process."},"runAsNonRoot":{"type":"boolean","description":"Indicates that the container must run as a non-root user."}}},"hq_K8sLocalObjectReference":{"type":"object","description":"Mirrors a K8s core v1 LocalObjectReference.","properties":{"name":{"type":"string","description":"Name of the referent.","format":"K8sDns1123Subdomain"}},"required":["name"]},"hq_K8sResourceRequirements":{"type":"object","description":"Mirrors a K8s core v1 ResourceRequirements.","properties":{"requests":{"$ref":"#/components/schemas/hq_K8sResourceList"},"limits":{"$ref":"#/components/schemas/hq_K8sResourceList"}}},"hq_K8sResourceList":{"type":"object","description":"Mirrors a K8s core v1 ResourceList.","properties":{"cpu":{"type":"string","format":"K8sResourceQuantity"},"memory":{"type":"string","format":"K8sResourceQuantity"}}},"hq_K2KReplicatorSettings":{"type":"object","description":"Provides additional control knobs for the K2K replicator.","properties":{"schemaMapping":{"type":"boolean","description":"Enables schema replication."},"exactlyOnce":{"type":"boolean","description":"Enables exactly-once processing."},"headerReplication":{"type":"boolean","description":"Replicates the record headers."},"autoCreateTopics":{"type":"boolean","description":"Enables auto creation of topics."},"autoCreateControlTopics":{"type":"boolean","description":"Enables auto creation of control topics."},"keepRecordCreationTimestamp":{"type":"boolean","description":"Enables preserving record timestamps."},"errorHandling":{"$ref":"#/components/schemas/hq_K2KErrorHandlingSettings"},"tracingHeaders":{"$ref":"#/components/schemas/hq_K2KTracingHeadersSettings"},"coordination":{"$ref":"#/components/schemas/hq_K2KCoordinationSettings"},"bidirectional":{"$ref":"#/components/schemas/hq_K2KBidirectionalSettings"}}},"hq_K2KErrorHandlingSettings":{"type":"object","description":"Controls K2K error handling behavior.","properties":{"onCommitSyncTimeout":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"},"onControlMessageDeserializationError":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"}}},"hq_K2KErrorHandlingBehavior":{"type":"string","description":"Specifies error handling behavior.","enum":["fail","ignore"]},"hq_K2KTracingHeadersSettings":{"type":"object","description":"Controls which tracing headers are enabled.","properties":{"partition":{"type":"boolean","description":"Enables the partition tracing header."},"offset":{"type":"boolean","description":"Enables the offset tracing header."},"topic":{"type":"boolean","description":"Enables the topic tracing header."},"pipeline":{"type":"boolean","description":"Enables the pipeline tracing header."}}},"hq_K2KCoordinationSettings":{"type":"object","description":"Controls coordination behavior.","properties":{"commit":{"$ref":"#/components/schemas/hq_K2KCommitCoordinationSettings"},"assignment":{"$ref":"#/components/schemas/hq_K2KAssignmentCoordinationSettings"}}},"hq_K2KCommitCoordinationSettings":{"type":"object","description":"Controls commit coordination settings.","properties":{"topic":{"type":"string","description":"Topic for offset commits."},"syncTimeoutSeconds":{"type":"integer","description":"Time limit in seconds to wait for catchup when reading from the offset control topic.","minimum":1},"batchSize":{"type":"integer","description":"Number of records after which an offset is committed.","minimum":1},"batchTimeoutSeconds":{"type":"integer","description":"Time in seconds to wait before injecting a commit record.","minimum":1}}},"hq_K2KAssignmentCoordinationSettings":{"type":"object","description":"Controls assignment coordination settings.","properties":{"topic":{"type":"string","description":"Topic used for assignment coordination."},"graceWindowSeconds":{"type":"integer","description":"Time in seconds to wait before the application actively fences off other applications.","minimum":1},"fencingMaxParallelism":{"type":"integer","description":"Max parallelism when fencing slow/zombie producers.","minimum":1}}},"hq_K2KBidirectionalSettings":{"type":"object","description":"Controls bidirectional replication behavior.","properties":{"enabled":{"type":"boolean","description":"Enables bidirectional replication."},"mode":{"$ref":"#/components/schemas/hq_K2KBidirectionalMode"},"headerName":{"type":"string","description":"Header name for bidirectional replication detection."}}},"hq_K2KBidirectionalMode":{"type":"string","description":"Controls the bidirectional replication detection identifier. This\nprevents records that are already present in both clusters from being\nreplicated. \"cluster\" uses the source broker's ID; \"pipeline\" uses the\npipeline name set in the configuration.\n","enum":["cluster","pipeline"]},"hq_K2KTargetTopicMapping":{"description":"Controls how source environment topics are mapped to target environment topics.","oneOf":[{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingSourceTopicName"},{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingPrefixSuffix"},{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingRename"},{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingPatternRouting"}],"discriminator":{"propertyName":"type","mapping":{"sourceTopicName":"#/components/schemas/hq_K2KTargetTopicMappingSourceTopicName","prefixSuffix":"#/components/schemas/hq_K2KTargetTopicMappingPrefixSuffix","rename":"#/components/schemas/hq_K2KTargetTopicMappingRename","patternRouting":"#/components/schemas/hq_K2KTargetTopicMappingPatternRouting"}}},"hq_K2KTargetTopicMappingSourceTopicName":{"type":"object","description":"Preserves source topic names (1-to-1 mapping).","required":[]},"hq_K2KTargetTopicMappingPrefixSuffix":{"type":"object","description":"Modifies target topic names by adding a prefix and/or suffix.","anyOf":[{"required":["prefix"]},{"required":["suffix"]}],"properties":{"prefix":{"type":"string","description":"Prefix to prepend to the target topic name.","minLength":1,"format":"kafka-topic-chars"},"suffix":{"type":"string","description":"Suffix to append to the target topic name.","minLength":1,"format":"kafka-topic-chars"}}},"hq_K2KTargetTopicMappingRename":{"type":"object","description":"Renames topics using explicit source-to-target pairs. Use for simple renames that don't fit the prefixSuffix pattern.","properties":{"topics":{"type":"object","description":"A map of source topic names to target topic names.","additionalProperties":{"type":"string","format":"kafka-topic"}}},"required":["topics"]},"hq_K2KTargetTopicMappingPatternRouting":{"type":"object","description":"Routes topics to targets using ordered regex pattern matching rules. The first matching rule wins.","properties":{"rules":{"type":"array","description":"Ordered list of pattern-to-topic mapping rules.","minItems":1,"items":{"$ref":"#/components/schemas/hq_K2KPatternRoutingRule"}}},"required":["rules"]},"hq_K2KPatternRoutingRule":{"type":"object","description":"A single regex pattern-to-topic routing rule.","properties":{"pattern":{"type":"string","description":"Regex pattern to match source topic names.","minLength":1},"topic":{"type":"string","format":"kafka-topic","description":"Target topic name for matched source topics."}},"required":["pattern","topic"]},"hq_K2KConfigOverrides":{"type":"object","description":"Contains arbitrary data that gets merged into the replicator's config.","additionalProperties":{}},"hq_K2KAppStartFrom":{"type":"string","description":"Replication start position. Accepts \"earliest\", \"latest\", or RFC3339 timestamp (e.g., \"2025-01-14T10:00:00Z\"). Only used during app creation."},"hq_K2KApp":{"description":"Defines a K2KApp (Kafka-to-Kafka application).","allOf":[{"$ref":"#/components/schemas/hq_BaseManifest"},{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/hq_K2KAppSpec"},"status":{"$ref":"#/components/schemas/hq_K2KAppStatus"}},"required":["spec"]}]},"hq_K2KAppStatus":{"type":"object","description":"Contains the most recently observed status of a K2KApp. Read-only for clients.","properties":{"updatedAt":{"type":"string","format":"date-time","description":"Contains the time instant this object was updated."},"state":{"$ref":"#/components/schemas/hq_K2KAppState"},"statusLastTransitionAt":{"type":"string","format":"date-time","description":"Contains the time instant the status was changed."},"statusMessage":{"type":"string","description":"Is a human-readable message indicating details about last the transition."},"observedGeneration":{"type":"integer","description":"Reflects the generation of the spec that this status corresponds to."},"deployment":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatus"},"kafka":{"$ref":"#/components/schemas/hq_K2KAppKafkaStatus"}},"required":["updatedAt","state","statusLastTransitionAt","statusMessage","observedGeneration","deployment","kafka"]},"hq_K2KAppState":{"type":"string","description":"Enumerates K2KApp state types.","enum":["deploying","starting","running","paused","error","deleting"]},"hq_KubernetesDeploymentStatus":{"type":"object","description":"Provides information about a Kubernetes deployment.","properties":{"inSync":{"type":"boolean"},"managedResources":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusResource"}},"pods":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusPod"}}},"required":["inSync","managedResources","pods"]},"hq_KubernetesDeploymentStatusResource":{"type":"object","description":"Provides information about a Kubernetes resource.","properties":{"name":{"type":"string","description":"Holds the resource name."},"namespace":{"type":"string","description":"Is set to the resource's namespace."},"kind":{"type":"string","description":"Is set to the resource's kind, e.g. Deployment, ConfigMap, etc."},"status":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Created, Updated, InSync, Error."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way."}},"required":["name","namespace","kind","status"]},"hq_KubernetesDeploymentStatusPod":{"type":"object","properties":{"name":{"type":"string","description":"Holds the Pod name."},"namespace":{"type":"string","description":"Is set to the Pod's namespace."},"state":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Terminating, CrashLoopBackOff, Running, etc."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way, if possible."},"lastTermination":{"$ref":"#/components/schemas/hq_PodTerminationDetails"}},"required":["name","namespace","state"]},"hq_PodTerminationDetails":{"type":"object","properties":{"message":{"type":"string","description":"Last termination message of the pod's container."},"time":{"type":"string","format":"date-time","description":"When the last termination happened for the pod's container."}}},"hq_K2KAppKafkaStatus":{"type":"object","properties":{"consumerGroup":{"type":"string","description":"Holds the name of the consumer group that this K2KApp uses."}},"required":["consumerGroup"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v0/apps/k2k/{name}":{"patch":{"description":"Updates an existing K2KApp.","operationId":"updateK2KAppV0","parameters":[{"in":"path","name":"name","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/yaml":{"schema":{"$ref":"#/components/schemas/hq_K2KAppWithoutStatus"}},"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KAppWithoutStatus"}}}},"responses":{"200":{"description":"Happy response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KApp"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_k2kapps"]}}}}
```

## GET /api/v0/apps/k2k

> Lists all K2KApps.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.2"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_K2KAppWithOptionalMetricsSummaryList":{"type":"object","description":"Contains K2KApps (Kafka-to-Kafka applications).","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KAppWithOptionalMetricsSummary"}}},"required":["items"]},"hq_K2KAppWithOptionalMetricsSummary":{"description":"Extends a K2KApp (Kafka-to-Kafka application) with an optional metrics summary.","allOf":[{"$ref":"#/components/schemas/hq_K2KApp"},{"type":"object","properties":{"metrics_summary":{"$ref":"#/components/schemas/hq_K2KAppMetricsSummary"}}}]},"hq_K2KApp":{"description":"Defines a K2KApp (Kafka-to-Kafka application).","allOf":[{"$ref":"#/components/schemas/hq_BaseManifest"},{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/hq_K2KAppSpec"},"status":{"$ref":"#/components/schemas/hq_K2KAppStatus"}},"required":["spec"]}]},"hq_BaseManifest":{"type":"object","description":"Contains common fields shared by HQ manifests.","properties":{"apiVersion":{"type":"string","minLength":1},"kind":{"type":"string","minLength":1},"metadata":{"$ref":"#/components/schemas/hq_BaseManifestMetadata"}},"required":["apiVersion","kind","metadata"]},"hq_BaseManifestMetadata":{"type":"object","description":"Contains the metadata for a BaseManifest.","properties":{"name":{"type":"string","format":"hq-resource-name"},"displayName":{"type":"string","maxLength":150},"description":{"type":"string","description":"Has the description of the object.","maxLength":280},"id":{"type":"string","description":"Is a unique, read-only identifier.","readOnly":true},"lrn":{"type":"string","description":"Holds the LRN. Read-only.","readOnly":true},"creationTimestamp":{"type":"string","format":"date-time","description":"Is set to the time instant of creation. Read-only.","readOnly":true},"generation":{"type":"integer","description":"Is increased everytime the spec is updated. Read-only.","readOnly":true}},"required":["name"]},"hq_K2KAppSpec":{"type":"object","description":"Specifies a K2KApp (Kafka-to-Kafka application).","properties":{"sourceKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the source KafkaConnection LRN to read from."},"targetKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the target KafkaConnection LRN to write to."},"topics":{"type":"array","description":"Sets the topic(s) to replicate.","minItems":1,"items":{"type":"string","format":"kafka-topic","minLength":1}},"deploymentNamespaceLRN":{"type":"string","format":"kubernetes-namespace-lrn","description":"Defines the Kubernetes namespace to deploy to."},"replicas":{"type":"integer"},"kubernetes":{"$ref":"#/components/schemas/hq_K8sDeploymentOverrides"},"replicator":{"$ref":"#/components/schemas/hq_K2KReplicatorSettings"},"targetTopicMapping":{"$ref":"#/components/schemas/hq_K2KTargetTopicMapping"},"paused":{"type":"boolean","description":"Halts replication by scaling down to zero pods."},"configOverrides":{"$ref":"#/components/schemas/hq_K2KConfigOverrides"},"startFrom":{"$ref":"#/components/schemas/hq_K2KAppStartFrom"}},"required":["sourceKafkaLRN","targetKafkaLRN","deploymentNamespaceLRN","topics"]},"hq_K8sDeploymentOverrides":{"type":"object","properties":{"commonMetadata":{"$ref":"#/components/schemas/hq_K8sMetadata"},"securityContext":{"$ref":"#/components/schemas/hq_K8sSecurityContext"},"imagePullSecrets":{"type":"array","description":"Are passed to the Deployment's imagePullSecrets.","items":{"$ref":"#/components/schemas/hq_K8sLocalObjectReference"}},"serviceAccount":{"type":"string","description":"Is the name of the ServiceAccount to use to run pods.","format":"K8sDns1123Subdomain"},"image":{"type":"string","description":"Overrides the default image deployed."},"resources":{"$ref":"#/components/schemas/hq_K8sResourceRequirements"}}},"hq_K8sMetadata":{"type":"object","description":"Bundles K8s labels and annotations.","properties":{"labels":{"$ref":"#/components/schemas/hq_K8sStringMap"},"annotations":{"$ref":"#/components/schemas/hq_K8sStringMap"}}},"hq_K8sStringMap":{"type":"object","description":"Maps string keys to string values. Used for K8s labels and annotations.","additionalProperties":{"type":"string"}},"hq_K8sSecurityContext":{"type":"object","description":"Allows customisation of a deployment's SecurityContext. Partially\nmirrors a K8s core v1 SecurityContext.\n","properties":{"runAsUser":{"type":"integer","format":"int64","description":"Sets the UID to run the entrypoint of the container process."},"runAsGroup":{"type":"integer","format":"int64","description":"Sets the GID to run the entrypoint of the container process."},"runAsNonRoot":{"type":"boolean","description":"Indicates that the container must run as a non-root user."}}},"hq_K8sLocalObjectReference":{"type":"object","description":"Mirrors a K8s core v1 LocalObjectReference.","properties":{"name":{"type":"string","description":"Name of the referent.","format":"K8sDns1123Subdomain"}},"required":["name"]},"hq_K8sResourceRequirements":{"type":"object","description":"Mirrors a K8s core v1 ResourceRequirements.","properties":{"requests":{"$ref":"#/components/schemas/hq_K8sResourceList"},"limits":{"$ref":"#/components/schemas/hq_K8sResourceList"}}},"hq_K8sResourceList":{"type":"object","description":"Mirrors a K8s core v1 ResourceList.","properties":{"cpu":{"type":"string","format":"K8sResourceQuantity"},"memory":{"type":"string","format":"K8sResourceQuantity"}}},"hq_K2KReplicatorSettings":{"type":"object","description":"Provides additional control knobs for the K2K replicator.","properties":{"schemaMapping":{"type":"boolean","description":"Enables schema replication."},"exactlyOnce":{"type":"boolean","description":"Enables exactly-once processing."},"headerReplication":{"type":"boolean","description":"Replicates the record headers."},"autoCreateTopics":{"type":"boolean","description":"Enables auto creation of topics."},"autoCreateControlTopics":{"type":"boolean","description":"Enables auto creation of control topics."},"keepRecordCreationTimestamp":{"type":"boolean","description":"Enables preserving record timestamps."},"errorHandling":{"$ref":"#/components/schemas/hq_K2KErrorHandlingSettings"},"tracingHeaders":{"$ref":"#/components/schemas/hq_K2KTracingHeadersSettings"},"coordination":{"$ref":"#/components/schemas/hq_K2KCoordinationSettings"},"bidirectional":{"$ref":"#/components/schemas/hq_K2KBidirectionalSettings"}}},"hq_K2KErrorHandlingSettings":{"type":"object","description":"Controls K2K error handling behavior.","properties":{"onCommitSyncTimeout":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"},"onControlMessageDeserializationError":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"}}},"hq_K2KErrorHandlingBehavior":{"type":"string","description":"Specifies error handling behavior.","enum":["fail","ignore"]},"hq_K2KTracingHeadersSettings":{"type":"object","description":"Controls which tracing headers are enabled.","properties":{"partition":{"type":"boolean","description":"Enables the partition tracing header."},"offset":{"type":"boolean","description":"Enables the offset tracing header."},"topic":{"type":"boolean","description":"Enables the topic tracing header."},"pipeline":{"type":"boolean","description":"Enables the pipeline tracing header."}}},"hq_K2KCoordinationSettings":{"type":"object","description":"Controls coordination behavior.","properties":{"commit":{"$ref":"#/components/schemas/hq_K2KCommitCoordinationSettings"},"assignment":{"$ref":"#/components/schemas/hq_K2KAssignmentCoordinationSettings"}}},"hq_K2KCommitCoordinationSettings":{"type":"object","description":"Controls commit coordination settings.","properties":{"topic":{"type":"string","description":"Topic for offset commits."},"syncTimeoutSeconds":{"type":"integer","description":"Time limit in seconds to wait for catchup when reading from the offset control topic.","minimum":1},"batchSize":{"type":"integer","description":"Number of records after which an offset is committed.","minimum":1},"batchTimeoutSeconds":{"type":"integer","description":"Time in seconds to wait before injecting a commit record.","minimum":1}}},"hq_K2KAssignmentCoordinationSettings":{"type":"object","description":"Controls assignment coordination settings.","properties":{"topic":{"type":"string","description":"Topic used for assignment coordination."},"graceWindowSeconds":{"type":"integer","description":"Time in seconds to wait before the application actively fences off other applications.","minimum":1},"fencingMaxParallelism":{"type":"integer","description":"Max parallelism when fencing slow/zombie producers.","minimum":1}}},"hq_K2KBidirectionalSettings":{"type":"object","description":"Controls bidirectional replication behavior.","properties":{"enabled":{"type":"boolean","description":"Enables bidirectional replication."},"mode":{"$ref":"#/components/schemas/hq_K2KBidirectionalMode"},"headerName":{"type":"string","description":"Header name for bidirectional replication detection."}}},"hq_K2KBidirectionalMode":{"type":"string","description":"Controls the bidirectional replication detection identifier. This\nprevents records that are already present in both clusters from being\nreplicated. \"cluster\" uses the source broker's ID; \"pipeline\" uses the\npipeline name set in the configuration.\n","enum":["cluster","pipeline"]},"hq_K2KTargetTopicMapping":{"description":"Controls how source environment topics are mapped to target environment topics.","oneOf":[{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingSourceTopicName"},{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingPrefixSuffix"},{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingRename"},{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingPatternRouting"}],"discriminator":{"propertyName":"type","mapping":{"sourceTopicName":"#/components/schemas/hq_K2KTargetTopicMappingSourceTopicName","prefixSuffix":"#/components/schemas/hq_K2KTargetTopicMappingPrefixSuffix","rename":"#/components/schemas/hq_K2KTargetTopicMappingRename","patternRouting":"#/components/schemas/hq_K2KTargetTopicMappingPatternRouting"}}},"hq_K2KTargetTopicMappingSourceTopicName":{"type":"object","description":"Preserves source topic names (1-to-1 mapping).","required":[]},"hq_K2KTargetTopicMappingPrefixSuffix":{"type":"object","description":"Modifies target topic names by adding a prefix and/or suffix.","anyOf":[{"required":["prefix"]},{"required":["suffix"]}],"properties":{"prefix":{"type":"string","description":"Prefix to prepend to the target topic name.","minLength":1,"format":"kafka-topic-chars"},"suffix":{"type":"string","description":"Suffix to append to the target topic name.","minLength":1,"format":"kafka-topic-chars"}}},"hq_K2KTargetTopicMappingRename":{"type":"object","description":"Renames topics using explicit source-to-target pairs. Use for simple renames that don't fit the prefixSuffix pattern.","properties":{"topics":{"type":"object","description":"A map of source topic names to target topic names.","additionalProperties":{"type":"string","format":"kafka-topic"}}},"required":["topics"]},"hq_K2KTargetTopicMappingPatternRouting":{"type":"object","description":"Routes topics to targets using ordered regex pattern matching rules. The first matching rule wins.","properties":{"rules":{"type":"array","description":"Ordered list of pattern-to-topic mapping rules.","minItems":1,"items":{"$ref":"#/components/schemas/hq_K2KPatternRoutingRule"}}},"required":["rules"]},"hq_K2KPatternRoutingRule":{"type":"object","description":"A single regex pattern-to-topic routing rule.","properties":{"pattern":{"type":"string","description":"Regex pattern to match source topic names.","minLength":1},"topic":{"type":"string","format":"kafka-topic","description":"Target topic name for matched source topics."}},"required":["pattern","topic"]},"hq_K2KConfigOverrides":{"type":"object","description":"Contains arbitrary data that gets merged into the replicator's config.","additionalProperties":{}},"hq_K2KAppStartFrom":{"type":"string","description":"Replication start position. Accepts \"earliest\", \"latest\", or RFC3339 timestamp (e.g., \"2025-01-14T10:00:00Z\"). Only used during app creation."},"hq_K2KAppStatus":{"type":"object","description":"Contains the most recently observed status of a K2KApp. Read-only for clients.","properties":{"updatedAt":{"type":"string","format":"date-time","description":"Contains the time instant this object was updated."},"state":{"$ref":"#/components/schemas/hq_K2KAppState"},"statusLastTransitionAt":{"type":"string","format":"date-time","description":"Contains the time instant the status was changed."},"statusMessage":{"type":"string","description":"Is a human-readable message indicating details about last the transition."},"observedGeneration":{"type":"integer","description":"Reflects the generation of the spec that this status corresponds to."},"deployment":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatus"},"kafka":{"$ref":"#/components/schemas/hq_K2KAppKafkaStatus"}},"required":["updatedAt","state","statusLastTransitionAt","statusMessage","observedGeneration","deployment","kafka"]},"hq_K2KAppState":{"type":"string","description":"Enumerates K2KApp state types.","enum":["deploying","starting","running","paused","error","deleting"]},"hq_KubernetesDeploymentStatus":{"type":"object","description":"Provides information about a Kubernetes deployment.","properties":{"inSync":{"type":"boolean"},"managedResources":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusResource"}},"pods":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusPod"}}},"required":["inSync","managedResources","pods"]},"hq_KubernetesDeploymentStatusResource":{"type":"object","description":"Provides information about a Kubernetes resource.","properties":{"name":{"type":"string","description":"Holds the resource name."},"namespace":{"type":"string","description":"Is set to the resource's namespace."},"kind":{"type":"string","description":"Is set to the resource's kind, e.g. Deployment, ConfigMap, etc."},"status":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Created, Updated, InSync, Error."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way."}},"required":["name","namespace","kind","status"]},"hq_KubernetesDeploymentStatusPod":{"type":"object","properties":{"name":{"type":"string","description":"Holds the Pod name."},"namespace":{"type":"string","description":"Is set to the Pod's namespace."},"state":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Terminating, CrashLoopBackOff, Running, etc."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way, if possible."},"lastTermination":{"$ref":"#/components/schemas/hq_PodTerminationDetails"}},"required":["name","namespace","state"]},"hq_PodTerminationDetails":{"type":"object","properties":{"message":{"type":"string","description":"Last termination message of the pod's container."},"time":{"type":"string","format":"date-time","description":"When the last termination happened for the pod's container."}}},"hq_K2KAppKafkaStatus":{"type":"object","properties":{"consumerGroup":{"type":"string","description":"Holds the name of the consumer group that this K2KApp uses."}},"required":["consumerGroup"]},"hq_K2KAppMetricsSummary":{"type":"object","description":"Tracks metrics for a K2KApp.","properties":{"topics_count":{"type":"integer","description":"Contains the number of topics."},"partitions_count":{"type":"integer","description":"Contains the number of partitions."},"total_bytes_per_second_read":{"type":"number","format":"double","description":"Total bytes per second read across all topics."},"total_bytes_per_second_written":{"type":"number","format":"double","description":"Total bytes per second written across all topics."},"total_records_per_second_read":{"type":"number","format":"double","description":"Total records per second read across all topics."},"total_records_per_second_written":{"type":"number","format":"double","description":"Total records per second written across all topics."},"state":{"$ref":"#/components/schemas/hq_K2KAppMetricsState"},"updated_at":{"format":"date-time","type":"string","description":"Contains the time instant this object as a whole was updated."},"error_message":{"type":"string","description":"Contains the error message if the state is \"error\"."}},"required":["topics_count","partitions_count","total_bytes_per_second_read","total_bytes_per_second_written","total_records_per_second_read","total_records_per_second_written","updated_at","state","error_message"]},"hq_K2KAppMetricsState":{"type":"string","description":"Enumerates K2KApp metrics states.","enum":["unknown","success","error"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v0/apps/k2k":{"get":{"description":"Lists all K2KApps.","operationId":"listK2KAppsV0","parameters":[{"in":"query","name":"expand_metrics_summary","required":false,"description":"Includes metrics summaries in the response, if available.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Happy response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KAppWithOptionalMetricsSummaryList"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_k2kapps"]}}}}
```

## POST /api/v0/apps/k2k

> Creates a new K2KApp.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.2"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_K2KAppWithoutStatus":{"description":"Defines a K2KApp (Kafka-to-Kafka application).","allOf":[{"$ref":"#/components/schemas/hq_BaseManifest"},{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/hq_K2KAppSpec"}},"required":["spec"]}]},"hq_BaseManifest":{"type":"object","description":"Contains common fields shared by HQ manifests.","properties":{"apiVersion":{"type":"string","minLength":1},"kind":{"type":"string","minLength":1},"metadata":{"$ref":"#/components/schemas/hq_BaseManifestMetadata"}},"required":["apiVersion","kind","metadata"]},"hq_BaseManifestMetadata":{"type":"object","description":"Contains the metadata for a BaseManifest.","properties":{"name":{"type":"string","format":"hq-resource-name"},"displayName":{"type":"string","maxLength":150},"description":{"type":"string","description":"Has the description of the object.","maxLength":280},"id":{"type":"string","description":"Is a unique, read-only identifier.","readOnly":true},"lrn":{"type":"string","description":"Holds the LRN. Read-only.","readOnly":true},"creationTimestamp":{"type":"string","format":"date-time","description":"Is set to the time instant of creation. Read-only.","readOnly":true},"generation":{"type":"integer","description":"Is increased everytime the spec is updated. Read-only.","readOnly":true}},"required":["name"]},"hq_K2KAppSpec":{"type":"object","description":"Specifies a K2KApp (Kafka-to-Kafka application).","properties":{"sourceKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the source KafkaConnection LRN to read from."},"targetKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the target KafkaConnection LRN to write to."},"topics":{"type":"array","description":"Sets the topic(s) to replicate.","minItems":1,"items":{"type":"string","format":"kafka-topic","minLength":1}},"deploymentNamespaceLRN":{"type":"string","format":"kubernetes-namespace-lrn","description":"Defines the Kubernetes namespace to deploy to."},"replicas":{"type":"integer"},"kubernetes":{"$ref":"#/components/schemas/hq_K8sDeploymentOverrides"},"replicator":{"$ref":"#/components/schemas/hq_K2KReplicatorSettings"},"targetTopicMapping":{"$ref":"#/components/schemas/hq_K2KTargetTopicMapping"},"paused":{"type":"boolean","description":"Halts replication by scaling down to zero pods."},"configOverrides":{"$ref":"#/components/schemas/hq_K2KConfigOverrides"},"startFrom":{"$ref":"#/components/schemas/hq_K2KAppStartFrom"}},"required":["sourceKafkaLRN","targetKafkaLRN","deploymentNamespaceLRN","topics"]},"hq_K8sDeploymentOverrides":{"type":"object","properties":{"commonMetadata":{"$ref":"#/components/schemas/hq_K8sMetadata"},"securityContext":{"$ref":"#/components/schemas/hq_K8sSecurityContext"},"imagePullSecrets":{"type":"array","description":"Are passed to the Deployment's imagePullSecrets.","items":{"$ref":"#/components/schemas/hq_K8sLocalObjectReference"}},"serviceAccount":{"type":"string","description":"Is the name of the ServiceAccount to use to run pods.","format":"K8sDns1123Subdomain"},"image":{"type":"string","description":"Overrides the default image deployed."},"resources":{"$ref":"#/components/schemas/hq_K8sResourceRequirements"}}},"hq_K8sMetadata":{"type":"object","description":"Bundles K8s labels and annotations.","properties":{"labels":{"$ref":"#/components/schemas/hq_K8sStringMap"},"annotations":{"$ref":"#/components/schemas/hq_K8sStringMap"}}},"hq_K8sStringMap":{"type":"object","description":"Maps string keys to string values. Used for K8s labels and annotations.","additionalProperties":{"type":"string"}},"hq_K8sSecurityContext":{"type":"object","description":"Allows customisation of a deployment's SecurityContext. Partially\nmirrors a K8s core v1 SecurityContext.\n","properties":{"runAsUser":{"type":"integer","format":"int64","description":"Sets the UID to run the entrypoint of the container process."},"runAsGroup":{"type":"integer","format":"int64","description":"Sets the GID to run the entrypoint of the container process."},"runAsNonRoot":{"type":"boolean","description":"Indicates that the container must run as a non-root user."}}},"hq_K8sLocalObjectReference":{"type":"object","description":"Mirrors a K8s core v1 LocalObjectReference.","properties":{"name":{"type":"string","description":"Name of the referent.","format":"K8sDns1123Subdomain"}},"required":["name"]},"hq_K8sResourceRequirements":{"type":"object","description":"Mirrors a K8s core v1 ResourceRequirements.","properties":{"requests":{"$ref":"#/components/schemas/hq_K8sResourceList"},"limits":{"$ref":"#/components/schemas/hq_K8sResourceList"}}},"hq_K8sResourceList":{"type":"object","description":"Mirrors a K8s core v1 ResourceList.","properties":{"cpu":{"type":"string","format":"K8sResourceQuantity"},"memory":{"type":"string","format":"K8sResourceQuantity"}}},"hq_K2KReplicatorSettings":{"type":"object","description":"Provides additional control knobs for the K2K replicator.","properties":{"schemaMapping":{"type":"boolean","description":"Enables schema replication."},"exactlyOnce":{"type":"boolean","description":"Enables exactly-once processing."},"headerReplication":{"type":"boolean","description":"Replicates the record headers."},"autoCreateTopics":{"type":"boolean","description":"Enables auto creation of topics."},"autoCreateControlTopics":{"type":"boolean","description":"Enables auto creation of control topics."},"keepRecordCreationTimestamp":{"type":"boolean","description":"Enables preserving record timestamps."},"errorHandling":{"$ref":"#/components/schemas/hq_K2KErrorHandlingSettings"},"tracingHeaders":{"$ref":"#/components/schemas/hq_K2KTracingHeadersSettings"},"coordination":{"$ref":"#/components/schemas/hq_K2KCoordinationSettings"},"bidirectional":{"$ref":"#/components/schemas/hq_K2KBidirectionalSettings"}}},"hq_K2KErrorHandlingSettings":{"type":"object","description":"Controls K2K error handling behavior.","properties":{"onCommitSyncTimeout":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"},"onControlMessageDeserializationError":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"}}},"hq_K2KErrorHandlingBehavior":{"type":"string","description":"Specifies error handling behavior.","enum":["fail","ignore"]},"hq_K2KTracingHeadersSettings":{"type":"object","description":"Controls which tracing headers are enabled.","properties":{"partition":{"type":"boolean","description":"Enables the partition tracing header."},"offset":{"type":"boolean","description":"Enables the offset tracing header."},"topic":{"type":"boolean","description":"Enables the topic tracing header."},"pipeline":{"type":"boolean","description":"Enables the pipeline tracing header."}}},"hq_K2KCoordinationSettings":{"type":"object","description":"Controls coordination behavior.","properties":{"commit":{"$ref":"#/components/schemas/hq_K2KCommitCoordinationSettings"},"assignment":{"$ref":"#/components/schemas/hq_K2KAssignmentCoordinationSettings"}}},"hq_K2KCommitCoordinationSettings":{"type":"object","description":"Controls commit coordination settings.","properties":{"topic":{"type":"string","description":"Topic for offset commits."},"syncTimeoutSeconds":{"type":"integer","description":"Time limit in seconds to wait for catchup when reading from the offset control topic.","minimum":1},"batchSize":{"type":"integer","description":"Number of records after which an offset is committed.","minimum":1},"batchTimeoutSeconds":{"type":"integer","description":"Time in seconds to wait before injecting a commit record.","minimum":1}}},"hq_K2KAssignmentCoordinationSettings":{"type":"object","description":"Controls assignment coordination settings.","properties":{"topic":{"type":"string","description":"Topic used for assignment coordination."},"graceWindowSeconds":{"type":"integer","description":"Time in seconds to wait before the application actively fences off other applications.","minimum":1},"fencingMaxParallelism":{"type":"integer","description":"Max parallelism when fencing slow/zombie producers.","minimum":1}}},"hq_K2KBidirectionalSettings":{"type":"object","description":"Controls bidirectional replication behavior.","properties":{"enabled":{"type":"boolean","description":"Enables bidirectional replication."},"mode":{"$ref":"#/components/schemas/hq_K2KBidirectionalMode"},"headerName":{"type":"string","description":"Header name for bidirectional replication detection."}}},"hq_K2KBidirectionalMode":{"type":"string","description":"Controls the bidirectional replication detection identifier. This\nprevents records that are already present in both clusters from being\nreplicated. \"cluster\" uses the source broker's ID; \"pipeline\" uses the\npipeline name set in the configuration.\n","enum":["cluster","pipeline"]},"hq_K2KTargetTopicMapping":{"description":"Controls how source environment topics are mapped to target environment topics.","oneOf":[{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingSourceTopicName"},{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingPrefixSuffix"},{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingRename"},{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingPatternRouting"}],"discriminator":{"propertyName":"type","mapping":{"sourceTopicName":"#/components/schemas/hq_K2KTargetTopicMappingSourceTopicName","prefixSuffix":"#/components/schemas/hq_K2KTargetTopicMappingPrefixSuffix","rename":"#/components/schemas/hq_K2KTargetTopicMappingRename","patternRouting":"#/components/schemas/hq_K2KTargetTopicMappingPatternRouting"}}},"hq_K2KTargetTopicMappingSourceTopicName":{"type":"object","description":"Preserves source topic names (1-to-1 mapping).","required":[]},"hq_K2KTargetTopicMappingPrefixSuffix":{"type":"object","description":"Modifies target topic names by adding a prefix and/or suffix.","anyOf":[{"required":["prefix"]},{"required":["suffix"]}],"properties":{"prefix":{"type":"string","description":"Prefix to prepend to the target topic name.","minLength":1,"format":"kafka-topic-chars"},"suffix":{"type":"string","description":"Suffix to append to the target topic name.","minLength":1,"format":"kafka-topic-chars"}}},"hq_K2KTargetTopicMappingRename":{"type":"object","description":"Renames topics using explicit source-to-target pairs. Use for simple renames that don't fit the prefixSuffix pattern.","properties":{"topics":{"type":"object","description":"A map of source topic names to target topic names.","additionalProperties":{"type":"string","format":"kafka-topic"}}},"required":["topics"]},"hq_K2KTargetTopicMappingPatternRouting":{"type":"object","description":"Routes topics to targets using ordered regex pattern matching rules. The first matching rule wins.","properties":{"rules":{"type":"array","description":"Ordered list of pattern-to-topic mapping rules.","minItems":1,"items":{"$ref":"#/components/schemas/hq_K2KPatternRoutingRule"}}},"required":["rules"]},"hq_K2KPatternRoutingRule":{"type":"object","description":"A single regex pattern-to-topic routing rule.","properties":{"pattern":{"type":"string","description":"Regex pattern to match source topic names.","minLength":1},"topic":{"type":"string","format":"kafka-topic","description":"Target topic name for matched source topics."}},"required":["pattern","topic"]},"hq_K2KConfigOverrides":{"type":"object","description":"Contains arbitrary data that gets merged into the replicator's config.","additionalProperties":{}},"hq_K2KAppStartFrom":{"type":"string","description":"Replication start position. Accepts \"earliest\", \"latest\", or RFC3339 timestamp (e.g., \"2025-01-14T10:00:00Z\"). Only used during app creation."},"hq_K2KApp":{"description":"Defines a K2KApp (Kafka-to-Kafka application).","allOf":[{"$ref":"#/components/schemas/hq_BaseManifest"},{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/hq_K2KAppSpec"},"status":{"$ref":"#/components/schemas/hq_K2KAppStatus"}},"required":["spec"]}]},"hq_K2KAppStatus":{"type":"object","description":"Contains the most recently observed status of a K2KApp. Read-only for clients.","properties":{"updatedAt":{"type":"string","format":"date-time","description":"Contains the time instant this object was updated."},"state":{"$ref":"#/components/schemas/hq_K2KAppState"},"statusLastTransitionAt":{"type":"string","format":"date-time","description":"Contains the time instant the status was changed."},"statusMessage":{"type":"string","description":"Is a human-readable message indicating details about last the transition."},"observedGeneration":{"type":"integer","description":"Reflects the generation of the spec that this status corresponds to."},"deployment":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatus"},"kafka":{"$ref":"#/components/schemas/hq_K2KAppKafkaStatus"}},"required":["updatedAt","state","statusLastTransitionAt","statusMessage","observedGeneration","deployment","kafka"]},"hq_K2KAppState":{"type":"string","description":"Enumerates K2KApp state types.","enum":["deploying","starting","running","paused","error","deleting"]},"hq_KubernetesDeploymentStatus":{"type":"object","description":"Provides information about a Kubernetes deployment.","properties":{"inSync":{"type":"boolean"},"managedResources":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusResource"}},"pods":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusPod"}}},"required":["inSync","managedResources","pods"]},"hq_KubernetesDeploymentStatusResource":{"type":"object","description":"Provides information about a Kubernetes resource.","properties":{"name":{"type":"string","description":"Holds the resource name."},"namespace":{"type":"string","description":"Is set to the resource's namespace."},"kind":{"type":"string","description":"Is set to the resource's kind, e.g. Deployment, ConfigMap, etc."},"status":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Created, Updated, InSync, Error."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way."}},"required":["name","namespace","kind","status"]},"hq_KubernetesDeploymentStatusPod":{"type":"object","properties":{"name":{"type":"string","description":"Holds the Pod name."},"namespace":{"type":"string","description":"Is set to the Pod's namespace."},"state":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Terminating, CrashLoopBackOff, Running, etc."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way, if possible."},"lastTermination":{"$ref":"#/components/schemas/hq_PodTerminationDetails"}},"required":["name","namespace","state"]},"hq_PodTerminationDetails":{"type":"object","properties":{"message":{"type":"string","description":"Last termination message of the pod's container."},"time":{"type":"string","format":"date-time","description":"When the last termination happened for the pod's container."}}},"hq_K2KAppKafkaStatus":{"type":"object","properties":{"consumerGroup":{"type":"string","description":"Holds the name of the consumer group that this K2KApp uses."}},"required":["consumerGroup"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v0/apps/k2k":{"post":{"description":"Creates a new K2KApp.","operationId":"createK2KAppV0","requestBody":{"required":true,"content":{"application/yaml":{"schema":{"$ref":"#/components/schemas/hq_K2KAppWithoutStatus"}},"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KAppWithoutStatus"}}}},"responses":{"201":{"description":"Happy response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KApp"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_k2kapps"]}}}}
```

## Get Consumer Group Offsets

> Retrieves the current committed offsets for all topics and partitions associated with a K2K application's consumer group. The application does not need to be running for this operation. Note: This reads from the K2K internal control topic, not from Kafka's standard \_\_consumer\_offsets topic, as K2K uses a custom offset storage mechanism.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.2"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_K2KConsumerGroupOffsetsResponse":{"type":"object","description":"Consumer group offset information for a K2K application.","properties":{"application_name":{"type":"string","description":"The name of the K2K application."},"consumer_group":{"type":"string","description":"The Kafka consumer group ID used by this application."},"topics":{"type":"array","description":"List of topics with their partition offsets (paginated).","items":{"$ref":"#/components/schemas/hq_K2KConsumerGroupTopicOffsets"}},"total_count":{"type":"integer","description":"Total number of topics across all pages."},"has_more":{"type":"boolean","description":"Whether more results exist beyond this page."},"next_cursor":{"type":"string","description":"Cursor for retrieving the next page of results.\nNull if this is the last page.\n","nullable":true}},"required":["application_name","consumer_group","topics","total_count","has_more"]},"hq_K2KConsumerGroupTopicOffsets":{"type":"object","description":"Offset information for a single topic.","properties":{"topic_name":{"type":"string","description":"The name of the Kafka topic."},"partitions":{"type":"array","description":"List of partition offsets for this topic.","items":{"$ref":"#/components/schemas/hq_K2KConsumerGroupPartitionOffset"}}},"required":["topic_name","partitions"]},"hq_K2KConsumerGroupPartitionOffset":{"type":"object","description":"Offset information for a single partition.","properties":{"partition":{"type":"integer","format":"int32","description":"The partition number.","minimum":0},"offset":{"type":"integer","format":"int64","description":"The committed offset for this partition."}},"required":["partition","offset"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v0/apps/k2k/{name}/position/offsets":{"get":{"tags":["hq_k2kapps"],"summary":"Get Consumer Group Offsets","description":"Retrieves the current committed offsets for all topics and partitions associated with a K2K application's consumer group. The application does not need to be running for this operation. Note: This reads from the K2K internal control topic, not from Kafka's standard __consumer_offsets topic, as K2K uses a custom offset storage mechanism.","operationId":"getK2KAppPositionOffsets","parameters":[{"in":"path","name":"name","description":"The unique name for the K2K application.","required":true,"schema":{"type":"string"}},{"in":"query","name":"limit","description":"Maximum number of topics to return per page.","required":false,"schema":{"type":"integer","minimum":1,"maximum":250,"default":50}},{"in":"query","name":"cursor","description":"Pagination cursor from previous response's next_cursor.","required":false,"schema":{"type":"string"}},{"in":"query","name":"query","description":"A search keyword to filter topics by name (case-insensitive partial match). Topics whose names contain the search string will be included in results. Filtering is applied before pagination, so total_count and pagination reflect the filtered result set.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Consumer group offsets retrieved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KConsumerGroupOffsetsResponse"}}}},"400":{"description":"Bad Request - invalid pagination parameters.\nPossible causes: limit exceeds maximum (250), limit less than 1,\nor invalid/expired cursor format.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}},"404":{"description":"K2K application not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}},"503":{"description":"Agent not connected or unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}}}}}}
```

## Update Consumer Group Offsets for multiple partitions

> Update the committed offsets for multiple topic partitions for a given K2K application. Precondition: The K2K application must be stopped before calling this endpoint. If the application is running, a 409 Conflict error is returned. This is an atomic, all-or-nothing operation using Kafka Transactions. This endpoint replaces the deprecated endpoint (PUT /v0/apps/k2k/{name}/offsets/{topicName}).

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.2"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_K2KUpdateOffsetsRequest":{"type":"object","description":"Request to set consumer group offsets. At least one offset must be provided via either 'positions' (preferred) or 'offsets' (deprecated).","properties":{"positions":{"type":"object","description":"Map of topic names to partition offsets (preferred format). Key: Topic name (e.g., \"source-events\"). Value: Array of partition-offset pairs.","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KPartitionOffset"}}},"offsets":{"type":"array","deprecated":true,"description":"DEPRECATED: Use positions field instead. Flat array of topic-partition-offset tuples.","items":{"$ref":"#/components/schemas/hq_K2KTopicPartitionOffset"}}}},"hq_K2KPartitionOffset":{"type":"object","description":"A partition-offset pair for the positions map format.","properties":{"partition":{"type":"integer","format":"int32","description":"The partition number.","minimum":0},"offset":{"type":"integer","format":"int64","description":"The offset value to set.","minimum":0}},"required":["partition","offset"]},"hq_K2KTopicPartitionOffset":{"type":"object","description":"A topic-partition-offset tuple specifying the position to update.","properties":{"topic":{"type":"string","description":"The name of the Kafka topic."},"topic_name":{"type":"string","description":"DEPRECATED: Use 'topic' instead. This field is kept for backward compatibility.\nThe name of the Kafka topic.\n","deprecated":true},"partition":{"type":"integer","format":"int32","description":"The partition number for the given topic.","minimum":0},"offset":{"type":"integer","format":"int64","description":"The offset value to set for the given topic-partition.","minimum":0}},"required":["partition","offset"]},"hq_K2KUpdateOffsetsResponse":{"type":"object","properties":{"application_name":{"type":"string"},"updated_partitions":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KTopicPartitionOffset"},"description":"List of partitions and their updated offsets."}},"required":["application_name","updated_partitions"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v0/apps/k2k/{name}/position/offsets":{"put":{"tags":["hq_k2kapps"],"summary":"Update Consumer Group Offsets for multiple partitions","description":"Update the committed offsets for multiple topic partitions for a given K2K application. Precondition: The K2K application must be stopped before calling this endpoint. If the application is running, a 409 Conflict error is returned. This is an atomic, all-or-nothing operation using Kafka Transactions. This endpoint replaces the deprecated endpoint (PUT /v0/apps/k2k/{name}/offsets/{topicName}).","operationId":"updateK2KAppOffsetsByPosition","parameters":[{"in":"path","name":"name","description":"The unique name for the K2K application.","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Map of topic names to partition offsets. Supports both the new positions map format (preferred) and the deprecated offsets array format.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KUpdateOffsetsRequest"}}}},"responses":{"200":{"description":"Offsets successfully updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KUpdateOffsetsResponse"}}}},"400":{"description":"Bad Request - invalid request format or exceeds limits.\nPossible causes: invalid request format, request exceeds maximum of 1000 topics, or missing agent capabilities.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}},"404":{"description":"K2K application not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}},"409":{"description":"Conflict - application must be stopped to modify offsets.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}},"503":{"description":"Agent not connected or unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}}}}}}
```

## Set Consumer Group Offsets by Timestamp

> Sets the committed offsets for specific topic partitions of a K2K application by resolving a single timestamp to offsets. Precondition: The K2K application must be stopped before calling this endpoint. If the application is running, a 409 Conflict error is returned. Two-Phase Operation: 1. HQ resolves the timestamp to offsets via the Agent (single gRPC call) 2. HQ publishes the resolved offsets to the K2K control topic. Design: A single timestamp applies to all specified partitions. This aligns the HTTP API with the gRPC contract, avoiding hidden complexity. For different timestamps, clients make separate API calls. Edge Cases (per Kafka offsetsForTimes semantics): Timestamp before earliest message returns the earliest offset; timestamp after latest message skips partition (no offset available); partition with no messages is skipped.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.2"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_K2KUpdateOffsetsByTimestampRequest":{"type":"object","description":"Request to set consumer group offsets by timestamp. At least one topic with partitions must be provided. A single timestamp applies to all specified partitions.","properties":{"timestamp":{"type":"string","format":"date-time","description":"The target timestamp (RFC3339 format). All specified partitions will be set to the first message at or after this timestamp."},"partitions":{"type":"object","description":"Map of topic names to partition numbers. Key: Topic name (e.g., \"source-events\"). Value: Array of partition numbers to reset.","minProperties":1,"additionalProperties":{"type":"array","items":{"type":"integer","format":"int32","minimum":0}}}},"required":["timestamp","partitions"]},"hq_K2KUpdateOffsetsByTimestampResponse":{"type":"object","description":"Response after setting offsets by timestamp.","properties":{"application_name":{"type":"string","description":"The name of the K2K application."},"timestamp":{"type":"string","format":"date-time","description":"The timestamp that was used for resolution."},"updated_partitions":{"type":"array","description":"List of partitions that were updated with resolved offsets.","items":{"$ref":"#/components/schemas/hq_K2KTopicPartitionOffset"}},"skipped_partitions":{"type":"array","description":"List of partitions that were skipped because the timestamp\nwas after the latest message (no offset available).\n","items":{"$ref":"#/components/schemas/hq_K2KSkippedPartition"}}},"required":["application_name","timestamp","updated_partitions"]},"hq_K2KTopicPartitionOffset":{"type":"object","description":"A topic-partition-offset tuple specifying the position to update.","properties":{"topic":{"type":"string","description":"The name of the Kafka topic."},"topic_name":{"type":"string","description":"DEPRECATED: Use 'topic' instead. This field is kept for backward compatibility.\nThe name of the Kafka topic.\n","deprecated":true},"partition":{"type":"integer","format":"int32","description":"The partition number for the given topic.","minimum":0},"offset":{"type":"integer","format":"int64","description":"The offset value to set for the given topic-partition.","minimum":0}},"required":["partition","offset"]},"hq_K2KSkippedPartition":{"type":"object","description":"A partition that was skipped during timestamp resolution.","properties":{"topic":{"type":"string","description":"The topic name."},"partition":{"type":"integer","format":"int32","description":"The partition number."},"reason":{"$ref":"#/components/schemas/hq_K2KSkippedPartitionReason"}},"required":["topic","partition","reason"]},"hq_K2KSkippedPartitionReason":{"type":"string","description":"Why a partition was skipped during timestamp resolution.\n- no_offset_for_timestamp: The timestamp could not be resolved to an offset. This occurs when the timestamp is after the latest message or the partition is empty.\n- invalid_offset_from_agent: The agent returned an invalid (negative) offset, typically a Kafka sentinel value like -1.\n","enum":["no_offset_for_timestamp","invalid_offset_from_agent"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v0/apps/k2k/{name}/position/timestamp":{"put":{"tags":["hq_k2kapps"],"summary":"Set Consumer Group Offsets by Timestamp","description":"Sets the committed offsets for specific topic partitions of a K2K application by resolving a single timestamp to offsets. Precondition: The K2K application must be stopped before calling this endpoint. If the application is running, a 409 Conflict error is returned. Two-Phase Operation: 1. HQ resolves the timestamp to offsets via the Agent (single gRPC call) 2. HQ publishes the resolved offsets to the K2K control topic. Design: A single timestamp applies to all specified partitions. This aligns the HTTP API with the gRPC contract, avoiding hidden complexity. For different timestamps, clients make separate API calls. Edge Cases (per Kafka offsetsForTimes semantics): Timestamp before earliest message returns the earliest offset; timestamp after latest message skips partition (no offset available); partition with no messages is skipped.","operationId":"updateK2KAppOffsetsByTimestamp","parameters":[{"in":"path","name":"name","description":"The unique name for the K2K application.","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Single timestamp with map of topic names to partition numbers.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KUpdateOffsetsByTimestampRequest"}}}},"responses":{"200":{"description":"Offsets successfully updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KUpdateOffsetsByTimestampResponse"}}}},"400":{"description":"Bad Request - request exceeds limits. Maximum of 1000 topics per request allowed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}},"404":{"description":"K2K application not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}},"409":{"description":"Conflict - application must be stopped to modify offsets.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}},"503":{"description":"Agent not connected or unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}}}}}}
```

## GET /api/v1/apps/k2k/live/sse

> Provides Server-Sent Events (SSE) for K2KApp updates. TODO.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.2"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v1/apps/k2k/live/sse":{"get":{"description":"Provides Server-Sent Events (SSE) for K2KApp updates. TODO.","operationId":"observeK2KAppUpdates","responses":{"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_k2kapps"]}}}}
```

## GET /api/v1/k2k/migration-template

> Renders a K2K app template for migration with the given consumer group and connections.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.2"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_K2KAppWithoutStatus":{"description":"Defines a K2KApp (Kafka-to-Kafka application).","allOf":[{"$ref":"#/components/schemas/hq_BaseManifest"},{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/hq_K2KAppSpec"}},"required":["spec"]}]},"hq_BaseManifest":{"type":"object","description":"Contains common fields shared by HQ manifests.","properties":{"apiVersion":{"type":"string","minLength":1},"kind":{"type":"string","minLength":1},"metadata":{"$ref":"#/components/schemas/hq_BaseManifestMetadata"}},"required":["apiVersion","kind","metadata"]},"hq_BaseManifestMetadata":{"type":"object","description":"Contains the metadata for a BaseManifest.","properties":{"name":{"type":"string","format":"hq-resource-name"},"displayName":{"type":"string","maxLength":150},"description":{"type":"string","description":"Has the description of the object.","maxLength":280},"id":{"type":"string","description":"Is a unique, read-only identifier.","readOnly":true},"lrn":{"type":"string","description":"Holds the LRN. Read-only.","readOnly":true},"creationTimestamp":{"type":"string","format":"date-time","description":"Is set to the time instant of creation. Read-only.","readOnly":true},"generation":{"type":"integer","description":"Is increased everytime the spec is updated. Read-only.","readOnly":true}},"required":["name"]},"hq_K2KAppSpec":{"type":"object","description":"Specifies a K2KApp (Kafka-to-Kafka application).","properties":{"sourceKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the source KafkaConnection LRN to read from."},"targetKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the target KafkaConnection LRN to write to."},"topics":{"type":"array","description":"Sets the topic(s) to replicate.","minItems":1,"items":{"type":"string","format":"kafka-topic","minLength":1}},"deploymentNamespaceLRN":{"type":"string","format":"kubernetes-namespace-lrn","description":"Defines the Kubernetes namespace to deploy to."},"replicas":{"type":"integer"},"kubernetes":{"$ref":"#/components/schemas/hq_K8sDeploymentOverrides"},"replicator":{"$ref":"#/components/schemas/hq_K2KReplicatorSettings"},"targetTopicMapping":{"$ref":"#/components/schemas/hq_K2KTargetTopicMapping"},"paused":{"type":"boolean","description":"Halts replication by scaling down to zero pods."},"configOverrides":{"$ref":"#/components/schemas/hq_K2KConfigOverrides"},"startFrom":{"$ref":"#/components/schemas/hq_K2KAppStartFrom"}},"required":["sourceKafkaLRN","targetKafkaLRN","deploymentNamespaceLRN","topics"]},"hq_K8sDeploymentOverrides":{"type":"object","properties":{"commonMetadata":{"$ref":"#/components/schemas/hq_K8sMetadata"},"securityContext":{"$ref":"#/components/schemas/hq_K8sSecurityContext"},"imagePullSecrets":{"type":"array","description":"Are passed to the Deployment's imagePullSecrets.","items":{"$ref":"#/components/schemas/hq_K8sLocalObjectReference"}},"serviceAccount":{"type":"string","description":"Is the name of the ServiceAccount to use to run pods.","format":"K8sDns1123Subdomain"},"image":{"type":"string","description":"Overrides the default image deployed."},"resources":{"$ref":"#/components/schemas/hq_K8sResourceRequirements"}}},"hq_K8sMetadata":{"type":"object","description":"Bundles K8s labels and annotations.","properties":{"labels":{"$ref":"#/components/schemas/hq_K8sStringMap"},"annotations":{"$ref":"#/components/schemas/hq_K8sStringMap"}}},"hq_K8sStringMap":{"type":"object","description":"Maps string keys to string values. Used for K8s labels and annotations.","additionalProperties":{"type":"string"}},"hq_K8sSecurityContext":{"type":"object","description":"Allows customisation of a deployment's SecurityContext. Partially\nmirrors a K8s core v1 SecurityContext.\n","properties":{"runAsUser":{"type":"integer","format":"int64","description":"Sets the UID to run the entrypoint of the container process."},"runAsGroup":{"type":"integer","format":"int64","description":"Sets the GID to run the entrypoint of the container process."},"runAsNonRoot":{"type":"boolean","description":"Indicates that the container must run as a non-root user."}}},"hq_K8sLocalObjectReference":{"type":"object","description":"Mirrors a K8s core v1 LocalObjectReference.","properties":{"name":{"type":"string","description":"Name of the referent.","format":"K8sDns1123Subdomain"}},"required":["name"]},"hq_K8sResourceRequirements":{"type":"object","description":"Mirrors a K8s core v1 ResourceRequirements.","properties":{"requests":{"$ref":"#/components/schemas/hq_K8sResourceList"},"limits":{"$ref":"#/components/schemas/hq_K8sResourceList"}}},"hq_K8sResourceList":{"type":"object","description":"Mirrors a K8s core v1 ResourceList.","properties":{"cpu":{"type":"string","format":"K8sResourceQuantity"},"memory":{"type":"string","format":"K8sResourceQuantity"}}},"hq_K2KReplicatorSettings":{"type":"object","description":"Provides additional control knobs for the K2K replicator.","properties":{"schemaMapping":{"type":"boolean","description":"Enables schema replication."},"exactlyOnce":{"type":"boolean","description":"Enables exactly-once processing."},"headerReplication":{"type":"boolean","description":"Replicates the record headers."},"autoCreateTopics":{"type":"boolean","description":"Enables auto creation of topics."},"autoCreateControlTopics":{"type":"boolean","description":"Enables auto creation of control topics."},"keepRecordCreationTimestamp":{"type":"boolean","description":"Enables preserving record timestamps."},"errorHandling":{"$ref":"#/components/schemas/hq_K2KErrorHandlingSettings"},"tracingHeaders":{"$ref":"#/components/schemas/hq_K2KTracingHeadersSettings"},"coordination":{"$ref":"#/components/schemas/hq_K2KCoordinationSettings"},"bidirectional":{"$ref":"#/components/schemas/hq_K2KBidirectionalSettings"}}},"hq_K2KErrorHandlingSettings":{"type":"object","description":"Controls K2K error handling behavior.","properties":{"onCommitSyncTimeout":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"},"onControlMessageDeserializationError":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"}}},"hq_K2KErrorHandlingBehavior":{"type":"string","description":"Specifies error handling behavior.","enum":["fail","ignore"]},"hq_K2KTracingHeadersSettings":{"type":"object","description":"Controls which tracing headers are enabled.","properties":{"partition":{"type":"boolean","description":"Enables the partition tracing header."},"offset":{"type":"boolean","description":"Enables the offset tracing header."},"topic":{"type":"boolean","description":"Enables the topic tracing header."},"pipeline":{"type":"boolean","description":"Enables the pipeline tracing header."}}},"hq_K2KCoordinationSettings":{"type":"object","description":"Controls coordination behavior.","properties":{"commit":{"$ref":"#/components/schemas/hq_K2KCommitCoordinationSettings"},"assignment":{"$ref":"#/components/schemas/hq_K2KAssignmentCoordinationSettings"}}},"hq_K2KCommitCoordinationSettings":{"type":"object","description":"Controls commit coordination settings.","properties":{"topic":{"type":"string","description":"Topic for offset commits."},"syncTimeoutSeconds":{"type":"integer","description":"Time limit in seconds to wait for catchup when reading from the offset control topic.","minimum":1},"batchSize":{"type":"integer","description":"Number of records after which an offset is committed.","minimum":1},"batchTimeoutSeconds":{"type":"integer","description":"Time in seconds to wait before injecting a commit record.","minimum":1}}},"hq_K2KAssignmentCoordinationSettings":{"type":"object","description":"Controls assignment coordination settings.","properties":{"topic":{"type":"string","description":"Topic used for assignment coordination."},"graceWindowSeconds":{"type":"integer","description":"Time in seconds to wait before the application actively fences off other applications.","minimum":1},"fencingMaxParallelism":{"type":"integer","description":"Max parallelism when fencing slow/zombie producers.","minimum":1}}},"hq_K2KBidirectionalSettings":{"type":"object","description":"Controls bidirectional replication behavior.","properties":{"enabled":{"type":"boolean","description":"Enables bidirectional replication."},"mode":{"$ref":"#/components/schemas/hq_K2KBidirectionalMode"},"headerName":{"type":"string","description":"Header name for bidirectional replication detection."}}},"hq_K2KBidirectionalMode":{"type":"string","description":"Controls the bidirectional replication detection identifier. This\nprevents records that are already present in both clusters from being\nreplicated. \"cluster\" uses the source broker's ID; \"pipeline\" uses the\npipeline name set in the configuration.\n","enum":["cluster","pipeline"]},"hq_K2KTargetTopicMapping":{"description":"Controls how source environment topics are mapped to target environment topics.","oneOf":[{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingSourceTopicName"},{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingPrefixSuffix"},{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingRename"},{"$ref":"#/components/schemas/hq_K2KTargetTopicMappingPatternRouting"}],"discriminator":{"propertyName":"type","mapping":{"sourceTopicName":"#/components/schemas/hq_K2KTargetTopicMappingSourceTopicName","prefixSuffix":"#/components/schemas/hq_K2KTargetTopicMappingPrefixSuffix","rename":"#/components/schemas/hq_K2KTargetTopicMappingRename","patternRouting":"#/components/schemas/hq_K2KTargetTopicMappingPatternRouting"}}},"hq_K2KTargetTopicMappingSourceTopicName":{"type":"object","description":"Preserves source topic names (1-to-1 mapping).","required":[]},"hq_K2KTargetTopicMappingPrefixSuffix":{"type":"object","description":"Modifies target topic names by adding a prefix and/or suffix.","anyOf":[{"required":["prefix"]},{"required":["suffix"]}],"properties":{"prefix":{"type":"string","description":"Prefix to prepend to the target topic name.","minLength":1,"format":"kafka-topic-chars"},"suffix":{"type":"string","description":"Suffix to append to the target topic name.","minLength":1,"format":"kafka-topic-chars"}}},"hq_K2KTargetTopicMappingRename":{"type":"object","description":"Renames topics using explicit source-to-target pairs. Use for simple renames that don't fit the prefixSuffix pattern.","properties":{"topics":{"type":"object","description":"A map of source topic names to target topic names.","additionalProperties":{"type":"string","format":"kafka-topic"}}},"required":["topics"]},"hq_K2KTargetTopicMappingPatternRouting":{"type":"object","description":"Routes topics to targets using ordered regex pattern matching rules. The first matching rule wins.","properties":{"rules":{"type":"array","description":"Ordered list of pattern-to-topic mapping rules.","minItems":1,"items":{"$ref":"#/components/schemas/hq_K2KPatternRoutingRule"}}},"required":["rules"]},"hq_K2KPatternRoutingRule":{"type":"object","description":"A single regex pattern-to-topic routing rule.","properties":{"pattern":{"type":"string","description":"Regex pattern to match source topic names.","minLength":1},"topic":{"type":"string","format":"kafka-topic","description":"Target topic name for matched source topics."}},"required":["pattern","topic"]},"hq_K2KConfigOverrides":{"type":"object","description":"Contains arbitrary data that gets merged into the replicator's config.","additionalProperties":{}},"hq_K2KAppStartFrom":{"type":"string","description":"Replication start position. Accepts \"earliest\", \"latest\", or RFC3339 timestamp (e.g., \"2025-01-14T10:00:00Z\"). Only used during app creation."},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v1/k2k/migration-template":{"get":{"description":"Renders a K2K app template for migration with the given consumer group and connections.","operationId":"renderK2KMigrationTemplate","parameters":[{"in":"query","name":"consumer_group_lrn","description":"The consumer group LRN to include in the template.","required":true,"schema":{"type":"string"}},{"in":"query","name":"source_connection_lrn","description":"The source KafkaConnection LRN.","required":true,"schema":{"type":"string"}},{"in":"query","name":"target_connection_lrn","description":"The target KafkaConnection LRN.","required":true,"schema":{"type":"string"}},{"in":"query","name":"deployment_namespace_lrn","description":"The deployment Kubernetes namespace LRN.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully rendered the migration template.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KAppWithoutStatus"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_k2kapps"]}}}}
```

## GET /api/v1/k2k/migrations

> Lists all K2K migrations.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.2"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_K2KMigrationList":{"type":"object","description":"Contains a list of K2K migrations.","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KMigration"}}},"required":["items"]},"hq_K2KMigration":{"type":"object","description":"Represents a K2K consumer group offset migration.","properties":{"name":{"type":"string","description":"The unique name of the migration."},"display_name":{"type":"string"},"lrn":{"type":"string","description":"Contains the resource identifier for use in access control policies."},"id":{"type":"string"},"created_at":{"type":"string","format":"date-time","description":"The timestamp when the migration was created."},"k2k_app":{"type":"string","description":"The name of the K2K app this migration is associated with."},"consumer_group_id":{"type":"string","description":"The ID of the consumer group being migrated."},"status":{"$ref":"#/components/schemas/hq_K2KMigrationStatus"},"status_message":{"type":"string","description":"A human-readable message about the current status."},"allowed_next_states":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KMigrationAction"},"description":"Lists user-triggerable actions available from the current state."},"events":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KMigrationEvent"},"description":"Lists events that have occurred during the migration."}},"required":["name","display_name","lrn","id","created_at","k2k_app","consumer_group_id","status","status_message","allowed_next_states","events"]},"hq_K2KMigrationStatus":{"type":"string","description":"Enumerates K2K migration status types.","enum":["check_migration_readiness","migration_readiness_confirmed","migrate_offsets","offsets_migrated","migration_done","check_rollback_readiness","rollback_readiness_confirmed","rollback_offsets","offsets_rolled_back","rollback_done","error"]},"hq_K2KMigrationAction":{"type":"string","description":"User-triggerable migration actions.","enum":["check_migration_readiness","migrate_offsets","migration_done","check_rollback_readiness","rollback_offsets","rollback_done"]},"hq_K2KMigrationEvent":{"type":"object","description":"Represents an event that occurred during a K2K migration.","properties":{"time":{"type":"string","format":"date-time","description":"The timestamp when the event occurred."},"message":{"type":"string","description":"A human-readable description of the event."},"offsets":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KTopicPartitionOffset"},"description":"Optional list of topic-partition-offsets associated with this event."}},"required":["time","message"]},"hq_K2KTopicPartitionOffset":{"type":"object","description":"A topic-partition-offset tuple specifying the position to update.","properties":{"topic":{"type":"string","description":"The name of the Kafka topic."},"topic_name":{"type":"string","description":"DEPRECATED: Use 'topic' instead. This field is kept for backward compatibility.\nThe name of the Kafka topic.\n","deprecated":true},"partition":{"type":"integer","format":"int32","description":"The partition number for the given topic.","minimum":0},"offset":{"type":"integer","format":"int64","description":"The offset value to set for the given topic-partition.","minimum":0}},"required":["partition","offset"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v1/k2k/migrations":{"get":{"description":"Lists all K2K migrations.","operationId":"listK2KMigrations","responses":{"200":{"description":"Successfully retrieved the list of migrations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KMigrationList"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_k2kapps"]}}}}
```

## POST /api/v1/k2k/migrations

> Creates a new K2K migration.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.2"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_CreateK2KMigrationRequest":{"type":"object","description":"Request body for creating a new K2K migration.","properties":{"name":{"type":"string","description":"The unique name for the migration.","minLength":1,"maxLength":63,"format":"hq-resource-name"},"display_name":{"type":"string","maxLength":150,"description":"Sets the display name of the new K2KMigration. If not provided,\nthe value of \"name\" will be used.\n"},"k2k_app":{"type":"string","description":"The K2K app migrating the data the consumer group processes.","minLength":1,"format":"hq-resource-name"},"consumer_group_id":{"type":"string","description":"The ID of the consumer group whose offsets should be migrated.","minLength":1}},"required":["name","k2k_app","consumer_group_id"]},"hq_K2KMigration":{"type":"object","description":"Represents a K2K consumer group offset migration.","properties":{"name":{"type":"string","description":"The unique name of the migration."},"display_name":{"type":"string"},"lrn":{"type":"string","description":"Contains the resource identifier for use in access control policies."},"id":{"type":"string"},"created_at":{"type":"string","format":"date-time","description":"The timestamp when the migration was created."},"k2k_app":{"type":"string","description":"The name of the K2K app this migration is associated with."},"consumer_group_id":{"type":"string","description":"The ID of the consumer group being migrated."},"status":{"$ref":"#/components/schemas/hq_K2KMigrationStatus"},"status_message":{"type":"string","description":"A human-readable message about the current status."},"allowed_next_states":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KMigrationAction"},"description":"Lists user-triggerable actions available from the current state."},"events":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KMigrationEvent"},"description":"Lists events that have occurred during the migration."}},"required":["name","display_name","lrn","id","created_at","k2k_app","consumer_group_id","status","status_message","allowed_next_states","events"]},"hq_K2KMigrationStatus":{"type":"string","description":"Enumerates K2K migration status types.","enum":["check_migration_readiness","migration_readiness_confirmed","migrate_offsets","offsets_migrated","migration_done","check_rollback_readiness","rollback_readiness_confirmed","rollback_offsets","offsets_rolled_back","rollback_done","error"]},"hq_K2KMigrationAction":{"type":"string","description":"User-triggerable migration actions.","enum":["check_migration_readiness","migrate_offsets","migration_done","check_rollback_readiness","rollback_offsets","rollback_done"]},"hq_K2KMigrationEvent":{"type":"object","description":"Represents an event that occurred during a K2K migration.","properties":{"time":{"type":"string","format":"date-time","description":"The timestamp when the event occurred."},"message":{"type":"string","description":"A human-readable description of the event."},"offsets":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KTopicPartitionOffset"},"description":"Optional list of topic-partition-offsets associated with this event."}},"required":["time","message"]},"hq_K2KTopicPartitionOffset":{"type":"object","description":"A topic-partition-offset tuple specifying the position to update.","properties":{"topic":{"type":"string","description":"The name of the Kafka topic."},"topic_name":{"type":"string","description":"DEPRECATED: Use 'topic' instead. This field is kept for backward compatibility.\nThe name of the Kafka topic.\n","deprecated":true},"partition":{"type":"integer","format":"int32","description":"The partition number for the given topic.","minimum":0},"offset":{"type":"integer","format":"int64","description":"The offset value to set for the given topic-partition.","minimum":0}},"required":["partition","offset"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v1/k2k/migrations":{"post":{"description":"Creates a new K2K migration.","operationId":"createK2KMigration","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_CreateK2KMigrationRequest"}}}},"responses":{"201":{"description":"Successfully created the migration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KMigration"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_k2kapps"]}}}}
```

## GET /api/v1/k2k/migrations/{name}

> Gets a K2K migration by name.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.2"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_K2KMigration":{"type":"object","description":"Represents a K2K consumer group offset migration.","properties":{"name":{"type":"string","description":"The unique name of the migration."},"display_name":{"type":"string"},"lrn":{"type":"string","description":"Contains the resource identifier for use in access control policies."},"id":{"type":"string"},"created_at":{"type":"string","format":"date-time","description":"The timestamp when the migration was created."},"k2k_app":{"type":"string","description":"The name of the K2K app this migration is associated with."},"consumer_group_id":{"type":"string","description":"The ID of the consumer group being migrated."},"status":{"$ref":"#/components/schemas/hq_K2KMigrationStatus"},"status_message":{"type":"string","description":"A human-readable message about the current status."},"allowed_next_states":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KMigrationAction"},"description":"Lists user-triggerable actions available from the current state."},"events":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KMigrationEvent"},"description":"Lists events that have occurred during the migration."}},"required":["name","display_name","lrn","id","created_at","k2k_app","consumer_group_id","status","status_message","allowed_next_states","events"]},"hq_K2KMigrationStatus":{"type":"string","description":"Enumerates K2K migration status types.","enum":["check_migration_readiness","migration_readiness_confirmed","migrate_offsets","offsets_migrated","migration_done","check_rollback_readiness","rollback_readiness_confirmed","rollback_offsets","offsets_rolled_back","rollback_done","error"]},"hq_K2KMigrationAction":{"type":"string","description":"User-triggerable migration actions.","enum":["check_migration_readiness","migrate_offsets","migration_done","check_rollback_readiness","rollback_offsets","rollback_done"]},"hq_K2KMigrationEvent":{"type":"object","description":"Represents an event that occurred during a K2K migration.","properties":{"time":{"type":"string","format":"date-time","description":"The timestamp when the event occurred."},"message":{"type":"string","description":"A human-readable description of the event."},"offsets":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KTopicPartitionOffset"},"description":"Optional list of topic-partition-offsets associated with this event."}},"required":["time","message"]},"hq_K2KTopicPartitionOffset":{"type":"object","description":"A topic-partition-offset tuple specifying the position to update.","properties":{"topic":{"type":"string","description":"The name of the Kafka topic."},"topic_name":{"type":"string","description":"DEPRECATED: Use 'topic' instead. This field is kept for backward compatibility.\nThe name of the Kafka topic.\n","deprecated":true},"partition":{"type":"integer","format":"int32","description":"The partition number for the given topic.","minimum":0},"offset":{"type":"integer","format":"int64","description":"The offset value to set for the given topic-partition.","minimum":0}},"required":["partition","offset"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v1/k2k/migrations/{name}":{"get":{"description":"Gets a K2K migration by name.","operationId":"getK2KMigration","parameters":[{"in":"path","name":"name","description":"The unique name of the migration.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved the migration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KMigration"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_k2kapps"]}}}}
```

## DELETE /api/v1/k2k/migrations/{name}

> Deletes a K2K migration by name.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.2"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v1/k2k/migrations/{name}":{"delete":{"description":"Deletes a K2K migration by name.","operationId":"deleteK2KMigration","parameters":[{"in":"path","name":"name","description":"The unique name of the migration.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Successfully deleted the migration."},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_k2kapps"]}}}}
```

## PATCH /api/v1/k2k/migrations/{name}

> Updates the state of a K2K migration.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.2"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_UpdateK2KMigrationRequest":{"type":"object","description":"Request body for updating the state of a K2K migration.","properties":{"status":{"$ref":"#/components/schemas/hq_K2KMigrationAction"}},"required":["status"]},"hq_K2KMigrationAction":{"type":"string","description":"User-triggerable migration actions.","enum":["check_migration_readiness","migrate_offsets","migration_done","check_rollback_readiness","rollback_offsets","rollback_done"]},"hq_K2KMigration":{"type":"object","description":"Represents a K2K consumer group offset migration.","properties":{"name":{"type":"string","description":"The unique name of the migration."},"display_name":{"type":"string"},"lrn":{"type":"string","description":"Contains the resource identifier for use in access control policies."},"id":{"type":"string"},"created_at":{"type":"string","format":"date-time","description":"The timestamp when the migration was created."},"k2k_app":{"type":"string","description":"The name of the K2K app this migration is associated with."},"consumer_group_id":{"type":"string","description":"The ID of the consumer group being migrated."},"status":{"$ref":"#/components/schemas/hq_K2KMigrationStatus"},"status_message":{"type":"string","description":"A human-readable message about the current status."},"allowed_next_states":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KMigrationAction"},"description":"Lists user-triggerable actions available from the current state."},"events":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KMigrationEvent"},"description":"Lists events that have occurred during the migration."}},"required":["name","display_name","lrn","id","created_at","k2k_app","consumer_group_id","status","status_message","allowed_next_states","events"]},"hq_K2KMigrationStatus":{"type":"string","description":"Enumerates K2K migration status types.","enum":["check_migration_readiness","migration_readiness_confirmed","migrate_offsets","offsets_migrated","migration_done","check_rollback_readiness","rollback_readiness_confirmed","rollback_offsets","offsets_rolled_back","rollback_done","error"]},"hq_K2KMigrationEvent":{"type":"object","description":"Represents an event that occurred during a K2K migration.","properties":{"time":{"type":"string","format":"date-time","description":"The timestamp when the event occurred."},"message":{"type":"string","description":"A human-readable description of the event."},"offsets":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KTopicPartitionOffset"},"description":"Optional list of topic-partition-offsets associated with this event."}},"required":["time","message"]},"hq_K2KTopicPartitionOffset":{"type":"object","description":"A topic-partition-offset tuple specifying the position to update.","properties":{"topic":{"type":"string","description":"The name of the Kafka topic."},"topic_name":{"type":"string","description":"DEPRECATED: Use 'topic' instead. This field is kept for backward compatibility.\nThe name of the Kafka topic.\n","deprecated":true},"partition":{"type":"integer","format":"int32","description":"The partition number for the given topic.","minimum":0},"offset":{"type":"integer","format":"int64","description":"The offset value to set for the given topic-partition.","minimum":0}},"required":["partition","offset"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v1/k2k/migrations/{name}":{"patch":{"description":"Updates the state of a K2K migration.","operationId":"updateK2KMigration","parameters":[{"in":"path","name":"name","description":"The unique name of the migration.","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_UpdateK2KMigrationRequest"}}}},"responses":{"200":{"description":"Successfully updated the migration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KMigration"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_k2kapps"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lenses.io/latest/api-reference/reference/k2k-apps.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
