Codifly
Product API

C4C7OPS Microservices API

OpenAPI reference for the C4C7OPS microservices API for technical integrations.

OpenAPI referencev0.2.3

microservices-api

# C4C7OPS Microservices API

Version: 0.2.3

Specification: OpenAPI 3.0

Base Path: /b1/microservices

The C4C7OPS Microservices API is a RESTful interface developed by Codifly for technical integrations with the C4C7OPS platform. It exposes endpoints to manage services, environments, deployments, environment variables, and runtime configuration across your Codifly account.

Capabilities

  • Services — Retrieve services filtered by category (microservice, frontend, app, etc.).
  • Environments — List all environments provisioned for the account (development, staging, production).
  • Deploys — Create deployments and query their step-by-step status.
  • Environment Variables — Read and write environment-level variables scoped to a microservice.
  • Runtime Settings — Read and write runtime configuration parameters without triggering a new deploy.

Authentication

Requests must include a valid Authorization: Bearer <token> header. Tokens are issued via OAuth 2.0 or API keys depending on environment configuration. Consult the security schemes in the OpenAPI contract for the exact scopes required per operation.

Environments

Each Codifly account can define multiple environments (e.g. development, staging, production). Use the correct base URL and credentials for the target environment. Never mix credentials across environments.

Rate Limits & Error Handling

  • Implement retries with exponential backoff for 5xx responses.
  • Validate every response against the OpenAPI schemas.
  • Log latency and error-rate metrics for observability.

Best Practices

  1. 1Test integrations in staging before promoting to production.
  2. 2Treat the OpenAPI contract version (0.2.3) as an immutable reference during your integration cycle.
  3. 3Rotate authentication tokens on a regular schedule.
  4. 4Keep environment variables and runtime settings under version control outside the API when possible.

Endpoints

9

Standard

OpenAPI

services

1 operations

Service listing by category

GET/b1/microservices/category/{service_category}

List services filtered by category

List Services by Category

Returns all services that belong to the specified service category.

When to Use

Use this endpoint to discover which services of a given type (e.g. microservice, frontend, app) are registered in your account.

Parameters

Table
NameInRequiredDescription
service_categorypathYesThe category to filter by. Accepted values include microservice, frontend, app, and others defined in your account.

Responses

  • `200 OK` — Returns an array of service objects matching the requested category.

Notes

  • The category values are case-sensitive; use the exact identifier returned by the platform.

Parameters

service_categorypath

Service category (microservice, frontend, app, etc.)

required

Responses

200Services for category

environments

1 operations

Environments

GET/b1/microservices/environment/

List all environments for the account

List Environments

Returns every environment provisioned for the authenticated account.

When to Use

Call this endpoint to enumerate available environments (e.g. development, staging, production) and obtain their IDs for use in subsequent operations.

Parameters

This endpoint takes no parameters.

Responses

  • `200 OK` — Returns a list of environment objects, each containing at least an id and a name.

Notes

  • Store the environment IDs locally; most deploy and configuration endpoints require environment_id as a path parameter.

Responses

200List environments for the account

deploys

3 operations

Deploy operations

POST/b1/microservices/ms/deploy

Create a new deployment

Create Deploy

Triggers a new deployment for a microservice.

When to Use

Use this endpoint to initiate a deploy after updating code, configuration, or environment variables.

Request Body (application/json)

Supply a JSON payload specifying the target microservice, environment, and any deploy options defined by the schema (e.g. image tag, commit reference).

JSONcopy
{
  "microservice_id": "string",
  "environment_id": "string"
}

Responses

  • `200 OK` — Deploy was created successfully. The response includes a deploy_id you can use to track progress.

Notes

  • After creation, poll GET /b1/microservices/ms/deploy/{deploy_id}/status to monitor the deploy lifecycle.
  • Ensure environment variables and runtime settings are configured before deploying.

Responses

200Deploy created
Request body: application/json
GET/b1/microservices/ms/deploy/{deploy_id}/status

Get deployment step status

Get Deploy Status

Returns a step-by-step status map for a specific deployment.

When to Use

Poll this endpoint after creating a deploy to track the progress of each stage (e.g. build, push, rollout).

Parameters

Table
NameInRequiredDescription
deploy_idpathYesThe unique identifier of the deployment.

Responses

  • `200 OK` — Returns a map of deploy step names to their current statuses (e.g. pending, running, succeeded, failed).

Notes

  • Implement polling with a reasonable interval (e.g. 5–15 seconds) to avoid rate-limiting.
  • A step marked as failed typically indicates a build or rollout error; check platform logs for details.

Parameters

deploy_idpath

Deploy id

required

Responses

200Deploy step status map
GET/b1/microservices/ms/{microservice_id}/environment/{environment_id}/deploys

List deploys for a microservice and environment

List Deploys

Returns the deployment history for a specific microservice in a specific environment.

When to Use

Use this endpoint to audit past deployments, compare versions, or find a deploy_id for status checks.

Parameters

Table
NameInRequiredDescription
microservice_idpathYesThe unique identifier of the microservice.
environment_idpathYesThe unique identifier of the environment.

Responses

  • `200 OK` — Returns a list of deploy objects, each including at least deploy_id, status, and timestamp.

Notes

  • Results are typically ordered by creation date (newest first).
  • Use this list to locate a deploy_id before calling GET /b1/microservices/ms/deploy/{deploy_id}/status.

Parameters

microservice_idpath

Microservice id

required
environment_idpath

Environment id

required

Responses

200List of deploys

env-vars

2 operations

Environment variables

PUT/b1/microservices/ms/envs

Create or update environment variables

Create or Update Environment Variables

Creates or updates environment variables for a microservice using a PUT (upsert) semantic.

When to Use

Call this endpoint when you need to set or modify environment-level variables (API keys, feature flags, connection strings, etc.) before or between deployments.

Request Body (application/json)

Provide a JSON object containing the variables to upsert. The exact schema is defined in the OpenAPI contract.

JSONcopy
{
  "microservice_id": "string",
  "environment_id": "string",
  "variables": {
    "KEY": "value"
  }
}

Responses

  • `200 OK` — Environment variables were saved successfully.

Notes

  • This operation performs an upsert: existing keys are overwritten, new keys are added.
  • Changes to environment variables typically require a new deploy to take effect at runtime.

Responses

200Environment variables saved
Request body: application/json
GET/b1/microservices/ms/{microservice_id}/environment/{environment_id}/envs

Get environment variables for a microservice

Get Environment Variables

Retrieves the environment variables configured for a specific microservice and environment.

When to Use

Call this endpoint to inspect current environment variables before updating them or to verify that a recent upsert was applied correctly.

Parameters

Table
NameInRequiredDescription
microservice_idpathYesThe unique identifier of the microservice.
environment_idpathYesThe unique identifier of the environment.

Responses

  • `200 OK` — Returns the environment variable key-value map for the specified scope.

Notes

  • Sensitive values (secrets, API keys) may be masked in the response depending on platform security policies.
  • Cross-reference with PUT /b1/microservices/ms/envs for the write counterpart.

Parameters

microservice_idpath

Microservice id

required
environment_idpath

Environment id

required

Responses

200Environment variables

runtime-settings

2 operations

Runtime settings

PUT/b1/microservices/ms/runtime-settings

Create or update runtime settings

Create or Update Runtime Settings

Creates or updates runtime configuration for a microservice without requiring a new deployment.

When to Use

Use this endpoint to adjust operational parameters (log levels, cache TTLs, feature toggles) that the service reads at runtime.

Request Body (application/json)

Provide a JSON payload with the settings to upsert. Refer to the OpenAPI schema for the full structure.

JSONcopy
{
  "microservice_id": "string",
  "environment_id": "string",
  "settings": {
    "log_level": "info"
  }
}

Responses

  • `200 OK` — Runtime settings were saved successfully.

Notes

  • Unlike environment variables, runtime settings are designed to be consumed without restarting the service, depending on your application architecture.
  • Validate the response against the OpenAPI schema to confirm persistence.

Responses

200Runtime settings saved
Request body: application/json
GET/b1/microservices/ms/{microservice_id}/environment/{environment_id}/settings

Get runtime settings for a microservice

Get Runtime Settings

Retrieves the runtime configuration for a specific microservice and environment.

When to Use

Call this endpoint to inspect the current runtime settings — such as log levels, cache configuration, or feature toggles — before updating them or to verify a recent change.

Parameters

Table
NameInRequiredDescription
microservice_idpathYesThe unique identifier of the microservice.
environment_idpathYesThe unique identifier of the environment.

Responses

  • `200 OK` — Returns the runtime settings object for the specified scope.

Notes

  • Runtime settings are distinct from environment variables and are designed to take effect without a redeploy.
  • Use PUT /b1/microservices/ms/runtime-settings as the write counterpart.

Parameters

microservice_idpath

Microservice id

required
environment_idpath

Environment id

required

Responses

200Runtime settings