Skip to main content
POST
/
project-keys
Create Project Key
curl --request POST \
  --url https://api.streamkap.com/project-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "role_ids": [
    "<string>"
  ],
  "permission_ids": [
    "<string>"
  ],
  "kafka_config": {
    "username": "<string>",
    "password": "<string>",
    "whitelist_ips": "<string>",
    "kafka_acls": [
      {
        "topic_name": "<string>",
        "operation": "<string>",
        "resource_pattern_type": "<string>",
        "resource": "TOPIC"
      }
    ],
    "is_create_schema_registry": false
  },
  "allowed_tools": [
    "<string>"
  ],
  "blocked_tools": [
    "<string>"
  ]
}
'
import requests

url = "https://api.streamkap.com/project-keys"

payload = {
    "name": "<string>",
    "description": "<string>",
    "role_ids": ["<string>"],
    "permission_ids": ["<string>"],
    "kafka_config": {
        "username": "<string>",
        "password": "<string>",
        "whitelist_ips": "<string>",
        "kafka_acls": [
            {
                "topic_name": "<string>",
                "operation": "<string>",
                "resource_pattern_type": "<string>",
                "resource": "TOPIC"
            }
        ],
        "is_create_schema_registry": False
    },
    "allowed_tools": ["<string>"],
    "blocked_tools": ["<string>"]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    name: '<string>',
    description: '<string>',
    role_ids: ['<string>'],
    permission_ids: ['<string>'],
    kafka_config: {
      username: '<string>',
      password: '<string>',
      whitelist_ips: '<string>',
      kafka_acls: [
        {
          topic_name: '<string>',
          operation: '<string>',
          resource_pattern_type: '<string>',
          resource: 'TOPIC'
        }
      ],
      is_create_schema_registry: false
    },
    allowed_tools: ['<string>'],
    blocked_tools: ['<string>']
  })
};

fetch('https://api.streamkap.com/project-keys', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.streamkap.com/project-keys",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'name' => '<string>',
    'description' => '<string>',
    'role_ids' => [
        '<string>'
    ],
    'permission_ids' => [
        '<string>'
    ],
    'kafka_config' => [
        'username' => '<string>',
        'password' => '<string>',
        'whitelist_ips' => '<string>',
        'kafka_acls' => [
                [
                                'topic_name' => '<string>',
                                'operation' => '<string>',
                                'resource_pattern_type' => '<string>',
                                'resource' => 'TOPIC'
                ]
        ],
        'is_create_schema_registry' => false
    ],
    'allowed_tools' => [
        '<string>'
    ],
    'blocked_tools' => [
        '<string>'
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.streamkap.com/project-keys"

	payload := strings.NewReader("{\n  \"name\": \"<string>\",\n  \"description\": \"<string>\",\n  \"role_ids\": [\n    \"<string>\"\n  ],\n  \"permission_ids\": [\n    \"<string>\"\n  ],\n  \"kafka_config\": {\n    \"username\": \"<string>\",\n    \"password\": \"<string>\",\n    \"whitelist_ips\": \"<string>\",\n    \"kafka_acls\": [\n      {\n        \"topic_name\": \"<string>\",\n        \"operation\": \"<string>\",\n        \"resource_pattern_type\": \"<string>\",\n        \"resource\": \"TOPIC\"\n      }\n    ],\n    \"is_create_schema_registry\": false\n  },\n  \"allowed_tools\": [\n    \"<string>\"\n  ],\n  \"blocked_tools\": [\n    \"<string>\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.streamkap.com/project-keys")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"<string>\",\n  \"description\": \"<string>\",\n  \"role_ids\": [\n    \"<string>\"\n  ],\n  \"permission_ids\": [\n    \"<string>\"\n  ],\n  \"kafka_config\": {\n    \"username\": \"<string>\",\n    \"password\": \"<string>\",\n    \"whitelist_ips\": \"<string>\",\n    \"kafka_acls\": [\n      {\n        \"topic_name\": \"<string>\",\n        \"operation\": \"<string>\",\n        \"resource_pattern_type\": \"<string>\",\n        \"resource\": \"TOPIC\"\n      }\n    ],\n    \"is_create_schema_registry\": false\n  },\n  \"allowed_tools\": [\n    \"<string>\"\n  ],\n  \"blocked_tools\": [\n    \"<string>\"\n  ]\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.streamkap.com/project-keys")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"<string>\",\n  \"description\": \"<string>\",\n  \"role_ids\": [\n    \"<string>\"\n  ],\n  \"permission_ids\": [\n    \"<string>\"\n  ],\n  \"kafka_config\": {\n    \"username\": \"<string>\",\n    \"password\": \"<string>\",\n    \"whitelist_ips\": \"<string>\",\n    \"kafka_acls\": [\n      {\n        \"topic_name\": \"<string>\",\n        \"operation\": \"<string>\",\n        \"resource_pattern_type\": \"<string>\",\n        \"resource\": \"TOPIC\"\n      }\n    ],\n    \"is_create_schema_registry\": false\n  },\n  \"allowed_tools\": [\n    \"<string>\"\n  ],\n  \"blocked_tools\": [\n    \"<string>\"\n  ]\n}"

response = http.request(request)
puts response.read_body
{
  "project_key_id": "<string>",
  "project": {},
  "created_at": "2023-11-07T05:31:56Z",
  "type": "streamkap_project_key",
  "api": {
    "client_id": "<string>",
    "client_secret": "<string>",
    "token_endpoint": "<string>",
    "api_url": "<string>",
    "roles": [
      "<string>"
    ]
  },
  "kafka": {
    "username": "<string>",
    "password": "<string>",
    "bootstrap_servers": "<string>",
    "security_protocol": "SASL_SSL",
    "sasl_mechanism": "PLAIN",
    "schema_registry_url": "<string>"
  },
  "kafka_acls": [
    {}
  ],
  "allowed_tools": [
    "<string>"
  ],
  "blocked_tools": [
    "<string>"
  ],
  "created_by": "<string>"
}
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>",
      "input": "<unknown>",
      "ctx": {}
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request body for creating a Project Key.

name
string
required

Human-readable name for this Project Key

Required string length: 1 - 100
description
string | null

Optional description (HTML sanitized)

role_ids
string[] | null

Role IDs to assign. Mutually exclusive with permission_ids.

Minimum array length: 1
permission_ids
string[] | null

Permission IDs to assign directly. Mutually exclusive with role_ids.

Minimum array length: 1
kafka_config
ProjectKeyKafkaConfig · object | null

Kafka credentials and ACL config. Omit for API-only key.

tool_profile
enum<string> | null

MCP tool profile (full, read-only, agent-operator, infra-admin)

Available options:
full,
read-only,
agent-operator,
infra-admin
allowed_tools
string[] | null

MCP tool whitelist. If set, overrides profile and block list.

blocked_tools
string[] | null

MCP tool blacklist. Removes tools even if profile allows them.

Response

Successful Response

The downloadable .json credential file returned at creation time.

project_key_id
string
required
project
Project · object
required
created_at
string<date-time>
required
type
string
default:streamkap_project_key
api
ProjectKeyApiCredentials · object | null

API credential section of the credential file.

kafka
ProjectKeyKafkaCredentials · object | null

Kafka credential section of the credential file.

kafka_acls
Kafka Acls · object[]
tool_profile
enum<string> | null
Available options:
full,
read-only,
agent-operator,
infra-admin
allowed_tools
string[] | null
blocked_tools
string[] | null
created_by
string | null