Environments
Authentication: JWT
An environment is an isolated workspace within a project for content management and testing. Each environment has unique host URLs for isolated data access via the Flux API. Every project includes a production environment by default, with the ability to create additional environments for development and testing.
Path Parameters
- Name
:org- Type
- string
- Description
Unique identifier of the organization
- Name
:project- Type
- string
- Description
Unique identifier of the project
- Name
:env- Type
- string
- Description
Unique identifier of the environment (the
keyfield)
Environment Object
- Name
key- Type
- string
- Description
Unique identifier for the environment, automatically generated by the system.
- Name
name- Type
- string
- Description
Display name of the environment.
- Name
project- Type
- string
- Description
ID of the project this environment belongs to.
- Name
host- Type
- string
- Description
Host URL for this environment. Use this URL to access the Flux API for this environment.
- Name
has_custom_cname- Type
- bool
- Description
Whether a custom CNAME has been configured for the environment's host. Defaults to
false.
- Name
is_enabled- Type
- bool
- Description
Whether the environment is active and accessible. Defaults to
true.
- Name
is_production- Type
- bool
- Description
Whether this is the production environment. Only one production environment is allowed per project.
- Name
created_at- Type
- datetime
- Description
Timestamp when the environment was created.
Create Environment
Creates a new environment within the specified project.
Success Response: 201 Created
Attributes
- Name
name- Type
- string
- Required
- required
- Description
Environment name
- Minimum length: 1
- Maximum length: 255
Errors
- Name
401 Unauthorized- Description
Authentication credentials are missing or invalid.
authentication_failed- authentication credentials were not provided or are invalid
- Name
403 Forbidden- Description
Insufficient permissions to create environments.
permission_denied- insufficient permissions to perform this action
- Name
404 Not Found- Description
The specified resource could not be found. Specific codes:
organization_not_found- the specified organization does not existproject_not_found- the specified project does not exist
- Name
422 Unprocessable Content- Description
Validation or business logic error. Specific codes:
validation_error- validation errors in request datatoo_many_environments- maximum number of environments for your plan has been reached
Request
curl https://api.foxnose.net/organizations/dl55w3ds/projects/d7hazs1x/environments/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiI..." \
-H "Content-Type: application/json" \
-d '{
"name": "Staging"
}'
Response
{
"key": "4yiek4pa",
"name": "Staging",
"project": "d7hazs1x",
"host": "4yiek4pa.fxns.io",
"has_custom_cname": false,
"is_enabled": true,
"is_production": false,
"created_at": "2024-10-29T07:02:53.215453-05:00"
}
Enable/Disable Environment
Toggles the enabled state of an environment.
Success Response: 204 No Content
Attributes
- Name
is_enabled- Type
- bool
- Required
- required
- Description
Set to
trueto enable orfalseto disable the environment
Errors
- Name
401 Unauthorized- Description
Authentication credentials are missing or invalid.
authentication_failed- authentication credentials were not provided or are invalid
- Name
403 Forbidden- Description
Insufficient permissions to modify this environment.
permission_denied- insufficient permissions to perform this action
- Name
404 Not Found- Description
The specified resource could not be found. Specific codes:
organization_not_found- the specified organization does not existproject_not_found- the specified project does not existenvironment_not_found- the specified environment does not exist
- Name
422 Unprocessable Content- Description
Business logic error. Specific codes:
environment_toggle_error- attempting to enable/disable an environment too soon after the last state change. Thedetailfield contains information about when the next operation will be possible. See limits page for more details.
Request
curl https://api.foxnose.net/organizations/dl55w3ds/projects/d7hazs1x/environments/7c9h4pwu/toggle/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiI..." \
-H "Content-Type: application/json" \
-d '{"is_enabled": true}'
Response
No response body
List All Environments
Retrieves all environments within the specified project. Returns all results in a single response without pagination.
Success Response: 200 OK
Errors
- Name
401 Unauthorized- Description
Authentication credentials are missing or invalid.
authentication_failed- authentication credentials were not provided or are invalid
- Name
403 Forbidden- Description
Insufficient permissions to view environments in this project.
permission_denied- insufficient permissions to perform this action
- Name
404 Not Found- Description
The specified resource could not be found. Specific codes:
organization_not_found- the specified organization does not existproject_not_found- the specified project does not exist
Request
curl https://api.foxnose.net/organizations/dl55w3ds/projects/d7hazs1x/environments/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiI..." \
-H "Content-Type: application/json"
Response
[
{
"key": "4yiek4pa",
"name": "Production",
"project": "d7hazs1x",
"host": "4yiek4pa.fxns.io",
"has_custom_cname": false,
"is_enabled": true,
"is_production": true,
"created_at": "2024-10-29T07:02:53.215453-05:00"
},
{
"key": "3fa7c1bq",
"name": "Staging",
"project": "d7hazs1x",
"host": "3fa7c1bq.fxns.io",
"has_custom_cname": false,
"is_enabled": true,
"is_production": false,
"created_at": "2024-11-01T12:15:30.154831-05:00"
}
]
Retrieve Environment
Retrieves details of a specific environment by its identifier.
Success Response: 200 OK
Errors
- Name
401 Unauthorized- Description
Authentication credentials are missing or invalid.
authentication_failed- authentication credentials were not provided or are invalid
- Name
403 Forbidden- Description
Insufficient permissions to view this environment.
permission_denied- insufficient permissions to perform this action
- Name
404 Not Found- Description
The specified resource could not be found. Specific codes:
organization_not_found- the specified organization does not existproject_not_found- the specified project does not existenvironment_not_found- the specified environment does not exist
Request
curl https://api.foxnose.net/organizations/dl55w3ds/projects/d7hazs1x/environments/7c9h4pwu/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiI..." \
-H "Content-Type: application/json"
Response
{
"key": "4yiek4pa",
"name": "Production",
"project": "d7hazs1x",
"host": "4yiek4pa.fxns.io",
"has_custom_cname": false,
"is_enabled": true,
"is_production": true,
"created_at": "2024-10-29T07:02:53.215453-05:00"
}
Update Environment
Updates the attributes of a specific environment.
Success Response: 200 OK
Attributes
- Name
name- Type
- string
- Required
- required
- Description
Environment name
- Minimum length: 1
- Maximum length: 255
Errors
- Name
401 Unauthorized- Description
Authentication credentials are missing or invalid.
authentication_failed- authentication credentials were not provided or are invalid
- Name
403 Forbidden- Description
Insufficient permissions to modify this environment.
permission_denied- insufficient permissions to perform this action
- Name
404 Not Found- Description
The specified resource could not be found. Specific codes:
organization_not_found- the specified organization does not existproject_not_found- the specified project does not existenvironment_not_found- the specified environment does not exist
- Name
422 Unprocessable Content- Description
Validation error. Specific codes:
validation_error- validation errors in request data
Request
curl -X PUT https://api.foxnose.net/organizations/dl55w3ds/projects/d7hazs1x/environments/7c9h4pwu/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiI..." \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Environment"
}'
Response
{
"key": "4yiek4pa",
"name": "Updated Environment",
"project": "d7hazs1x",
"host": "4yiek4pa.fxns.io",
"has_custom_cname": false,
"is_enabled": true,
"is_production": false,
"created_at": "2024-10-29T07:02:53.215453-05:00"
}
Delete Environment
Permanently deletes an environment and all associated data. This operation is performed asynchronously.
Production environments cannot be deleted to prevent accidental data loss.
Success Response: 202 Accepted
Errors
- Name
401 Unauthorized- Description
Authentication credentials are missing or invalid.
authentication_failed- authentication credentials were not provided or are invalid
- Name
403 Forbidden- Description
Insufficient permissions to delete this environment.
permission_denied- insufficient permissions to perform this action
- Name
404 Not Found- Description
The specified resource could not be found. Specific codes:
organization_not_found- the specified organization does not existproject_not_found- the specified project does not existenvironment_not_found- the specified environment does not exist
- Name
422 Unprocessable Content- Description
Business logic error. Specific codes:
production_environment_cannot_be_deleted- production environments cannot be deleted
Request
curl -X DELETE https://api.foxnose.net/organizations/dl55w3ds/projects/d7hazs1x/environments/7c9h4pwu/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiI..." \
-H "Content-Type: application/json"