CloudTruth Documentation
Sign InAPIIntegrationsGitHubVisit our website
  • Overview
  • Getting Started
  • Architecture
    • 🔒Security Overview
  • Copilot
  • 🏢Org management
    • Account Setup
    • Access Control
      • 🔑API Tokens
      • 🌐Protecting Projects and Environments
      • 👥Users
    • Audit Log
  • 🛠️Config Management
    • Projects
    • Parameters
      • Sharing Config Data
      • Parameter Management
        • Internal Values
          • Dynamic Values
        • External Values
          • Terraform Remote State Files
        • Parameter Override
        • Environment Value Override
      • Parameter and Parameter Value Inheritance
      • Value Comparison
      • Value History
      • Value Validation
      • Value Expiration
    • Environments and Tags
    • Templates
      • 📒Sample Templates
    • Actions
      • Import Actions
      • Push Actions
    • CLI & API
      • CloudTruth CLI
      • Rest API
    • Integrations
      • Argo CD
      • Atlassian Compass
      • AWS
        • AWS Connection
        • AWS Role
          • CloudFormation
          • Terrraform
          • AWS Console
        • Parameter Store (SSM)
        • S3
        • Secrets Manager
      • Azure Key Vault
      • Bitbucket Pipelines
      • Docker
      • Docker Compose
      • GitHub
      • GitHub Actions
      • GitLab
      • Harness
      • Jenkins
      • Kubernetes
      • Pulumi
      • Terraform
      • Terragrunt
      • Explorer
      • Circle CI
    • Events, Notifications, Webhooks
    • Types
  • 🔎REPORTING
    • Compare
    • History
    • Expirations
  • 🚀PRODUCT
    • What is CloudTruth?
    • Interactive Demo
    • Kubernetes
    • Terraform
    • CI/CD Pipeline Configuration
    • Cloud CMDB
    • Secrets Management
    • GitOps
    • Our Manifesto
    • Open Source
    • FAQs
    • Our Mission
  • 📚Reference
    • 🎓Quick Start Videos
      • What is CloudTruth?
      • CloudTruth in Action
      • Environments and Projects
      • Secrets, Parameters, ENV variables
      • Audit Logs, RBAC, SSO
      • Containers - Kubernetes, Docker
      • Infrastructure as Code (IaC) - Terraform, Cloudformation, CDK, Azure Bicep, Pulumi
      • CICD Pipelines - GitHub Actions, ArgoCD, Jenkins, CircleCI, Harness, GitLab Pipelines
      • AWS Videos - Secret Manager, Parameter Store, S3, IAM
      • Azure Videos - Azure DevOps, Azure Bicep, PowerShell
    • Knowledge Base
      • Best Practices
        • Versioned Releases
      • CLI
        • History comparison of deleted parameters with null values
      • Integrations
        • Advanced AWS IAM policy permissions
        • K8s pull image from private Docker registry
        • S3 Region Selection
      • Templates
        • Templates render quotations in key values as quot
    • Roadmap and New Features
    • JMESPath Reference
    • REST API
Powered by GitBook

Copyright© 2023 CloudTruth

On this page
  • Introduction
  • Overview
  • Getting Started
  • environments_list

Was this helpful?

  1. Config Management
  2. CLI & API

Rest API

Introduction to the CloudTruth API

PreviousCloudTruth CLINextIntegrations

Last updated 1 year ago

Was this helpful?

Introduction

Does CloudTruth have an API? Of course we do!

The CloudTruth API is the same API used by our SaaS offering. Anything that you can do in our GUI, you can do programmatically via the API.

Overview

The CloudTruth API is a pretty standard RESTful-like HTTP API. You perform GET, PUT, POST, PATCH and DELETE operations models hosted by our web service. Operations require a JWT or in the Authorization header of the call. Parameters are passed to the web service via JSON in the body of the request. Results are returned as JSON structures in the body of the response.

Our complete REST API documentation is automatically generated and can be found here:

We also provide an interactive web interface to the API:

Getting Started

environments_list

GET https://api.cloudtruth.io/api/v1/environments/

Lists CloudTruth Environments

Query Parameters

Name
Type
Description

name

string

page

integer

A page number within the paginated result set,

page_size

string

Number of results to return per page.

parent__name

string

{
    "count": 4,
    "next": null,
    "previous": null,
    "results": [
        {
            "created_at": "2021-07-19T19:22:44.689825Z",
            "description": "The auto-generated default environment.",
            "id": "ad34ea7d-c9cb-473e-93fb-06dc468cacd7",
            "modified_at": "2021-08-02T19:17:28.920832Z",
            "name": "default",
            "parent": null,
            "url": "https://api.cloudtruth.io/api/v1/environments/ad34ea7d-c9cb-473e-93fb-06dc468cacd7/"
        }

Now you can issue a get request with your API Access token, here is a basic example in Python and Bash to get you going.

import requests

token = "Your API Access token"
headers = {'Authorization': f'Api-Key {token}'}
url = "https://api.cloudtruth.io/api/v1/environments/"
response = requests.get(url, headers=headers)
environments = response.json()
print(json.dumps(environments, indent=4, sort_keys=True))
token="Your API Access token"
curl -s --header "Content-Type: application/json" \
  --header "Authorization: Api-Key ${token}" \
  --request GET \
 https://api.cloudtruth.io/api/v1/environments/

You can checkout out our repo for a few additional working examples.

We will start you off with a basic example of a GET operation that will list your CloudTruth Environments. From the schema docs we can find the GET request query parameters and typical response.

🛠️
environment_list
API Access Token
CloudTruth Management API
CloudTruth Management API
GitHub - cloudtruth-demo/rest-api-examples: Demo RESTful API code that interacts with CloudTruthGitHub
Logo
Logo