Code Examples
Here is a simple example of how to use the Admin API with curl to create a new environment within a project.
curl 'https://api.flagsmith.com/api/v1/environments/' \
-H 'Content-Type: application/json' \
-H 'Authorization: Api-Key <API TOKEN FROM ORGANISATION PAGE>' \
--data-binary '{"name":"New Environment","project":"<Project ID>"}'
Parameters
Authorization: Your Organisation API Token, prefixed withApi-Key.Content-Type:application/json--data-binary: The JSON payload containing the details of the environment you want to create. You'll need to provide thenamefor the new environment and theprojectID it belongs to.
For more complex examples and different languages, please refer to the full code examples in the Flags API documentation.