Skip to main content
POST
/
environments
/
{id}
Update an environment
curl --request POST \
  --url https://management-api.fpjs.io/environments/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-API-Version: <x-api-version>' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "limit_value": 123
}
'
import requests

url = "https://management-api.fpjs.io/environments/{id}"

payload = {
    "name": "<string>",
    "description": "<string>",
    "limit_value": 123
}
headers = {
    "X-API-Version": "<x-api-version>",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.text)
const options = {
  method: 'POST',
  headers: {
    'X-API-Version': '<x-api-version>',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({name: '<string>', description: '<string>', limit_value: 123})
};

fetch('https://management-api.fpjs.io/environments/{id}', 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://management-api.fpjs.io/environments/{id}",
  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>',
    'limit_value' => 123
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json",
    "X-API-Version: <x-api-version>"
  ],
]);

$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://management-api.fpjs.io/environments/{id}"

	payload := strings.NewReader("{\n  \"name\": \"<string>\",\n  \"description\": \"<string>\",\n  \"limit_value\": 123\n}")

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

	req.Header.Add("X-API-Version", "<x-api-version>")
	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://management-api.fpjs.io/environments/{id}")
  .header("X-API-Version", "<x-api-version>")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"<string>\",\n  \"description\": \"<string>\",\n  \"limit_value\": 123\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://management-api.fpjs.io/environments/{id}")

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

request = Net::HTTP::Post.new(url)
request["X-API-Version"] = '<x-api-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"<string>\",\n  \"description\": \"<string>\",\n  \"limit_value\": 123\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "id": "ae_rrETjdWcfqI6AFsk",
    "name": "Default environment",
    "is_restricted": false,
    "created_at": "2024-05-31T01:24:39.506Z",
    "updated_at": "2024-05-31T01:24:39.506Z",
    "description": "Production environment",
    "limit_value": 100000,
    "restricted_at": "2024-05-31T01:24:39.506Z"
  }
}
{
  "error": {
    "message": "<string>",
    "code": "<string>",
    "violations": [
      {
        "property": "<string>",
        "message": "<string>"
      }
    ]
  }
}
{
  "error": {
    "message": "<string>",
    "code": "<string>"
  }
}
{
  "error": {
    "message": "<string>",
    "code": "<string>"
  }
}
{
  "error": {
    "message": "<string>",
    "code": "<string>"
  }
}

Authorizations

Authorization
string
header
required

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

Headers

X-API-Version
string
required

Management API version.

Path Parameters

id
string
required

Body

application/json
name
string

Name for the environment

Maximum string length: 255
description
string

Description for the environment

Maximum string length: 256
limit_mode
enum<string>

Limit mode for the environment

Available options:
none,
restrict,
notify
limit_value
number

Limit value for the environment (required when limitMode is not set to "none")

Response

Updated environment object.

data
object
required