Skip to main content
POST
/
v1
/
environments
Create Organization Environment
curl --request POST \
  --url https://api.retab.com/v1/environments \
  --header 'Api-Key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "type": "non_production"
}
'
{
  "id": "<string>",
  "name": "<string>",
  "is_default": false,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Documentation Index

Fetch the complete documentation index at: https://docs.retab.com/llms.txt

Use this file to discover all available pages before exploring further.

Create an additional environment for the current organization.
Python
from retab import Retab

client = Retab()

environment = client.environments.create_environment(
    name="Development",
    type="non_production",
)
print(environment.id)
TypeScript
import { Retab } from "@retab/node";

const client = new Retab({ apiKey: process.env.RETAB_API_KEY });

const environment = await client.environments.create_environment(
  "Development",
  "non_production",
);
console.log(environment.id);
Go
package main

import (
	"context"
	"fmt"
	"log"

	retab "github.com/retab-dev/retab/clients/go"
)

func main() {
	client, err := retab.NewClient("")
	if err != nil {
		log.Fatal(err)
	}

	environmentType := retab.AuthStatusEnvironmentTypeNonProduction
	environment, err := client.Environments.Create(context.Background(), &retab.EnvironmentsCreateParams{
		Name: "Development",
		Type: &environmentType,
	})
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(environment.ID)
}
Java
import com.retab.RetabClient;
import com.retab.types.EnvironmentCreateRequestType;

public final class Example {
  public static void main(String[] args) throws Exception {
    RetabClient client = new RetabClient(System.getenv("RETAB_API_KEY"));

    var environment =
        client.environments().create("Development", EnvironmentCreateRequestType.NON_PRODUCTION);
    System.out.println(environment.getId());
  }
}
cURL
curl -X POST 'https://api.retab.com/v1/environments' \
  -H "Api-Key: $RETAB_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"name":"Development","type":"non_production"}'

Authorizations

Api-Key
string
header
required

Body

application/json
name
string
required
type
enum<string>
default:non_production
Available options:
production,
non_production

Response

Successful Response

id
string
required
name
string
required
type
enum<string>
required
Available options:
production,
non_production
is_default
boolean
default:false
created_at
string<date-time>
updated_at
string<date-time>