Feature Flags
Rename an environment
PATCH
/
api
/
v1
/
flags
/
environments
/
{env}
Go (SDK)
package main
import(
"context"
mka1 "github.com/MeetKai/mka1-sdks/go"
"github.com/MeetKai/mka1-sdks/go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := mka1.New(
mka1.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
res, err := s.Flags.Environments.Update(ctx, "<value>", components.FeatureFlagEnvironmentUpdateRequest{
Name: "<value>",
}, nil)
if err != nil {
log.Fatal(err)
}
if res.FeatureFlagEnvironment != nil {
// handle response
}
}using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;
var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.Flags.Environments.UpdateAsync(
env: "<value>",
body: new FeatureFlagEnvironmentUpdateRequest() {
Name = "<value>",
}
);
// handle responsefrom meetkai_mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.flags.environments.update(env="<value>", name="<value>")
# Handle response
print(res)import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.flags.environments.update({
env: "<value>",
featureFlagEnvironmentUpdateRequest: {
name: "<value>",
},
});
console.log(result);
}
run();curl --request PATCH \
--url https://apigw.mka1.com/api/v1/flags/environments/{env} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://apigw.mka1.com/api/v1/flags/environments/{env}', 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://apigw.mka1.com/api/v1/flags/environments/{env}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<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;
}HttpResponse<String> response = Unirest.patch("https://apigw.mka1.com/api/v1/flags/environments/{env}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigw.mka1.com/api/v1/flags/environments/{env}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"evaluation_key_configured": true,
"evaluation_key_hint": "mka1_key_Z3sV...kwxY",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": "bad_request",
"message": "<string>",
"request_id": "<string>"
}{
"error": "bad_request",
"message": "<string>",
"request_id": "<string>"
}{
"error": "bad_request",
"message": "<string>",
"request_id": "<string>"
}{
"error": "bad_request",
"message": "<string>",
"request_id": "<string>"
}Authorizations
Send Authorization: Bearer , using an MKA1 API key for automation or an OAuth API access token for a signed-in application. Use a dynamic security callback to refresh OAuth access tokens. Browser session-only operations still require their declared cookie.
Headers
Optional external end-user identifier forwarded by the API gateway.
Path Parameters
Pattern:
^[a-z0-9][a-z0-9-]{0,62}$Body
application/json
Response
Updated environment
Whether the environment has an active evaluation key.
The active key's prefix plus the first and last four characters of its payload, for display. Null when no key is configured, or when the active key was generated before hints were recorded.
Pattern:
^mka1_key_[A-Za-z0-9_-]{4}\.\.\.[A-Za-z0-9_-]{4}$Example:
"mka1_key_Z3sV...kwxY"
Was this page helpful?
⌘I
Go (SDK)
package main
import(
"context"
mka1 "github.com/MeetKai/mka1-sdks/go"
"github.com/MeetKai/mka1-sdks/go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := mka1.New(
mka1.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
res, err := s.Flags.Environments.Update(ctx, "<value>", components.FeatureFlagEnvironmentUpdateRequest{
Name: "<value>",
}, nil)
if err != nil {
log.Fatal(err)
}
if res.FeatureFlagEnvironment != nil {
// handle response
}
}using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;
var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.Flags.Environments.UpdateAsync(
env: "<value>",
body: new FeatureFlagEnvironmentUpdateRequest() {
Name = "<value>",
}
);
// handle responsefrom meetkai_mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.flags.environments.update(env="<value>", name="<value>")
# Handle response
print(res)import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.flags.environments.update({
env: "<value>",
featureFlagEnvironmentUpdateRequest: {
name: "<value>",
},
});
console.log(result);
}
run();curl --request PATCH \
--url https://apigw.mka1.com/api/v1/flags/environments/{env} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://apigw.mka1.com/api/v1/flags/environments/{env}', 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://apigw.mka1.com/api/v1/flags/environments/{env}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<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;
}HttpResponse<String> response = Unirest.patch("https://apigw.mka1.com/api/v1/flags/environments/{env}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigw.mka1.com/api/v1/flags/environments/{env}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"evaluation_key_configured": true,
"evaluation_key_hint": "mka1_key_Z3sV...kwxY",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": "bad_request",
"message": "<string>",
"request_id": "<string>"
}{
"error": "bad_request",
"message": "<string>",
"request_id": "<string>"
}{
"error": "bad_request",
"message": "<string>",
"request_id": "<string>"
}{
"error": "bad_request",
"message": "<string>",
"request_id": "<string>"
}