Codefresh Environments API

The Environments API from Codefresh — 1 operation(s) for environments.

Business capability
Environment Management BC-4210.20

Operations 11

GET /environments List #
GET /environments/all/terminate Terminate all #
GET /environments/{id} Get #
GET /environments/{id}/pause Pause #
POST /environments/{envId}/rename/{newName} Rename runtime environment #
GET /environments/{envId}/rename/{newName} Rename #
GET /environments/{id}/start Start #
GET /environments/{id}/status Status #
GET /environments/{id}/stop Stop #
GET /environments/{id}/terminate Terminate #
GET /environments/{id}/unpause Unpause #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/codefresh:codefresh-environments-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

codefresh-environments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  contact:
    name: Codefresh
    url: https://www.codefresh.io
  description: Codefresh API openAPI 3.0 specification
  termsOfService: https://codefresh.io/docs/docs/terms-and-privacy-policy/terms-of-service/
  title: Codefresh Environments API
  version: 0.0.2
  x-logo:
    url: https://g.codefresh.io/modules/cf.resources/codefresh-api-docs-images/codefresh-logo-api.svg
    backgroundColor: '#FFFFFF'
    altText: Codefresh
servers:
- url: https://g.codefresh.io/api
security:
- API-key: []
tags:
- name: Environments
  description: environments
  x-id: environments
paths:
  /environments:
    get:
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: json
      tags:
      - Environments
      operationId: envs-list
      summary: List
      parameters: []
      x-sdk-interface: envs.list
      x-code-samples:
      - lang: curl
        source: "curl  \\\n    -X GET \\\n    -H \"Authorization: ${API_KEY}\" \\\n    \"https://g.codefresh.io/api/environments\""
      - lang: node.js
        source: sdk.envs.list()
  /environments/all/terminate:
    get:
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: json
      tags:
      - Environments
      operationId: envs-terminate-all
      summary: Terminate all
      parameters: []
      x-sdk-interface: envs.terminateAll
      x-code-samples:
      - lang: curl
        source: "curl  \\\n    -X GET \\\n    -H \"Authorization: ${API_KEY}\" \\\n    \"https://g.codefresh.io/api/environments/all/terminate\""
      - lang: node.js
        source: sdk.envs.terminateAll()
  /environments/{id}:
    get:
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: json
      tags:
      - Environments
      operationId: envs-get
      parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
        description: Id
      summary: Get
      x-sdk-interface: envs.get
      x-code-samples:
      - lang: curl
        source: "curl  \\\n    -X GET \\\n    -H \"Authorization: ${API_KEY}\" \\\n    \"https://g.codefresh.io/api/environments/${ID}\""
      - lang: node.js
        source: sdk.envs.get({ id })
  /environments/{id}/pause:
    get:
      parameters:
      - description: ID of an object
        in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: json
      tags:
      - Environments
      operationId: envs-pause
      summary: Pause
      x-sdk-interface: envs.pause
      x-code-samples:
      - lang: curl
        source: "curl  \\\n    -X GET \\\n    -H \"Authorization: ${API_KEY}\" \\\n    \"https://g.codefresh.io/api/environments/${ID}/pause\""
      - lang: node.js
        source: sdk.envs.pause({ id })
  /environments/{envId}/rename/{newName}:
    post:
      x-action: renameRuntimeEnv
      x-entityId:
        pathId: params.envId
        pathName: body.name
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: json
      tags:
      - Environments
      operationId: environments-rename-runtime-env
      parameters:
      - description: The new name to assign to the environment
        in: path
        name: newName
        required: true
        schema:
          type: string
      - in: path
        name: envId
        schema:
          type: string
        description: Runtime environment ID
        required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
      summary: Rename runtime environment
      x-sdk-interface: environments.renameRuntimeEnv
      x-code-samples:
      - lang: curl
        source: "curl  \\\n    -X POST \\\n    -H \"Authorization: ${API_KEY}\" \\\n    -H 'Content-Type: application/json; charset=utf-8' \\\n    -d \"${REQUEST_BODY_OBJ}\" \\\n    \"https://g.codefresh.io/api/environments/${ENV_ID}/rename/${NEW_NAME}\""
      - lang: node.js
        source: sdk.environments.renameRuntimeEnv({ newName, envId }, { ...REQUEST_BODY_OBJ })
    get:
      parameters:
      - description: The new name to assign to the environment
        in: path
        name: newName
        required: true
        schema:
          type: string
      - in: path
        name: envId
        schema:
          type: object
        description: envId
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: json
      tags:
      - Environments
      operationId: envs-rename
      summary: Rename
      x-sdk-interface: envs.rename
      x-code-samples:
      - lang: curl
        source: "curl  \\\n    -X GET \\\n    -H \"Authorization: ${API_KEY}\" \\\n    \"https://g.codefresh.io/api/environments/${ENV_ID}/rename/${NEW_NAME}\""
      - lang: node.js
        source: sdk.envs.rename({ newName, envId })
  /environments/{id}/start:
    get:
      parameters:
      - description: ID of an object
        in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: json
      tags:
      - Environments
      operationId: envs-start
      summary: Start
      x-sdk-interface: envs.start
      x-code-samples:
      - lang: curl
        source: "curl  \\\n    -X GET \\\n    -H \"Authorization: ${API_KEY}\" \\\n    \"https://g.codefresh.io/api/environments/${ID}/start\""
      - lang: node.js
        source: sdk.envs.start({ id })
  /environments/{id}/status:
    get:
      parameters:
      - description: ID of an object
        in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: json
      tags:
      - Environments
      operationId: envs-status
      summary: Status
      x-sdk-interface: envs.status
      x-code-samples:
      - lang: curl
        source: "curl  \\\n    -X GET \\\n    -H \"Authorization: ${API_KEY}\" \\\n    \"https://g.codefresh.io/api/environments/${ID}/status\""
      - lang: node.js
        source: sdk.envs.status({ id })
  /environments/{id}/stop:
    get:
      parameters:
      - description: ID of an object
        in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: json
      tags:
      - Environments
      operationId: envs-stop
      summary: Stop
      x-sdk-interface: envs.stop
      x-code-samples:
      - lang: curl
        source: "curl  \\\n    -X GET \\\n    -H \"Authorization: ${API_KEY}\" \\\n    \"https://g.codefresh.io/api/environments/${ID}/stop\""
      - lang: node.js
        source: sdk.envs.stop({ id })
  /environments/{id}/terminate:
    get:
      parameters:
      - description: ID of the environment
        in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: json
      tags:
      - Environments
      operationId: envs-terminate
      summary: Terminate
      x-sdk-interface: envs.terminate
      x-code-samples:
      - lang: curl
        source: "curl  \\\n    -X GET \\\n    -H \"Authorization: ${API_KEY}\" \\\n    \"https://g.codefresh.io/api/environments/${ID}/terminate\""
      - lang: node.js
        source: sdk.envs.terminate({ id })
  /environments/{id}/unpause:
    get:
      parameters:
      - description: ID of an object
        in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: json
      tags:
      - Environments
      operationId: envs-unpause
      summary: Unpause
      x-sdk-interface: envs.unpause
      x-code-samples:
      - lang: curl
        source: "curl  \\\n    -X GET \\\n    -H \"Authorization: ${API_KEY}\" \\\n    \"https://g.codefresh.io/api/environments/${ID}/unpause\""
      - lang: node.js
        source: sdk.envs.unpause({ id })
components:
  securitySchemes:
    API-key:
      in: header
      name: Authorization
      description: 'An api key got from: User Settings -> API keys -> Generate'
      type: apiKey
x-service-name: api-public
x-base-path: /api
x-internal-services:
- pipeline-manager
- api
x-endpoint-conditions:
- weight: 0
  condition: global.has-general-service-role
  handlerRegex: (.*)
- weight: 1
  condition: global.has-kubernetes-endpoints-service-role
  handlerRegex: kubernetes\.\w+
- weight: 2
  condition: global.has-auth-service-role
  handlerRegex: api-key\.\w+
x-tagGroups:
- name: Pipelines / Builds
  tags:
  - Annotations
  - Builds
  - Execution Contexts
  - Images
  - Pipelines
  - Progress
  - Projects
  - Step-types
  - Triggers
  - Triggers Events
  - Triggers Types
- name: Kubernetes / Helm
  tags:
  - Environments V2
  - Helm Boards
  - Helm Charts
  - Helm Releases
  - Helm Sections
  - Kubernetes
- name: Swarm
  tags:
  - Compositions
  - Environments
- name: Integrations / Contexts
  tags:
  - Clusters
  - Contexts
  - Helm Cluster Configs
  - Helm Repos
  - Registries
  - Repos
- name: Account Management
  tags:
  - Abac
  - Accounts
  - Agents
  - Audit
  - Runtime Environments
  - Teams
  - Tokens
  - Views
- name: User Properties
  tags:
  - favorites
- name: On-Premise
  tags:
  - Features
  - Runtime Environments (Account)
  - Runtime Environments (Plan)
  - Runtime Environments (System)
  - Runtime Environments.
- name: Platform Analytics
  tags:


# --- truncated at 32 KB (135 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/codefresh/refs/heads/main/openapi/codefresh-environments-api-openapi.yml