REST APIs for Confluent Manager for Apache Flink

You can use the Confluent REST API to manage these resources for Confluent Manager for Apache Flink® (CMF):

  • Environments
  • Applications

In addition to the REST API, you can manage the above resources by using these Confluent tools:

Prerequisites

The REST API requires networked access to CMF.

As part of the installation process, a Kubernetes service is created that exposes CMF behind an outward-facing endpoint. By default, the service exposes CMF on port 8080.

If you have configured authentication and/or authorization, each API request must be authenticated and you need permissions on the respective resource.

For more information, see:

Endpoints (v1)

All endpoints are served under /cmf/api/v1.

Identifiers

All resources are identified by name. Each name must be unique in its scope and follow the following restrictions:

  • Minimum length: 4
  • Maximum length: 253
  • Pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$

Timestamps

All timestamps in fields named metadata.creationTimestamp and metadata.updateTimestamp and the created_time and updated_time fields in the Environment are RFC 3339 formatted strings, compatible with Java’s Instant type.

The timestamp is in UTC, and does not contain any timezone information.name

This is an example: 2025-03-31T11:34:01.503Z.

Example usage with curl

The following example shows how to create a Flink Application in an environment called “test” using curl:

Contents of the file flink-application.yaml:

apiVersion: cmf.confluent.io/v1
kind: FlinkApplication
metadata:
  name: curl-example
spec:
  image: confluentinc/cp-flink:1.19.1-cp2
  flinkVersion: v1_19
  flinkConfiguration:
    taskmanager.numberOfTaskSlots: "1"
  serviceAccount: flink
  jobManager:
    resource:
      memory: 1048m
      cpu: 1
  taskManager:
    resource:
      memory: 1048m
      cpu: 1
  job:
    jarURI: local:///opt/flink/examples/streaming/StateMachineExample.jar
    state: running
    parallelism: 3
    upgradeMode: stateless
Copy

Submission using curl, assuming CMF is running on localhost:8080:

curl -H "Content-type: application/yaml" --data-binary "@flink-application.yaml" localhost:8080/cmf/api/v1/environments/test/applications
Copy

API reference

This section contains the REST API reference for Confluent Manager for Apache Flink®.

POST /environments

Create or update an Environment

Example request:

POST /environments HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "name": "string",
    "flinkApplicationDefaults": {},
    "kubernetesNamespace": "string"
}
Copy
Status Codes:
  • 201 Created

    The Environment was successfully created or updated.

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "name": "string",
        "created_time": "2025-04-15T17:35:13.326345",
        "updated_time": "2025-04-15T17:35:13.326345",
        "flinkApplicationDefaults": {},
        "kubernetesNamespace": "string"
    }
    
    Copy
  • 400 Bad Request

    Bad request.

    Example response:

    HTTP/1.1 400 Bad Request
    Content-Type: application/json
    
    {
        "errors": [
            {
                "message": "string"
            }
        ]
    }
    
    Copy
  • 500 Internal Server Error

    Server error.

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "errors": [
            {
                "message": "string"
            }
        ]
    }
    
    Copy
GET /environments

Retrieve a paginated list of all environments.

Query Parameters:
 
  • page (integer) – Zero-based page index (0..N)
  • size (integer) – The size of the page to be returned
  • sort (array) – Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.

Example request:

GET /environments HTTP/1.1
Host: example.com
Copy
Status Codes:
  • 200 OK

    List of environments found. If no environments are found, an empty list is returned.

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "pageable": {
            "page": 1,
            "size": 1,
            "sort": {
                "sorted": true,
                "unsorted": true,
                "empty": true
            }
        },
        "metadata": {
            "size": 1
        },
        "items": [
            {
                "name": "string",
                "created_time": "2025-04-15T17:35:13.326345",
                "updated_time": "2025-04-15T17:35:13.326345",
                "flinkApplicationDefaults": {},
                "kubernetesNamespace": "string"
            }
        ]
    }
    
    Copy
  • 304 Not Modified – Not modified.
  • 500 Internal Server Error

    Server error.

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "errors": [
            {
                "message": "string"
            }
        ]
    }
    
    Copy
Response Headers:
 
  • ETag – An ID for this version of the response.
GET /environments/{envName}

Get/Describe an environment with the given name.

Parameters:
  • envName (string) – Name of the Environment to be retrieved.

Example request:

GET /environments/{envName} HTTP/1.1
Host: example.com
Copy
Status Codes:
  • 200 OK

    Environment found and returned.

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "name": "string",
        "created_time": "2025-04-15T17:35:13.326345",
        "updated_time": "2025-04-15T17:35:13.326345",
        "flinkApplicationDefaults": {},
        "kubernetesNamespace": "string"
    }
    
    Copy
  • 404 Not Found

    Environment not found.

    Example response:

    HTTP/1.1 404 Not Found
    Content-Type: application/json
    
    {
        "errors": [
            {
                "message": "string"
            }
        ]
    }
    
    Copy
  • 500 Internal Server Error

    Server error.

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "errors": [
            {
                "message": "string"
            }
        ]
    }
    
    Copy
DELETE /environments/{envName}
Parameters:
  • envName (string) – Name of the Environment to be deleted.
Status Codes:
  • 200 OK – Environment found and deleted.
  • 304 Not Modified – Not modified.
  • 500 Internal Server Error

    Server error.

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "errors": [
            {
                "message": "string"
            }
        ]
    }
    
    Copy
  • 404 Not Found

    Environment not found.

    Example response:

    HTTP/1.1 404 Not Found
    Content-Type: application/json
    
    {
        "errors": [
            {
                "message": "string"
            }
        ]
    }
    
    Copy
POST /environments/{envName}/applications

Creates a new Flink Application or updates an existing one in the given Environment.

Parameters:
  • envName (string) – Name of the Environment

Example request:

POST /environments/{envName}/applications HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "apiVersion": "string",
    "kind": "string",
    "metadata": {},
    "spec": {},
    "status": {}
}
Copy
Status Codes:
  • 201 Created

    The Application was successfully created or updated.

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "apiVersion": "string",
        "kind": "string",
        "metadata": {},
        "spec": {},
        "status": {}
    }
    
    Copy
  • 400 Bad Request

    Bad request.

    Example response:

    HTTP/1.1 400 Bad Request
    Content-Type: application/json
    
    {
        "errors": [
            {
                "message": "string"
            }
        ]
    }
    
    Copy
  • 422 Unprocessable Entity

    Request valid but invalid content.

    Example response:

    HTTP/1.1 422 Unprocessable Entity
    Content-Type: application/json
    
    {
        "errors": [
            {
                "message": "string"
            }
        ]
    }
    
    Copy
  • 500 Internal Server Error

    Server error.

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "errors": [
            {
                "message": "string"
            }
        ]
    }
    
    Copy
GET /environments/{envName}/applications

Retrieve a paginated list of all applications in the given Environment.

Parameters:
  • envName (string) – Name of the Environment
Query Parameters:
 
  • page (integer) – Zero-based page index (0..N)
  • size (integer) – The size of the page to be returned
  • sort (array) – Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.

Example request:

GET /environments/{envName}/applications HTTP/1.1
Host: example.com
Copy
Status Codes:
  • 200 OK

    Application found and returned.

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "pageable": {
            "page": 1,
            "size": 1,
            "sort": {
                "sorted": true,
                "unsorted": true,
                "empty": true
            }
        },
        "metadata": {
            "size": 1
        },
        "items": [
            {
                "apiVersion": "string",
                "kind": "string",
                "metadata": {},
                "spec": {},
                "status": {}
            }
        ]
    }
    
    Copy
  • 304 Not Modified – Not modified.
  • 500 Internal Server Error

    Server error.

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "errors": [
            {
                "message": "string"
            }
        ]
    }
    
    Copy
Response Headers:
 
  • ETag – An ID for this version of the response.
GET /environments/{envName}/applications/{appName}

Retrieve an Application of the given name in the given Environment.

Parameters:
  • envName (string) – Name of the Environment
  • appName (string) – Name of the Application

Example request:

GET /environments/{envName}/applications/{appName} HTTP/1.1
Host: example.com
Copy
Status Codes:
  • 200 OK

    Application found and returned.

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "apiVersion": "string",
        "kind": "string",
        "metadata": {},
        "spec": {},
        "status": {}
    }
    
    Copy
  • 304 Not Modified – Not modified.
  • 500 Internal Server Error

    Server error.

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "errors": [
            {
                "message": "string"
            }
        ]
    }
    
    Copy
  • 404 Not Found

    Application not found.

    Example response:

    HTTP/1.1 404 Not Found
    Content-Type: application/json
    
    {
        "errors": [
            {
                "message": "string"
            }
        ]
    }
    
    Copy
Response Headers:
 
  • ETag – An ID for this version of the response.
DELETE /environments/{envName}/applications/{appName}

Deletes an Application of the given name in the given Environment.

Parameters:
  • envName (string) – Name of the Environment
  • appName (string) – Name of the Application
Status Codes:
  • 200 OK – Application found and deleted.
  • 304 Not Modified – Not modified.
  • 500 Internal Server Error

    Server error.

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "errors": [
            {
                "message": "string"
            }
        ]
    }
    
    Copy
POST /environments/{envName}/applications/{appName}/start

Starts an earlier submitted Flink Application

Parameters:
  • envName (string) – Name of the Environment
  • appName (string) – Name of the Application
Status Codes:
  • 200 OK

    Application started

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "apiVersion": "string",
        "kind": "string",
        "metadata": {},
        "spec": {},
        "status": {}
    }
    
    Copy
  • 304 Not Modified – Not modified.
  • 500 Internal Server Error

    Server error.

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "errors": [
            {
                "message": "string"
            }
        ]
    }
    
    Copy
POST /environments/{envName}/applications/{appName}/suspend

Suspends an earlier started Flink Application

Parameters:
  • envName (string) – Name of the Environment
  • appName (string) – Name of the Application
Status Codes:
  • 200 OK

    Application suspended

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "apiVersion": "string",
        "kind": "string",
        "metadata": {},
        "spec": {},
        "status": {}
    }
    
    Copy
  • 304 Not Modified – Not modified.
  • 500 Internal Server Error

    Server error.

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "errors": [
            {
                "message": "string"
            }
        ]
    }
    
    Copy

Troubleshooting

  • Resource not found: If you encounter the error Resource not found… when making a GET call, it may be due to the wrong URL. Specifically, the requested REST resource might not exist.

    For example:

    • When making the GET call:

      GET http://localhost:8080/hello
      
      Copy

      You will receive the error:

      Resource not found: [hello]
      
      Copy
    • Similarly, if you make the GET call:

      GET http://localhost:8080/ or GET http://localhost:8080
      
      Copy

      You will receive the error:

      Resource not found: []
      
      Copy

      This occurs because you are requesting an empty resource.