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 key field)


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.


POSTapi.foxnose.net/organizations/:org/projects/:project/environments/

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 exist
    • project_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 data
    • too_many_environments - maximum number of environments for your plan has been reached

Request

POST
/organizations/:org/projects/:project/environments/
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"
}

POSTapi.foxnose.net/organizations/:org/projects/:project/environments/:env/toggle/

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 true to enable or false to 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 exist
    • project_not_found - the specified project does not exist
    • environment_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. The detail field contains information about when the next operation will be possible. See limits page for more details.

Request

POST
/organizations/:org/projects/:project/environments/:env/toggle/
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

GETapi.foxnose.net/organizations/:org/projects/:project/environments/

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 exist
    • project_not_found - the specified project does not exist

Request

GET
/organizations/:org/projects/:project/environments/
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"
    }
]

GETapi.foxnose.net/organizations/:org/projects/:project/environments/:env/

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 exist
    • project_not_found - the specified project does not exist
    • environment_not_found - the specified environment does not exist

Request

GET
/organizations/:org/projects/:project/environments/:env/
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"
}

PUTapi.foxnose.net/organizations/:org/projects/:project/environments/:env/

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 exist
    • project_not_found - the specified project does not exist
    • environment_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

PUT
/organizations/:org/projects/:project/environments/:env/
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"
}

DELETEapi.foxnose.net/organizations/:org/projects/:project/environments/:env/

Delete Environment

Permanently deletes an environment and all associated data. This operation is performed asynchronously.

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 exist
    • project_not_found - the specified project does not exist
    • environment_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

DELETE
/organizations/:org/projects/:project/environments/:env/
curl -X DELETE https://api.foxnose.net/organizations/dl55w3ds/projects/d7hazs1x/environments/7c9h4pwu/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiI..." \
-H "Content-Type: application/json"

Was this page helpful?