Ownkube Environments API
The Environments API from Ownkube — 3 operation(s) for environments.
The Environments API from Ownkube — 3 operation(s) for environments.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
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.curl "https://apis.io/api/v1/apis/ownkube-io:ownkube-io-environments-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a 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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Ownkube CLI Environments API
version: 1.15.0
description: API for the Ownkube CLI tool. Authenticate via browser-based flow, then use x-api-key header for subsequent requests.
servers:
- url: /api/cli
security:
- apiKey: []
tags:
- name: Environments
paths:
/v1/environments:
get:
tags:
- Environments
summary: List environments in the current organization
description: Default `Development` and `Production` environments are auto-seeded for orgs that have none yet, so this endpoint always returns at least two rows.
security:
- apiKey: []
responses:
'200':
description: Environments
content:
application/json:
schema:
$ref: '#/components/schemas/EnvironmentListResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Invalid or missing API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'412':
description: Precondition failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limited; retry after the Retry-After header's seconds
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
operationId: getV1Environments
x-operation-id-source: derived
post:
tags:
- Environments
summary: Create an environment
security:
- apiKey: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateEnvironmentBody'
responses:
'200':
description: Created environment
content:
application/json:
schema:
$ref: '#/components/schemas/Environment'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Invalid or missing API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'412':
description: Precondition failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limited; retry after the Retry-After header's seconds
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
operationId: postV1Environments
x-operation-id-source: derived
/v1/environments/{environmentId}:
get:
tags:
- Environments
summary: Get an environment by ID
security:
- apiKey: []
parameters:
- schema:
type: string
description: The environment id.
required: true
description: The environment id.
name: environmentId
in: path
responses:
'200':
description: Environment
content:
application/json:
schema:
$ref: '#/components/schemas/Environment'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Invalid or missing API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'412':
description: Precondition failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limited; retry after the Retry-After header's seconds
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
operationId: getV1EnvironmentsByEnvironmentId
x-operation-id-source: derived
patch:
tags:
- Environments
summary: Update an environment's name, color, or description
security:
- apiKey: []
parameters:
- schema:
type: string
description: The environment id.
required: true
description: The environment id.
name: environmentId
in: path
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateEnvironmentBody'
responses:
'200':
description: Updated environment
content:
application/json:
schema:
$ref: '#/components/schemas/Environment'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Invalid or missing API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'412':
description: Precondition failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limited; retry after the Retry-After header's seconds
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
operationId: patchV1EnvironmentsByEnvironmentId
x-operation-id-source: derived
delete:
tags:
- Environments
summary: Delete an environment
description: Soft-deletes the environment. Blocked with `412` if any deployments still reference it.
security:
- apiKey: []
parameters:
- schema:
type: string
description: The environment id.
required: true
description: The environment id.
name: environmentId
in: path
responses:
'200':
description: Deleted
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteEnvironmentResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Invalid or missing API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'412':
description: Precondition failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limited; retry after the Retry-After header's seconds
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
operationId: deleteV1EnvironmentsByEnvironmentId
x-operation-id-source: derived
/v1/environments/{environmentId}/env:
put:
tags:
- Environments
summary: Replace an environment's shared env vars
description: Replaces the environment's shared env-var set and redeploys every cluster-bound app that inherits them so the change takes effect immediately.
security:
- apiKey: []
parameters:
- schema:
type: string
description: The environment id.
required: true
description: The environment id.
name: environmentId
in: path
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SetEnvVarsBody'
responses:
'200':
description: Env vars applied
content:
application/json:
schema:
$ref: '#/components/schemas/SetEnvVarsResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Invalid or missing API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'412':
description: Precondition failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limited; retry after the Retry-After header's seconds
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
operationId: putV1EnvironmentsByEnvironmentIdEnv
x-operation-id-source: derived
components:
schemas:
EnvVarInput:
type: object
properties:
name:
type: string
minLength: 1
example: DATABASE_URL
description: The variable name (e.g. DATABASE_URL).
secret:
type: boolean
description: Mark as secret so the value is never returned on reads. Echo a saved secret back with an empty `value` to keep the previous value.
value:
type: string
description: 'The variable value. For secrets: reads blank secret values, so a secret you read back arrives with an empty value. Sending that empty value here KEEPS the previously saved secret (empty is the passthrough sentinel) rather than clearing it. To genuinely clear a secret, drop the variable from the set entirely; to change it, send the new plaintext.'
required:
- name
- value
SetEnvVarsBody:
type: object
properties:
env:
type: array
items:
$ref: '#/components/schemas/EnvVarInput'
description: The full shared env-var set for the environment (replaces the existing set). Every cluster-bound app in the environment is redeployed to apply it.
required:
- env
ErrorResponse:
type: object
properties:
error:
type: string
description: Human-readable error message
code:
type: string
description: Machine-readable error code
required:
- error
- code
SetEnvVarsResponse:
type: object
properties:
env:
type: array
items:
$ref: '#/components/schemas/EnvVarInput'
redeployed:
type: number
failed:
type: number
required:
- env
- redeployed
- failed
EnvironmentListResponse:
type: object
properties:
environments:
type: array
items:
$ref: '#/components/schemas/Environment'
required:
- environments
DeleteEnvironmentResponse:
type: object
properties:
success:
type: boolean
required:
- success
Environment:
type: object
properties:
id:
type: string
projectId:
type: string
nullable: true
name:
type: string
slug:
type: string
description:
type: string
nullable: true
color:
type: string
nullable: true
env:
type: array
items:
type: object
properties:
name:
type: string
value:
type: string
secret:
type: boolean
required:
- name
- value
isDefault:
type: boolean
deploymentCount:
type: number
createdAt:
anyOf:
- type: string
- type: string
format: date-time
updatedAt:
anyOf:
- type: string
- type: string
format: date-time
required:
- id
- name
- slug
CreateEnvironmentBody:
type: object
properties:
projectId:
type: string
description: Owning project. Omit to use the organization's default project.
name:
type: string
minLength: 1
maxLength: 50
example: Staging
description: Display name.
slug:
type: string
minLength: 1
maxLength: 30
pattern: ^[a-z][a-z0-9-]*$
example: staging
description: Lowercase, starts with a letter; letters, numbers, hyphens only.
color:
type: string
enum:
- amber
- green
- blue
- purple
- red
description: Accent color. Defaults to `blue`.
description:
type: string
maxLength: 200
description: Optional note.
required:
- name
- slug
UpdateEnvironmentBody:
type: object
properties:
name:
type: string
minLength: 1
maxLength: 50
description: New display name.
color:
type: string
enum:
- amber
- green
- blue
- purple
- red
description: New accent color.
description:
type: string
maxLength: 200
description: New description.
securitySchemes:
apiKey:
type: apiKey
in: header
name: x-api-key
description: API key issued by the browser-based CLI authorization flow.