# Cloud 66 API Documentation — Full Content > The Cloud 66 API lets you build, deploy, and scale applications on your own servers. It is a RESTful, resource-oriented API that uses standard HTTP verbs and returns JSON for all responses, including errors. Authentication uses OAuth 2.0 with scoped access, and the API is rate limited to 3,000 requests per user per hour. This file contains the full text of the current (v3) Cloud 66 API documentation, concatenated for language model ingestion. It follows the llms.txt convention (https://llmstxt.org). A concise link index is available at /llms.txt. ## Introduction URL: https://developers.cloud66.com/v3/ ## Welcome [Cloud 66](https://www.cloud66.com) gives you everything you need to build, deploy and scale your applications on your servers. This site will guide you through the process of getting started with Cloud 66 API. If you haven't already, you can sign up for a free account at [Cloud 66](https://www.cloud66.com). ## Resource Model The Cloud 66 API is organised around [REST](https://en.wikipedia.org/wiki/Representational_State_Transfer). It is designed to have predictable, resource-oriented URLs and to use HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which can be understood by off-the-shelf HTTP clients. [JSON](https://www.json.org/) will be returned in all responses from the API, including errors (though if you're using API bindings, we will convert the response to the appropriate language-specific object). ## Rate Limiting The Cloud 66 API can receive a maximum of 3,000 requests per user per hour. When the request level reaches the maximum rate, subsequent requests will return a `503: throttled` HTTP status message and the user must retry the request in the next hourly interval. ## Stack UID Retrieval Many requests in the Cloud 66 API rely on the Stack UID value, an alphanumeric string that uniquely identifies your stack. You can retrieve this value by accessing the _Stack information_ page from the right sidebar of your stack page or by submitting an API request to list all stacks. The Stack UID appears in the response body for each stack you maintain. ## Date Formats Cloud 66 accepts and returns date values according to the ISO 8601 standard. Combined date and time values appear in UTC including local time zone offsets. For example: `2014-06-15T14:13:18+00:00` --- ## Authentication URL: https://developers.cloud66.com/v3/getting-started/authentication/ # Authentication Cloud 66 uses [OAuth2](https://oauth.net/2/) to authenticate users and grant access to stacks and redeployments. To use it, you need an OAuth 2.0 compatible client. To submit API requests, you must pass an OAuth token. An OAuth token functions as a complete authentication request, acting as a substitute for a username and password pair. Because of this, it is absolutely essential that you keep your OAuth tokens secure. To authenticate your requests with OAuth you need to send a bearer authorization header with your request. This is the preferred method of authenticating because it completes the authorization request in the header portion, away from the actual request. Usually, you use a language binding (like a [Ruby gem](https://rubygems.org/) or [Go package](https://golang.org/pkg/)) to deal with the OAuth authentication. Alternatively, you can include the OAuth authentication token in the header of each request: `Authorization: bearer 5262d64b892e8d4341000001` You can generate an OAuth token by visiting the [Apps](https://app.cloud66.com/oauth/authorized_applications) , under your Account. ## How to authenticate with OAuth2 You can generate an OAuth token using the Your Account > [Apps](https://app.cloud66.com/oauth/authorized_applications) area of the Cloud 66 user interface or using the API. **Step 1 - Redirect users to request Cloud 66 access** `GET https://app.cloud66.com/oauth/authorize` | Parameter | Description | Presence | |--------------|---------------------------------------------------------------|--------------| | client_id | The client ID you received from Cloud 66 when you registered. | **required** | | redirect_url | URL in your app where users will be sent after authorization. | **required** | | scope | Comma separated list of scopes. | optional | **Step 2 - Cloud 66 redirects back to your site** If the user accepts your request, Cloud 66 redirects back to your site with a temporary code in a code parameter as well as the state you provided in the previous step in a state parameter. If the states don't match, the request has been created by a third party and the process should be aborted. Exchange this for an access token: `POST https://app.cloud66.com/oauth/token` | Parameter | Description | Presence | |---------------|-------------------------------------------------------------------|--------------| | client_id | The client ID you received from Cloud 66 when you registered. | **required** | | redirect_url | URL in your app where users will be sent after authorization. | optional | | client_secret | The client secret you received from Cloud 66 when you registered. | **required** | **Response** By default, the response will take the following form: ``` access_token=e72e16c7e42f292c6912e7710c838347ae178b4a&token_type=bearer ``` **Response (JSON format):** ```json { "access_token": "e72e16c7e42f292c6912e7710c838347ae178b4a", "token_type": "bearer" } ``` **Step 3 - Use the access token to access the API** The access token allows you to make requests to the API on behalf of a user. `GET "https://app.cloud66.com/api/3/stacks.json" -H "Authorization: Bearer e72e...b4a"` --- ## Scoped Access URL: https://developers.cloud66.com/v3/getting-started/scoped-access/ # Scoped Access A user's scope defines the limits of the actions the user can perform with the Cloud 66 API. The user's scope is encrypted as part of the OAuth access token. Users cannot submit requests not allowed by their defined scopes. For the web flow, requested scopes be displayed to the user on the authorize form. | Scope | Description | |------------|--------------------------------------------------------------------------------------------| | no scope | Users with this scope have public read-only access and can view limited stack information. | | `public` | Users with this scope have public read-only access and can view limited stack information. | | `redeploy` | Users with this scope can redeploy any stacks they can access. | | `jobs` | Users with this scope can view the scheduled jobs for the stacks they can access. | | `users` | Users with this scope can manage other users' mobile devices. | | `admin` | Users with this scope can set and manage settings for the servers they can access. | Your application can request scopes in the initial redirection. You can specify multiple scopes by separating them with a space character: `https://app.cloud66.com/oauth/authorize?client_id=...&scope=public+redeploy` --- ## Synchronous vs Asynchronous Requests URL: https://developers.cloud66.com/v3/getting-started/synchronous-vs-asynchronous/ # Synchronous vs Asynchronous Requests The Cloud 66 API uses both synchronous and asynchronous methods. Asynchronous methods are specified in the documentation for the associated calls; all others are generally considered synchronous. **Synchronous** methods will wait for the server to return a response for the request before it will continue processing. Your application will not perform any additional actions until it receives a response from the server. **Asynchronous** methods will submit the request to the server, but the application will not wait for a response from the server to continue processing. When the server returns a response, the application can execute a callback function to retrieve the response object, but will continue processing until the response is received. ```ruby #Asynchronous example stack_id = 'a6b583684833a2cf4845079c9d9350a8' response = token.post("#{api_url}/stacks/#{stack_id}/actions.json", {body: {:command => 'clear_caches'}}) #Get the action ID id = JSON.parse(response.body)['response']['id'] puts "Started action with ID: #{id}" ... #After some time check status response = token.get("#{api_url}/stacks/#{stack_id}/actions/#{id}.json") result = JSON.parse(response.body)['response'] #Check if the request finished successfully if result['finished_success'] == true puts 'Success!' else puts "Failed. Error: #{result['finished_message']}" end ``` --- ## Standard HTTP Response Statuses URL: https://developers.cloud66.com/v3/getting-started/http-response-statuses/ # Standard HTTP Response Statuses Requests made using the Cloud 66 API can return any of the following response status codes. --- ## Supported Cloud Regions URL: https://developers.cloud66.com/v3/getting-started/cloud-regions/ # Cloud Regions This is a list of supported cloud regions for deploying applications in the API. --- ## Supported Cloud Server Sizes URL: https://developers.cloud66.com/v3/getting-started/cloud-server-sizes/ # Cloud Server Sizes This is a list of supported cloud server sizes for deploying applications in the API. --- ## Webhooks URL: https://developers.cloud66.com/v3/getting-started/webhooks/ # Webhooks Webhooks are HTTP callbacks that Cloud66 sends to your specified endpoints when certain events occur in your infrastructure. They provide a real-time way to receive notifications about important changes to your stacks, servers, deployments, and other resources. ## How Webhooks Work When a subscribed event occurs (such as a deployment completion or server issue), Cloud66 sends an HTTP POST request to your configured webhook URL with a JSON payload containing details about the event. ### HTTP Delivery Specifications - **Method**: POST with `application/json` content-type - **Timeout**: 30 seconds (configurable) - **SSL**: HTTPS is supported with verification disabled - **Authentication**: No authentication headers are automatically included - implement endpoint-level authentication as needed - **Retry Logic**: Failed deliveries are logged but **not retried automatically** Webhook deliveries that fail are not automatically retried. Ensure your webhook endpoints are highly available and implement proper error handling. ### Example Stack Event Payload ```json { "timestamp": 1640995200, "event_type": "stack.provision.ok", "uid": "abc123def456", "name": "My Application", "git": "https://github.com/user/repo.git", "git_branch": "master", "environment": "production", "cloud": "aws", "fqdn": "my-app.c66.me", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "created_at": "2024-01-01T10:00:00Z", "updated_at": "2024-01-01T12:30:45Z", "deploy_context": { "triggered_by": "user@example.com", "outcome": "success", "started_at": "2024-01-01T12:00:00Z", "finished_at": "2024-01-01T12:30:45Z" } } ``` ## Available Event Types Cloud66 webhooks cover 58+ different event types organized into these categories: ### Stack Events | Event Type | Description | |------------|-------------| | `stack.created` | New stack has been created | | `stack.provision.ok` | Stack provisioning completed successfully | | `stack.provision.fail` | Stack provisioning failed | | `stack.redeploy.ok` | Stack redeployment completed successfully | | `stack.redeploy.fail` | Stack redeployment failed | | `stack.deploy.started` | Stack deployment has started | | `application.update.succeeded` | Application update completed successfully | | `application.update.failed` | Application update failed | | `application.health_check.failed` | Application health check failed | ### Infrastructure Events | Event Type | Description | |------------|-------------| | `server.stopped` | Server has stopped responding | | `server.backon` | Server is back online | | `container.down` | Container is down or not responding | | `process.down` | Process is down or not responding | | `web.process.started` | Web process has started | | `web.process.stopped` | Web process has stopped | | `free.disk.space.alert` | Disk space is running low | | `free.disk.space.normal` | Disk space has returned to normal | ### Security Events | Event Type | Description | |------------|-------------| | `ssl_certificate.install.ok` | SSL certificate installed successfully | | `ssl_certificate.install.fail` | SSL certificate installation failed | | `ssl_certificate.expire.soon` | SSL certificate is expiring soon | | `active.protect.block` | ActiveProtect blocked an IP address | | `active.protect.change` | ActiveProtect detected file changes | | `ssh_key.downloaded` | SSH key was downloaded | ### Other Event Categories - **Build & Service Events**: Service builds and cloud resource operations - **Database & Backup Events**: Backup operations and database replication - **Account & Billing Events**: Payment processing and account status changes - **Job & Automation Events**: Scheduled jobs and autoscaling operations ## Setting Up Webhooks ### 1. Create Your Webhook Endpoint Your webhook endpoint should accept HTTP POST requests with JSON payloads: ```javascript // Node.js/Express example const express = require('express'); const app = express(); app.use(express.json()); app.post('/webhooks/cloud66', (req, res) => { const webhook = req.body; // Validate webhook if (!webhook.timestamp || !webhook.event_type) { return res.status(400).send('Invalid webhook payload'); } // Process webhook based on event type switch (webhook.event_type) { case 'stack.provision.ok': console.log(`Stack ${webhook.name} provisioned successfully`); break; case 'server.stopped': console.log(`Server ${webhook.name} is down - investigate immediately`); break; default: console.log(`Received ${webhook.event_type} event`); } // Respond with 200 to acknowledge receipt res.status(200).send('OK'); }); app.listen(3000, () => { console.log('Webhook server running on port 3000'); }); ``` ### 2. Configure Webhook Subscriptions Use the [Stack Alerts API](/v3/endpoints/stack-alerts) to configure webhooks for stack-level events: ```bash curl -X PUT "https://app.cloud66.com/api/3/stacks/{stack_id}/alerts" \ -H "Authorization: Bearer {api_token}" \ -H "Content-Type: application/json" \ -d '{ "alerts": { "deployment_success": { "channels": [ { "type": "webhook", "enabled": true, "webhook_url": "https://your-domain.com/webhooks/cloud66" } ], "active": true }, "server_down": { "channels": [ { "type": "webhook", "enabled": true, "webhook_url": "https://your-domain.com/webhooks/cloud66" } ], "active": true } } }' ``` For multiple stacks, use [Application Groups](/v3/endpoints/application-groups): ```bash curl -X PUT "https://app.cloud66.com/api/3/application_groups/{group_id}/alerts" \ -H "Authorization: Bearer {api_token}" \ -H "Content-Type: application/json" \ -d '{ "alerts": { "deployment_success": { "channels": [ { "type": "webhook", "enabled": true, "webhook_url": "https://your-domain.com/webhooks/deployments" } ], "active": true } } }' ``` ## Production Best Practices ### Security & Reliability ```javascript function verifyWebhook(req) { // Verify HTTPS if (req.protocol !== 'https') { throw new Error('Webhooks must use HTTPS'); } // Verify payload structure const webhook = req.body; if (!webhook.timestamp || !webhook.event_type) { throw new Error('Invalid webhook structure'); } // Verify webhook age (prevent replay attacks) const age = Date.now() - (webhook.timestamp * 1000); if (age > 300000) { // 5 minutes throw new Error('Webhook too old'); } return true; } ``` ### Error Handling ```javascript app.post('/webhooks/cloud66', async (req, res) => { try { verifyWebhook(req); await processWebhook(req.body); res.status(200).send('OK'); } catch (error) { console.error('Webhook processing error:', error); // Return appropriate status codes if (error.message.includes('Invalid')) { res.status(400).send('Bad Request'); } else { res.status(500).send('Internal Server Error'); } } }); ``` ## Testing Webhooks Before configuring webhooks, verify your endpoint is accessible: ```bash # Test your webhook endpoint curl -X POST "https://your-domain.com/webhooks/cloud66" \ -H "Content-Type: application/json" \ -d '{ "timestamp": 1640995200, "event_type": "test.webhook", "message": "Test webhook payload" }' ``` ## Troubleshooting ### Common Issues 1. **Webhook not received** - Verify endpoint URL is accessible from internet - Check firewall settings - Ensure endpoint responds within 30 seconds 2. **Invalid payload errors** - Verify Content-Type is application/json - Check JSON parsing in your endpoint - Validate required fields (timestamp, event_type) 3. **Duplicate webhooks** - Implement idempotency using timestamp + event_type - Store processed webhook IDs to avoid duplicates Webhooks are configured through the [Stack Alerts API](/v3/endpoints/stack-alerts) and [Application Group Alerts API](/v3/endpoints/application-groups). You can also manage webhook subscriptions programmatically using these endpoints. --- ## Examples URL: https://developers.cloud66.com/v3/getting-started/examples/ # Examples ## Ruby This example shows how to get the first token using the Application (Client) ID and Secret. This is using `urn:ietf:wg:oauth:2.0:oob` for command line tools. Once you have the code, you can apply for a token. Tokens issued by the API server do not expire and are valid until the user revokes their access. You can see how to store and retrieve the token for future use in this example. ```ruby require 'rubygems' require 'oauth2' require 'json' base = 'https://app.cloud66.com' api_url = 'https://app.cloud66.com/api/3' if File.exists? '/tmp/cloud66_oauth_test.json' config = JSON.parse(File.read('/tmp/cloud66_oauth_test.json')) client = OAuth2::Client.new(config['app_id'], config['app_secret'], :site => base) token = OAuth2::AccessToken.new(client, config['token']) else client = OAuth2::Client.new(ENV['APP_ID'], ENV['APP_SECRET'], :site => base) puts client.auth_code.authorize_url(:redirect_uri => 'urn:ietf:wg:oauth:2.0:oob', :scope => 'public admin redeploy') puts "Enter the code:" code = gets.strip token = client.auth_code.get_token(code, :redirect_uri => "urn:ietf:wg:oauth:2.0:oob") # save it File.write('/tmp/cloud66_oauth_test.json', { :app_id => ENV['APP_ID'], :app_secret => ENV['APP_SECRET'], :token => token.token }.to_json) end # Now you can use the token to call API methods, like: # List all the stacks response = token.get("#{api_url}/stacks.json") # list all the servers in the stack stack_uid = 'ENTER_STACK_UID' response = token.get("#{api_url}/stacks/#{stack_uid}/servers.json") # show the response (no error handling) puts JSON.parse(response.body)['response'] ``` ## cURL For example, you can get lists of stacks with this command: ```shell curl -X GET "https://app.cloud66.com/api/3/stacks.json" -H "Authorization: Bearer PERSONAL_ACCESS_TOKEN" ``` You can use your **personal access token** to call the API with cURL - it just needs to be passed in as a header. ```shell # Simple GET # Get list of stacks: curl -X GET "https://app.cloud66.com/api/3/stacks.json" -H "Authorization: Bearer 4c9c9b1111" # GET with some params # Get list of all `mysql` backups in `1345` backup group: curl -X GET "https://app.cloud66.com/api/3/stacks/f196c5b41758cb7977620d49eb1492ef/backups.json" -H "Authorization: Bearer 4c9c9b1111" -d group=1345 -d db_type=mysql # POST # Add a new iPhone application to user ID 18 with 'wertqy' as a token: curl -X POST "https://app.cloud66.com/api/3/users/18/devices.json" -H "Authorization: Bearer 4c9c9b1111" -d token=wertqy -d device_type=1 -d sub_type=1 # PUT # Update the type of device with token 'wertqy' to iPad: curl -X PUT "https://app.cloud66.com/api/3/users/18/devices/wertqy.json" -H "Authorization: Bearer 4c9c9b1111" -d device_type=1 -d sub_type=2 # DELETE # Delete device with token 'wertqy': curl -X DELETE "https://app.cloud66.com/api/3/users/18/devices/wertqy.json" -H "Authorization: Bearer 4c9c9b1111" ``` You can find your personal access token in your Cloud 66 Accounts page, under Authorized Applications. Assuming that your personal access token is `4c9c9b1111`, you can find some examples for using cURL. --- ## Get Account URL: https://developers.cloud66.com/v3/endpoints/accounts/#get Endpoint: GET /accounts/:id OAuth scope: users Retrieves detailed information for a specific account. This endpoint returns comprehensive details about a single account, including optional unmanaged server information when explicitly requested. **Related models:** Account The `unmanaged_servers` field is only populated when the `include_servers` parameter is set to true and only for your primary account. ### Parameters - `id` (integer, required) — The account ID - `include_servers` (boolean, optional) — Include unmanaged servers in the response (only available for your primary account) ### Response ```json { "response": { "id": 139, "owner": "test@cloud66.com", "created_at_iso": "2013-06-19T11:08:03Z", "updated_at_iso": "2014-02-20T12:55:58Z", "stack_count": 2, "used_clouds": ["digitalocean","rackspace"], "current_account": true, "friendly_name": "My Company Account", "unmanaged_servers": [ { "id": "i-0123456789abcdef0", "name": "unmanaged-server-1", "vendor": "aws" } ], "server_registration_script": "curl -sSL https://get.cloud66.com | bash", "configstore_namespace": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } } ``` --- ## List Accounts URL: https://developers.cloud66.com/v3/endpoints/accounts/#list Endpoint: GET /accounts OAuth scope: users Lists all accounts that the current authenticated user has access to. This endpoint returns a paginated list of accounts with their associated metadata, including stack counts, cloud providers used, and account status information. **Related models:** Account, Pagination ### Response ```json { "response": [ { "id": 139, "owner": "test@cloud66.com", "created_at_iso": "2013-06-19T11:08:03Z", "updated_at_iso": "2014-02-20T12:55:58Z", "stack_count": 2, "used_clouds": ["digitalocean","rackspace"], "current_account": true, "friendly_name": "My Company Account", "unmanaged_servers": null, "server_registration_script": "curl -sSL https://get.cloud66.com | bash", "configstore_namespace": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } ], "count":1, "pagination":{ "previous": null, "next": null, "current": 1, "per_page": 30, "count": 1, "pages": 1 } } ``` --- ## Generate OTP URL: https://developers.cloud66.com/v3/endpoints/accounts/#otp Endpoint: POST /accounts/otp OAuth scope: users Generates a one-time password (OTP) for client authentication. This endpoint creates a temporary authentication token that can be used by Cloud 66 clients for secure web access, exclusively for the calling user. The OTP has a limited lifespan and is intended for single-use authentication scenarios. **Related models:** Account The generated OTP can be used by Cloud 66 command-line tools and other clients to authenticate with the web dashboard. ### Response ```json { "response": { "ok": true, "otp": "abc123def456ghi789jkl012mno345pqr678stu901vwx234" } } ``` --- ## Update Application Group Alerts URL: https://developers.cloud66.com/v3/endpoints/application-groups/#update-alerts Endpoint: PATCH /application_groups/:application_group_name/notifications OAuth scope: admin Updates alert settings for an application group. Configures notification alerts for all stacks within the specified application group. This allows bulk management of alert settings across multiple related stacks. ## Alert Configuration Each alert configuration requires: - **alert_name**: The name of the alert to configure - **subscriptions**: Array of notification channel configurations ### Supported Channels - **email**: Basic email notifications - **slack**: Requires `slack_url` parameter with Slack webhook URL - **webhook**: Requires `webhook_url` parameter with your webhook endpoint - **browser**: In-browser notifications ## Response Structure The response contains three categories: - **successes**: Alerts successfully configured - **not_applicable**: Alerts that don't apply to stacks in this group - **failures**: Alerts that failed to configure **Related models:** Application Group, Stack, Alert Alert configurations applied to an application group will affect all stacks within that group. Individual stack alert settings may override application group settings. ### Parameters - `application_group_name` (string, optional) — Name of the application group - `alerts` (string, optional) — Array of alert configuration objects ### Request body ```json { "alerts": [ { "alert_name": "deployment_failed", "subscriptions": [ { "channel": "email" }, { "channel": "slack", "slack_url": "https://hooks.slack.com/services/..." }, { "channel": "webhook", "webhook_url": "https://your-webhook.example.com/alerts" }, { "channel": "browser" } ] } ] } ``` ### Response ```json { "successes": { "alerts": ["deployment_failed"], "count": 1 }, "not_applicable": { "alerts": [], "count": 0 }, "failures": { "alerts": [], "count": 0 } } ``` --- ## List Application Variants URL: https://developers.cloud66.com/v3/endpoints/application-variants/#list Endpoint: GET /stacks/:stack_id/application_variants OAuth scope: redeploy Returns all application variants (active, rollout, and preview) for the specified stack. Application variants enable advanced deployment strategies like blue-green deployments, canary releases, and preview environments. Each variant represents a different version of your application that can receive varying amounts of traffic. **Related models:** Application Variant, Stack **Variant Types:** - **Active**: The current production version receiving 100% traffic - **Canary**: A rollout variant receiving a percentage of traffic for testing - **Blue/Green**: A rollout variant for blue-green deployments - **Preview**: A preview environment for testing changes ### Parameters - `stack_id` (string, optional) — Stack UID ### Response ```json { "response": [ { "id": 123, "uid": "abc123def456", "variant_type": "active", "git_hash": "a1b2c3d4e5f6", "created_at": "2023-01-15T10:30:00Z", "percentage": 100 }, { "id": 124, "uid": "def456ghi789", "variant_type": "canary", "git_hash": "f6e5d4c3b2a1", "created_at": "2023-01-15T11:00:00Z", "percentage": 20 }, { "id": 125, "uid": "ghi789jkl012", "variant_type": "preview", "git_hash": "123456789abc", "created_at": "2023-01-15T12:00:00Z", "percentage": 0 } ] } ``` --- ## Update Rollout Variant URL: https://developers.cloud66.com/v3/endpoints/application-variants/#update Endpoint: PUT /stacks/:stack_id/application_variants/:id OAuth scope: redeploy Manages rollout variants by committing changes or adjusting canary percentages. Only applies to rollout variants (blue-green or canary deployments). Use this endpoint to either finalize a rollout by committing it as the new active version, or to adjust the traffic percentage for canary deployments. **Related models:** Application Variant, Stack **Operations:** - **commit**: Finalize the rollout variant (make it the active version) - **percentage**: Update canary traffic percentage (canary deployments only) **Examples:** - Commit a blue-green deployment: `PUT /stacks/:stack_id/application_variants/:id?operation=commit` - Update canary percentage: `PUT /stacks/:stack_id/application_variants/:id?operation=percentage&canary_percentage=50` ### Parameters - `stack_id` (string, optional) — Stack UID - `id` (string, optional) — Application variant UID - `operation` (string, optional) — Operation to perform - "commit" to finalize rollout or "percentage" to update canary traffic - `canary_percentage` (string, optional) — New traffic percentage (0-100) - required when operation=percentage ### Response ```json { "response": { "ok": true, "message": "Done" } } ``` --- ## Delete Preview Variant URL: https://developers.cloud66.com/v3/endpoints/application-variants/#delete Endpoint: DELETE /stacks/:stack_id/application_variants/:id OAuth scope: redeploy Permanently removes a preview variant from the system. This operation only applies to preview variants and cannot be undone. The variant management system will be updated to reflect the change and clean up associated resources. **Related models:** Application Variant, Stack Preview variants are used for testing changes in isolated environments before promoting them to production through rollout strategies. ### Parameters - `stack_id` (string, optional) — Stack UID - `id` (string, optional) — Preview variant UID to delete ### Response ```json { "response": { "ok": true, "message": "Done" } } ``` --- ## Get Backup URL: https://developers.cloud66.com/v3/endpoints/backups/#get Endpoint: GET /stacks/:stack_id/backups/:id OAuth scope: public Get information about a single backup. **Related models:** Backup ### Parameters - `stack_id` (string, required) — The stack UID - `id` (integer, required) — Backup ID ### Response ```json { "response": { "id":1, "server_uid":"e63e859d5ab72b0bcf14321f0ffb013d", "db_type":"mysql", "database_name":"shab-test-db", "file_base":"", "backup_date_iso":"2014-09-01T18:16:16Z", "backup_status":0, "backup_result":"", "restore_status":0, "restore_result":null, "created_at_iso":"2014-09-01T18:16:16Z", "updated_at_iso":"2014-09-01T18:16:16Z", "verify_status":0, "verify_result":null, "storage_path":"2aad2bb5a70e621ecf251fbd85af6927/backups/3c656a1bcc160769762763c6276c18b9/mysql/test_db_11/2014.09.01.18.16.14", "skip_tables":"", "backup_size":0 } } ``` --- ## Get Backup File URL: https://developers.cloud66.com/v3/endpoints/backups/#file-get Endpoint: GET /stacks/:stack_id/backups/:backup_id/files/:id OAuth scope: public Get the public URL to a backup file. **Related models:** Backup ### Parameters - `stack_id` (string, required) — The stack UID - `backup_id` (integer, required) — Backup ID - `id` (string, required) — The file ID ### Response ```json { "response": { "ok":true, "public_url":"https://c66-managed-backup-non-prod.s3.amazonaws.com/2aad2bb5a70e621ecf251fbd85af6927/backups/3c656a1bcc160769762763c6276c18b9/mysql/test_db_11/2014.09.01.18.16.14/test_db_11.tar?AWSAccessKeyId=AKIAIKCYITLQBEJDIETQ\u0026Expires=1409603570\u0026Signature=C2au7Jq%252F1m6uHGHRfGJPn%252F2GSS8%253D" } } ``` --- ## List Backup Files URL: https://developers.cloud66.com/v3/endpoints/backups/#files-list Endpoint: GET /stacks/:stack_id/backups/:backup_id/files OAuth scope: public Get list of all backup files of a stack. **Related models:** Backup, Pagination ### Parameters - `stack_id` (string, required) — The stack UID - `backup_id` (integer, required) — Backup ID ### Response ```json { "response":[ { "id":"tar", "name":"test_db_11.tar" } ], "count":1, "pagination": { "previous":null, "next":null, "current":1, "per_page":30, "count":1, "pages":1 } } ``` --- ## List Backups URL: https://developers.cloud66.com/v3/endpoints/backups/#list Endpoint: GET /stacks/:id/backups OAuth scope: public Get list of all backups of stack. **Related models:** Backup, Pagination ### Parameters - `id` (string, required) — The stack UID - `group` (integer, optional) — Backup group ID - `db_type` (string, optional) — Backup database type (valid options are: mysql, postgresql, redis, mongodb) ### Response ```json { "response":[ { "id":4, "server_uid":"e63e859d5ab72b0bcf14321f0ffb013d", "db_type":"mysql", "database_name":"test-db", "file_base":"", "backup_date_iso":"2014-09-01T19:00:33Z", "backup_status":0, "backup_result":"", "restore_status":0, "restore_result":null, "created_at_iso":"2014-09-01T19:00:33Z", "updated_at_iso":"2014-09-01T19:00:33Z", "verify_status":0, "verify_result":null, "storage_path":"2aad2bb5a70e621ecf251fbd85af6927/backups/3c656a1bcc160769762763c6276c18b9/mysql/test_db_11/2014.09.01.19.00.31", "skip_tables":"","backup_size":0 }, { "id":1, "server_uid":"e63e859d5ab72b0bcf14321f0ffb013d", "db_type":"mysql", "database_name":"test-db", "file_base":"", "backup_date_iso":"2014-09-01T18:16:16Z", "backup_status":0, "backup_result":"", "restore_status":0, "restore_result":null, "created_at_iso":"2014-09-01T18:16:16Z", "updated_at_iso":"2014-09-01T18:16:16Z", "verify_status":0, "verify_result":null, "storage_path":"2aad2bb5a70e621ecf251fbd85af6927/backups/3c656a1bcc160769762763c6276c18b9/mysql/test_db_11/2014.09.01.18.16.14", "skip_tables":"","backup_size":0 } ], "count":2, "pagination": { "previous":null, "next":null, "current":1, "per_page":30, "count":2, "pages":1 } } ``` --- ## Create Backup URL: https://developers.cloud66.com/v3/endpoints/backups/#create Endpoint: POST /stacks/:stack_id/backups OAuth scope: admin Create a new backup task. **Related models:** Backup ### Parameters - `stack_id` (string, required) — The stack UID - `db_type` (string, optional) — Comma separated list of Database types which need backup tasks (valid options: all, mysql, postgresql, redis, mongodb) - `frequency` (string, optional) — Frequency of backup task in cron schedule format - `keep_count` (integer, optional) — Number of previous backups to keep - `gzip` (boolean, optional) — Compress your backups with gzip - `excluded_tables` (string, optional) — Tables that must be excluded from the backup - `run_on_replica_server` (boolean, optional) — Run backup task on replica server if available ### Response ```json { "response": { "ok":true, "message":"queued for creation" } } ``` --- ## Import Backup URL: https://developers.cloud66.com/v3/endpoints/backups/#import Endpoint: POST /stacks/:stack_id/backups OAuth scope: admin Import an external backup. **Related models:** Backup ### Parameters - `stack_id` (string, required) — The stack UID - `group` (integer, required) — The group ID of backups that imported backup must restored in - `db_type` (string, required) — Comma separated list of Database types which need backup tasks (valid options: mysql, postgresql, redis, mongodb) - `remote_url` (string, required) — A URL to backup file to be imported ### Response ```json { "response": { "ok":true, "message":"Your external backup queued for upload" } } ``` --- ## Get Cloud URL: https://developers.cloud66.com/v3/endpoints/clouds/#get Endpoint: GET /clouds/:cloud_id OAuth scope: redeploy Retrieves details for a specific cloud provider, including available regions and server sizes for that provider. **Related models:** Cloud ### Parameters - `cloud_id` (string, required) — The cloud ID (name) ### Response ```json { "response": { "name": "digitalocean", "display_name": "DigitalOcean", "regions": [ { "id": "ams1", "name": "Amsterdam, Netherlands", "old_id": "2" }, { "id": "ams2", "name": "Amsterdam 2, Netherlands", "old_id": "5" }, { "id": "nyc1", "name": "New York 1, USA", "old_id": "1" } ], "server_sizes": [ { "id": "512mb", "name": "512MB / 1 CPU" }, { "id": "1gb", "name": "1GB / 1 CPU" }, { "id": "2gb", "name": "2GB / 1 CPU" } ] } } ``` --- ## List Clouds URL: https://developers.cloud66.com/v3/endpoints/clouds/#list Endpoint: GET /clouds OAuth scope: redeploy Retrieves a list of all supported cloud providers, including their available regions and server sizes. **Related models:** Cloud ### Response ```json { "response": [ { "name": "aws", "display_name": "AWS", "regions": [ { "id": "us-east-1", "name": "US East (Northern Virginia)" }, { "id": "us-west-1", "name": "US West (Northern California)" } ], "server_sizes": [ { "id": "t2.micro", "name": "General purpose (t2.micro)" }, { "id": "t2.small", "name": "General purpose (t2.small)" } ] }, { "name": "digitalocean", "display_name": "DigitalOcean", "regions": [ { "id": "ams1", "name": "Amsterdam, Netherlands", "old_id": "2" } ], "server_sizes": [ { "id": "512mb", "name": "512MB / 1 CPU" } ] } ] } ``` --- ## Get Cluster URL: https://developers.cloud66.com/v3/endpoints/clusters/#show Endpoint: GET /clusters/:id OAuth scope: public Returns comprehensive details about the specified Kubernetes cluster. Includes all associated metadata, node information, and related resources based on user permissions. Optionally includes cluster logs when requested. **Related models:** Cluster, Node ### Parameters - `id` (string, optional) — Cluster UID - `show_log` (string, optional) — Whether to show log in the response ### Response ```json { "response": { "id": 123, "uid": "5999b763474b0eafa5fafb64bff0ba80", "name": "Production Cluster", "environment": "production", "cloud": "AWS", "region": "us-east-1", "status": 1, "health": 3, "kubernetes_version": "1.28.2", "node_count": 5, "nodes": [ { "name": "node-1", "status": "Ready", "instance_type": "m5.large", "capacity": { "cpu": "2", "memory": "8Gi", "pods": "29" } } ], "created_at": "2023-01-15T10:30:00Z", "updated_at": "2023-01-15T11:00:00Z", "created_at_iso": "2023-01-15T10:30:00Z", "updated_at_iso": "2023-01-15T11:00:00Z" } } ``` --- ## List Clusters URL: https://developers.cloud66.com/v3/endpoints/clusters/#list Endpoint: GET /clusters OAuth scope: public Retrieves a paginated list of all Kubernetes clusters the user can access. Returns a paginated collection of cluster resources that the authenticated user has access to. Clusters represent managed Kubernetes environments for container orchestration. **Related models:** Cluster, Pagination ### Parameters - `page` (string, optional) — Page number for pagination (defaults to 1, minimum 1) ### Response ```json { "response": [ { "id": 123, "uid": "5999b763474b0eafa5fafb64bff0ba80", "name": "Production Cluster", "environment": "production", "cloud": "AWS", "status": 1, "health": 3, "kubernetes_version": "1.28.2", "node_count": 5, "created_at": "2023-01-15T10:30:00Z", "updated_at": "2023-01-15T11:00:00Z", "created_at_iso": "2023-01-15T10:30:00Z", "updated_at_iso": "2023-01-15T11:00:00Z" }, { "id": 124, "uid": "6000c874585c1fbfb6gbc75cgg1cb91", "name": "Staging Cluster", "environment": "staging", "cloud": "DigitalOcean", "status": 1, "health": 3, "kubernetes_version": "1.28.1", "node_count": 3, "created_at": "2023-01-10T14:20:00Z", "updated_at": "2023-01-10T15:00:00Z", "created_at_iso": "2023-01-10T14:20:00Z", "updated_at_iso": "2023-01-10T15:00:00Z" } ], "count": 2, "pagination": { "previous": null, "next": null, "current": 1, "per_page": 100, "count": 2, "pages": 1 } } ``` --- ## Create Cluster URL: https://developers.cloud66.com/v3/endpoints/clusters/#create Endpoint: POST /clusters OAuth scope: redeploy Creates a new Kubernetes cluster with the provided parameters. This endpoint is not yet implemented and will return a "Not implemented yet" error. Cluster creation functionality is planned for future releases. **Related models:** Cluster ### Response ```json { "response": { "message": "Not implemented yet", "status": "not_implemented" } } ``` --- ## Reboot Cluster Servers URL: https://developers.cloud66.com/v3/endpoints/clusters/#reboot-servers Endpoint: POST /clusters/:id/reboot_servers OAuth scope: admin Executes reboot operations on servers within the specified Kubernetes cluster. This operation is performed asynchronously and returns an async action object to track progress. Requires admin permissions on the cluster resource. **Related models:** Cluster, AsyncAction, Server The async action can be monitored using the [Get Stack Action](/v3/endpoints/stacks/action-get) endpoint to track the reboot progress. ### Parameters - `id` (string, optional) — Cluster UID - `strategy` (string, optional) — Reboot strategy (optional) - `group` (string, optional) — Server group to reboot (optional) ### Response ```json { "response": { "id": 789, "status": "queued", "action_type": "stack_reboot", "resource_type": "stack", "resource_id": 123, "started_via": "api", "started_at": null, "finished_at": null, "finished_success": null, "finished_message": null, "created_at": "2023-01-15T10:30:00Z", "updated_at": "2023-01-15T10:30:00Z" } } ``` --- ## Get Container URL: https://developers.cloud66.com/v3/endpoints/containers/#get Endpoint: GET /stacks/:stack_id/containers/:container_id OAuth scope: admin Get information of a container of the stack (includes container runtime information). **Related models:** Container ### Parameters - `stack_id` (string, required) — The stack UID - `container_id` (string, required) — The container UID ### Response ```json { "response": { "uid": "cba44fa6b6acf57fb0ef6c2ce385f6a129867df544dae7181d2410e9f9cc32bc", "server_uid": "c6014897b8c8e9f2fc204a3a9efdae05", "server_name": "Gazelle", "service_name": "web", "image": "quay.io/cloud66/sample-rails", "command": "bundle exec rackup -p 3000", "started_at": "2015-02-10T17:41:31Z", "ports": [ { "container": 3000, "http": 80, "https": 443 } ], "private_ip": "25.0.0.2", "docker_ip": null, "health_state": 1, "health_message": null, "health_source": "system", "capture_output": true, "restart_on_deploy": true, "created_at": "2015-02-10T17:41:37Z", "updated_at": "2015-02-17T14:40:17Z" } } ``` --- ## List Containers URL: https://developers.cloud66.com/v3/endpoints/containers/#list Endpoint: GET /stacks/:stack_id/containers OAuth scope: public Get a list of all the containers of the stack. **Related models:** Container, Pagination ### Parameters - `stack_id` (string, required) — The stack UID - `server_uid` (string, optional) — Server UID ### Response ```json { "response": [ { "uid": "cba44fa6b6acf57fb0ef6c2ce385f6a129867df544dae7181d2410e9f9cc32bc", "server_uid": "c6014897b8c8e9f2fc204a3a9efdae05", "server_name": "Gazelle", "service_name": "web", "image": "quay.io/cloud66/sample-rails", "command": "bundle exec rackup -p 3000", "started_at": "2015-02-10T17:41:31Z", "ports": [ { "container": 3000, "http": 80, "https": 443 } ], "private_ip": "25.0.0.2", "docker_ip": null, "health_state": 1, "health_message": null, "health_source": "system", "capture_output": true, "restart_on_deploy": true, "created_at": "2015-02-10T17:41:37Z", "updated_at": "2015-02-17T14:40:17Z" } ], "count": 1, "pagination": { "previous": null, "next": null, "current": 1, "per_page": 30, "count": 1, "pages": 1 } } ``` --- ## Stop Container URL: https://developers.cloud66.com/v3/endpoints/containers/#stop Endpoint: DELETE /stacks/:stack_id/containers/:container_id OAuth scope: admin Stop a container of the stack. **Related models:** Container ### Parameters - `stack_id` (string, required) — The stack UID - `container_id` (string, required) — The container UID ### Response ```json { "response": { "ok": true } } ``` --- ## List Database Users URL: https://developers.cloud66.com/v3/endpoints/database-users/#list Endpoint: GET /stacks/:stack_id/server_groups/:server_group_id/database_users OAuth scope: public Returns a paginated collection of database users associated with the specified server group. Optionally includes password information if the user has edit permissions and explicitly requests it via the `show_password` parameter. This endpoint triggers an asynchronous info retrieval operation to ensure database user information is current. **Related models:** Database User, Server Group, Pagination ### Parameters - `stack_id` (string, optional) — Stack ID - `server_group_id` (string, optional) — Server group ID - `page` (string, optional) — Page number for pagination (defaults to 1, minimum 1) - `show_password` (string, optional) — Include password in response (requires edit permissions) ### Response ```json { "response": [ { "uid": "user_abc123", "username": "app_user", "databases": ["app_production", "app_staging"], "user_type": "application", "created_at": "2023-01-15T10:30:00Z" }, { "uid": "user_def456", "username": "readonly_user", "databases": ["app_production"], "user_type": "readonly", "created_at": "2023-01-10T14:20:00Z" } ], "count": 2, "pagination": { "previous": null, "next": null, "current": 1, "per_page": 30, "count": 2, "pages": 1 } } ``` --- ## Create Database User URL: https://developers.cloud66.com/v3/endpoints/database-users/#create Endpoint: POST /stacks/:stack_id/server_groups/:server_group_id/database_users OAuth scope: admin Creates a new database user with the specified username and access to the selected databases. This operation is performed asynchronously and returns an async action object to track progress. The user will be created with a randomly generated secure password. Only works with server groups that support database operations. **Related models:** Database User, Database, Async Action, Server Group The async action can be monitored using the [Get Stack Action](/v3/endpoints/stacks/action-get) endpoint to track the creation progress. ### Parameters - `stack_id` (string, optional) — Stack ID - `server_group_id` (string, optional) — Server group ID - `username` (string, optional) — Database username to create - `database_ids` (string, optional) — Array of database UIDs to grant access to - `user_type` (string, optional) — User type - must be one of the supported types ### Request body ```json { "username": "new_app_user", "database_ids": ["db_abc123", "db_def456"], "user_type": "application" } ``` ### Response ```json { "response": { "id": 789, "status": "queued", "action_type": "database_user_create", "resource_type": "database_user", "resource_id": null, "started_via": "api", "started_at": null, "finished_at": null, "finished_success": null, "finished_message": null, "created_at": "2023-01-15T10:30:00Z", "updated_at": "2023-01-15T10:30:00Z" } } ``` --- ## Regenerate Database User Password URL: https://developers.cloud66.com/v3/endpoints/database-users/#regenerate-password Endpoint: POST /stacks/:stack_id/server_groups/:server_group_id/database_users/:id/regenerate_password OAuth scope: admin Changes the password for the specified database user. The new password is automatically generated and securely stored. This operation is performed asynchronously and returns an async action object to track progress. The new password will be available through the database user details once the operation completes. **Related models:** Database User, Async Action, Server Group The async action can be monitored using the [Get Stack Action](/v3/endpoints/stacks/action-get) endpoint to track the password regeneration progress. ### Parameters - `stack_id` (string, optional) — Stack ID - `server_group_id` (string, optional) — Server group ID - `id` (string, optional) — Database user UID ### Response ```json { "response": { "id": 791, "status": "queued", "action_type": "database_user_password_change", "resource_type": "database_user", "resource_id": "user_abc123", "started_via": "api", "started_at": null, "finished_at": null, "finished_success": null, "finished_message": null, "created_at": "2023-01-15T10:40:00Z", "updated_at": "2023-01-15T10:40:00Z" } } ``` --- ## Delete Database User URL: https://developers.cloud66.com/v3/endpoints/database-users/#delete Endpoint: DELETE /stacks/:stack_id/server_groups/:server_group_id/database_users/:id OAuth scope: admin Permanently removes the specified database user from all associated databases. This operation cannot be undone and will permanently remove the database user's access. The operation is performed asynchronously and returns an async action object to track progress. **Related models:** Database User, Async Action, Server Group The async action can be monitored using the [Get Stack Action](/v3/endpoints/stacks/action-get) endpoint to track the deletion progress. ### Parameters - `stack_id` (string, optional) — Stack ID - `server_group_id` (string, optional) — Server group ID - `id` (string, optional) — Database user UID ### Response ```json { "response": { "id": 790, "status": "queued", "action_type": "database_user_delete", "resource_type": "database_user", "resource_id": "user_abc123", "started_via": "api", "started_at": null, "finished_at": null, "finished_success": null, "finished_message": null, "created_at": "2023-01-15T10:35:00Z", "updated_at": "2023-01-15T10:35:00Z" } } ``` --- ## List Databases URL: https://developers.cloud66.com/v3/endpoints/databases/#list Endpoint: GET /stacks/:stack_id/server_groups/:server_group_id/databases OAuth scope: public Returns a paginated collection of databases associated with the specified server group. This endpoint triggers an asynchronous info retrieval operation to ensure database information is current before returning the results. Only works with server groups that support database operations. **Related models:** Database, Server Group, Pagination ### Parameters - `stack_id` (string, optional) — Stack ID - `server_group_id` (string, optional) — Server group ID - `page` (string, optional) — Page number for pagination (defaults to 1, minimum 1) ### Response ```json { "response": [ { "uid": "db_abc123", "name": "app_production", "charset": "utf8mb4", "collation": "utf8mb4_unicode_ci", "size_bytes": 104857600, "created_at": "2023-01-15T10:30:00Z", "users": ["app_user", "readonly_user"] }, { "uid": "db_def456", "name": "analytics_db", "charset": "utf8mb4", "collation": "utf8mb4_unicode_ci", "size_bytes": 52428800, "created_at": "2023-01-10T14:20:00Z", "users": ["analytics_user"] } ], "count": 2, "pagination": { "previous": null, "next": null, "current": 1, "per_page": 30, "count": 2, "pages": 1 } } ``` --- ## Create Database URL: https://developers.cloud66.com/v3/endpoints/databases/#create Endpoint: POST /stacks/:stack_id/server_groups/:server_group_id/databases OAuth scope: admin Creates a new database with the specified name and optionally assigns database users to it. This operation is performed asynchronously and returns an async action object to track progress. Only works with server groups that support database operations. **Related models:** Database, Database User, AsyncAction, Server Group The async action can be monitored using the [Get Stack Action](/v3/endpoints/stacks/action-get) endpoint to track the creation progress. ### Parameters - `stack_id` (string, optional) — Stack ID - `server_group_id` (string, optional) — Server group ID - `database_name` (string, optional) — Name for the new database - `database_user_ids` (string, optional) — Array of database user UIDs to grant access to the new database ### Request body ```json { "database_name": "new_app_db", "database_user_ids": ["user_abc123", "user_def456"] } ``` ### Response ```json { "response": { "id": 792, "status": "queued", "action_type": "database_create", "resource_type": "database", "resource_id": null, "started_via": "api", "started_at": null, "finished_at": null, "finished_success": null, "finished_message": null, "created_at": "2023-01-15T10:30:00Z", "updated_at": "2023-01-15T10:30:00Z" } } ``` --- ## Delete Database URL: https://developers.cloud66.com/v3/endpoints/databases/#delete Endpoint: DELETE /stacks/:stack_id/server_groups/:server_group_id/databases/:id OAuth scope: admin Permanently removes the specified database and all its data. This operation cannot be undone and will permanently delete all data in the database. The operation is performed asynchronously and returns an async action object to track progress. **Related models:** Database, AsyncAction, Server Group The async action can be monitored using the [Get Stack Action](/v3/endpoints/stacks/action-get) endpoint to track the deletion progress. ### Parameters - `stack_id` (string, optional) — Stack ID - `server_group_id` (string, optional) — Server group ID - `id` (string, optional) — Database UID ### Response ```json { "response": { "id": 793, "status": "queued", "action_type": "database_delete", "resource_type": "database", "resource_id": "db_abc123", "started_via": "api", "started_at": null, "finished_at": null, "finished_success": null, "finished_message": null, "created_at": "2023-01-15T10:35:00Z", "updated_at": "2023-01-15T10:35:00Z" } } ``` --- ## Get Deployment URL: https://developers.cloud66.com/v3/endpoints/deployments/#get Endpoint: GET /stacks/:stack_id/deployments/:deployment_id OAuth scope: public Get information of a single deployment. **Related models:** Deployment ### Parameters - `stack_id` (string, required) — The stack UID - `deployment_id` (integer, required) — The deployment ID ### Response ```json { "response": { "id": 107, "triggered_by": "test@cloud66.com", "triggered_via": { "code": 0, "meaning": "web" }, "started_at": "2014-08-29T17:46:16Z", "finished_at": "2014-08-29T17:58:23Z", "outcome": { "code": 1, "meaning": "success" }, "git_hash": "5675fcd8f9e6dc534ecf1410c0661c066097e310", "deploy_session": "OhBHNzkXSl", "deploy_type": { "code": 0, "meaning": "build" }, "is_head": true, "is_live": true, "reverted": null, "reverted_by": null, "reverted_at": null, "is_deploying": false, "commit_url": "https://github.com/cloud66-samples/rails-test/commit/5675fcd8f9e6dc534ecf1410c0661c066097e310" } } ``` --- ## List Deployments URL: https://developers.cloud66.com/v3/endpoints/deployments/#list Endpoint: GET /stacks/:stack_id/deployments OAuth scope: public Get list of all deployments of a stack. **Related models:** Deployment, Pagination ### Parameters - `stack_id` (string, required) — The stack UID ### Response ```json { "response": [ { "id": 107, "triggered_by": "test@cloud66.com", "triggered_via": { "code": 0, "meaning": "web" }, "started_at": "2014-08-29T17:46:16Z", "finished_at": "2014-08-29T17:58:23Z", "outcome": { "code": 1, "meaning": "success" }, "git_hash": "5675fcd8f9e6dc534ecf1410c0661c066097e310", "deploy_session": "OhBHNzkXSl", "deploy_type": { "code": 0, "meaning": "build" }, "is_head": true, "is_live": true, "reverted": null, "reverted_by": null, "reverted_at": null, "is_deploying": false, "commit_url": "https://github.com/cloud66-samples/rails-test/commit/5675fcd8f9e6dc534ecf1410c0661c066097e310" } ], "count": 1, "pagination": { "previous": null, "next": null, "current": 1, "per_page": 30, "count": 1, "pages": 1 } } ``` --- ## Redeploy Stack URL: https://developers.cloud66.com/v3/endpoints/deployments/#create Endpoint: POST /stacks/:stack_id/deployments OAuth scope: redeploy Redeploy a stack. **Related models:** Deployment ### Parameters - `stack_id` (string, required) — The stack UID - `git_ref` (string, optional) — Git reference (branch, tag or hash). Non-docker only. - `services` (string, optional) — Deploy only the service(s) & image(s) specified (Docker only). - `deployment_profile` (string, optional) — Deploy using a deployment profile - `user_reference` (string, optional) — Adds a value to the metadata field of the Stack Action (to allow you to match actions against your own identifiers). Max 255 chars. ### Response ```json { "response": { "id": 108, "message": "Deployment scheduled", "queued": true } } ``` --- ## Cancel Deployment URL: https://developers.cloud66.com/v3/endpoints/deployments/#cancel Endpoint: DELETE /stacks/:stack_id/deployments/:deployment_id OAuth scope: redeploy Cancel a deployment. **Related models:** Deployment ### Parameters - `stack_id` (string, required) — The stack UID - `deployment_id` (integer, required) — The deployment ID ### Response ```json { "response": { "ok": true, "message": "Deployment cancelled" } } ``` --- ## DNS Providers List URL: https://developers.cloud66.com/v3/endpoints/dns-providers/#list Endpoint: GET /dns_providers OAuth scope: admin You can use this method to query, add, delete or update DNS providers for SSL certificate management. **Related models:** DNS Provider, Pagination ### Response ```json { "response": [ { "uuid": "dp-fbe3d478cdc610b187b38c1d2b6b016b", "type": "Cloudflare", "key": "My Cloudflare", "display_name": "Cloudflare (My Cloudflare)", "created_at": "2023-01-25T14:08:28Z", "updated_at": "2023-01-25T14:08:28Z" } ], "count": 1, "pagination": { "previous": null, "next": null, "current": 1, "per_page": 30, "count": 1, "pages": 1 } } ``` --- ## List Elastic Addresses URL: https://developers.cloud66.com/v3/endpoints/elastic-addresses/#list Endpoint: GET /elastic_addresses OAuth scope: public Returns all elastic addresses (failover groups) that belong to the authenticated user's account. Elastic addresses provide high availability by allowing traffic to be switched between primary and secondary stacks during failures or maintenance operations. They are also known as failover groups. **Related models:** ElasticAddress, Stack **Key Features:** - **High Availability**: Automatic traffic switching during failures - **Maintenance Windows**: Manual switching for zero-downtime updates - **Multi-Cloud Support**: Works across different cloud providers - **Real-time Monitoring**: Status tracking for primary and secondary stacks ### Response ```json { "response": [ { "id": 123, "uid": "abc123def456", "address": "203.0.113.10", "primary_stack": "my-primary-stack", "secondary_stack": "my-backup-stack", "current_stack": "primary", "status": "active", "cloud": "AWS", "region": "us-east-1", "created_at": "2023-01-15T10:30:00Z", "updated_at": "2023-01-15T10:30:00Z" }, { "id": 124, "uid": "def456ghi789", "address": "203.0.113.20", "primary_stack": "app-prod-cluster", "secondary_stack": "app-backup-cluster", "current_stack": "secondary", "status": "active", "cloud": "DigitalOcean", "region": "nyc3", "created_at": "2023-01-10T14:20:00Z", "updated_at": "2023-01-12T09:15:00Z" } ] } ``` --- ## Create Elastic Address URL: https://developers.cloud66.com/v3/endpoints/elastic-addresses/#create Endpoint: POST /elastic_addresses OAuth scope: admin Creates a new elastic address (failover group) that provides high availability by allowing traffic to be switched between primary and secondary stacks. Both stacks must support failover groups and you must have appropriate permissions on both stacks. The stacks cannot be the same and must have DNS configurations. Stacks must not be cluster or prepress type and must have head DNS present to be used in failover groups. **Related models:** ElasticAddress, Stack **Validation Rules:** - Primary and secondary stacks must be different - You must have failover group edit permissions on both stacks - Stacks must support failover group functionality - Stacks cannot be cluster or prepress type ### Parameters - `primary_stack_uid` (string, optional) — UID of the primary stack for the failover group - `secondary_stack_uid` (string, optional) — UID of the secondary/backup stack for the failover group - `current_stack` (string, optional) — Which stack is currently active ("primary" or "secondary") ### Request body ```json { "primary_stack_uid": "stack-123-abc", "secondary_stack_uid": "stack-456-def", "current_stack": "primary" } ``` ### Response ```json { "response": { "ok": true, "message": "Failover Group created" } } ``` --- ## Update Elastic Address URL: https://developers.cloud66.com/v3/endpoints/elastic-addresses/#update Endpoint: PUT /elastic_addresses/:uid OAuth scope: admin Modifies the specified elastic address (failover group) with new stack assignments or current stack settings. Validates changes against business rules and permissions before applying updates. You must have appropriate permissions on both existing and new stacks. Updating an elastic address will trigger DNS updates to reflect the new configuration and ensure proper traffic routing. **Related models:** ElasticAddress, Stack **Update Rules:** - Primary and secondary stacks must be different - You must have failover group edit permissions on all involved stacks - New stacks must support failover group functionality - DNS updates are automatically triggered after successful update ### Parameters - `uid` (string, optional) — Elastic address UID - `primary_stack_uid` (string, optional) — UID of the primary stack for the failover group - `secondary_stack_uid` (string, optional) — UID of the secondary/backup stack for the failover group - `current_stack` (string, optional) — Which stack is currently active ("primary" or "secondary") ### Request body ```json { "primary_stack_uid": "stack-789-ghi", "secondary_stack_uid": "stack-456-def", "current_stack": "secondary" } ``` ### Response ```json { "response": { "ok": true, "message": "Failover Group updated" } } ``` --- ## Delete Elastic Address URL: https://developers.cloud66.com/v3/endpoints/elastic-addresses/#delete Endpoint: DELETE /elastic_addresses/:uid OAuth scope: admin Permanently removes the specified elastic address (failover group) from the system. Cannot delete a failover group that is currently attached to a stack. You must first detach it from all stacks before deletion. **Related models:** ElasticAddress, Stack The deletion process will: 1. Verify the failover group is not attached to any stack 2. Remove the elastic address configuration 3. Log the deletion event for audit purposes ### Parameters - `uid` (string, optional) — Elastic address UID ### Response ```json { "response": { "ok": true, "message": "Failover Group deleted" } } ``` --- ## Get Environment Variable URL: https://developers.cloud66.com/v3/endpoints/environment-variables/#get Endpoint: GET /stacks/:stack_id/environments/:env_var_id OAuth scope: admin Get information about a single environment variable. **Related models:** Environment Variable ### Parameters - `stack_id` (string, required) — The stack UID - `env_var_id` (integer, required) — The environment variable ID ### Response ```json { "response": { "id": 4153, "key": "STACK_PATH", "value": "/var/deploy/test-elastic-1/web_head/current", "readonly": true, "created_at": "2014-08-29T17:21:25Z", "updated_at": "2014-08-29T17:21:25Z", "is_password": false, "is_generated": true, "history": [ { "key": 2, "value": "/var/deploy/test-elastic-1/web_head/somethingold", "created_at": "2015-05-08T14:01:50Z", "updated_at": "2015-05-08T14:01:50Z" } ] } } ``` --- ## List Environment Variables URL: https://developers.cloud66.com/v3/endpoints/environment-variables/#list Endpoint: GET /stacks/:stack_id/environments OAuth scope: admin Get list of all the environment variables of a stack. **Related models:** Environment Variable, Pagination ### Parameters - `stack_id` (string, required) — The stack UID ### Response ```json { "response": [ { "id": 4152, "key": "STACK_GIT_BRANCH", "value": "master", "readonly": true, "created_at": "2014-08-29T17:21:25Z", "updated_at": "2014-08-29T17:21:25Z", "is_password": false, "is_generated": true, "history": [ { "key": 1, "value": "develop", "created_at": "2015-05-08T15:09:50Z", "updated_at": "2015-05-08T15:09:50Z" } ] } ], "count": 30, "pagination": { "previous": null, "next": null, "current": 1, "per_page": 30, "count": 4, "pages": 1 } } ``` --- ## Add Environment Variable URL: https://developers.cloud66.com/v3/endpoints/environment-variables/#create Endpoint: POST /stacks/:stack_id/environments OAuth scope: admin Add an environment variable to a stack. **Related models:** Environment Variable ### Parameters - `stack_id` (string, required) — The stack UID - `key` (string, required) — The environment variable key/name - `value` (string, required) — The environment variable value ### Response ```json { "response": { "id": 4169, "key": "MY_ENVIRONMENT_VALUE", "value": "SOME_VALUE", "readonly": false, "created_at": "2015-01-01T12:00:00Z", "updated_at": "2015-01-01T12:00:00Z", "is_password": false, "is_generated": false, "history": [] } } ``` --- ## Update Environment Variable URL: https://developers.cloud66.com/v3/endpoints/environment-variables/#update Endpoint: PUT /stacks/:stack_id/environments/:env_var_key OAuth scope: admin Update an environment variable value. **Related models:** Environment Variable ### Parameters - `stack_id` (string, required) — The stack UID - `env_var_key` (string, required) — The environment variable key/name - `value` (string, required) — The new environment variable value ### Response ```json { "response": { "id": 4153, "key": "POSTGRESQL_SLAVE_ADDRESSES", "value": "127.0.0.1", "readonly": false, "created_at": "2014-08-29T17:21:25Z", "updated_at": "2015-01-01T12:00:00Z", "is_password": false, "is_generated": true, "history": [] } } ``` --- ## Delete Environment Variable URL: https://developers.cloud66.com/v3/endpoints/environment-variables/#delete Endpoint: DELETE /stacks/:stack_id/environments/:env_var_key OAuth scope: admin Delete an environment variable from a stack. **Related models:** Environment Variable ### Parameters - `stack_id` (string, required) — The stack UID - `env_var_key` (string, required) — The environment variable key/name ### Response ```json { "response": { "ok": true, "message": "Environment variable deleted" } } ``` --- ## Get Firewall Rule URL: https://developers.cloud66.com/v3/endpoints/firewall-rules/#get Endpoint: GET /stacks/:stack_id/firewalls/:firewall_rule_id OAuth scope: admin Get information about a specific firewall rule. **Related models:** Firewall Rule ### Parameters - `stack_id` (string, required) — The stack UID - `firewall_rule_id` (integer, required) — The firewall rule ID ### Response ```json { "response": { "id": 5027, "from_ip": "0.0.0.0/0", "from_group_id": null, "from_server_id": null, "to_ip": null, "to_group_id": 128, "to_server_id": null, "protocol": "tcp", "port": 80, "rule_type": "dynamic", "comments": null, "created_at": "2014-08-29T17:58:23Z", "updated_at": "2014-08-29T17:58:23Z" } } ``` --- ## List Firewall Rules URL: https://developers.cloud66.com/v3/endpoints/firewall-rules/#list Endpoint: GET /stacks/:stack_id/firewalls OAuth scope: admin Get list of all the firewall rules of a stack. **Related models:** Firewall Rule, Pagination ### Parameters - `stack_id` (string, required) — The stack UID ### Response ```json { "response": [ { "id": 5027, "from_ip": "0.0.0.0/0", "from_group_id": null, "from_server_id": null, "to_ip": null, "to_group_id": 128, "to_server_id": null, "protocol": "tcp", "port": 80, "rule_type": "dynamic", "comments": null, "created_at": "2014-08-29T17:58:23Z", "updated_at": "2014-08-29T17:58:23Z" } ], "count": 2, "pagination": { "previous": null, "next": null, "current": 1, "per_page": 30, "count": 2, "pages": 1 } } ``` --- ## Add Firewall Rule URL: https://developers.cloud66.com/v3/endpoints/firewall-rules/#create Endpoint: POST /stacks/:stack_id/firewalls OAuth scope: admin Add a new firewall rule to a stack. **Related models:** Firewall Rule ### Parameters - `stack_id` (string, required) — The stack UID - `from_ip` (string, optional) — Source IP address or CIDR - `protocol` (string, required) — Protocol (tcp/udp/icmp) - `port` (integer, required) — Port number ### Response ```json { "response": { "id": 5029, "from_ip": "0.0.0.0/0", "from_group_id": null, "from_server_id": null, "to_ip": null, "to_group_id": 128, "to_server_id": null, "protocol": "tcp", "port": 8080, "rule_type": "dynamic", "comments": "Custom rule", "created_at": "2015-01-01T12:00:00Z", "updated_at": "2015-01-01T12:00:00Z" } } ``` --- ## List Gateways URL: https://developers.cloud66.com/v3/endpoints/gateway/#list Endpoint: GET /accounts/:account_id/gateways OAuth scope: public Get a list of all the gateways of the account. **Related models:** Gateway, Pagination ### Parameters - `account_id` (string, required) — The account id ### Response ```json { "response":[ { "id": 1, "name": "aws_bastion", "username": "ec2-usr", "address": "1.1.1.1", "private_ip": "2.2.2.2", "ttl": "2016-02-01T14:46:38Z", "content": "N/A", "created_at_iso": "2016-02-01T14:37:05Z", "updated_at_iso": "2016-02-01T14:47:01Z", "created_by": "user1@cloud66.com", "updated_by": "user1@cloud66.com" } ], "count":1, "pagination":{ "previous":null, "next":null, "current":1, "per_page":30, "count":1, "pages":1 } } ``` --- ## Create Gateway URL: https://developers.cloud66.com/v3/endpoints/gateway/#create Endpoint: POST /accounts/:account_id/gateways OAuth scope: admin Create a new gateway under the account. `name` must be passed as params. You can also specify `username`, `address`, `ttl`, `private_ip` and `content` as params. **Related models:** Gateway ### Parameters - `account_id` (string, required) — The account id - `name` (string, required) — New gateway name - `username` (string, optional) — Username of bastion server - `address` (string, optional) — Public IP or DNS address of bastion server - `ttl` (integer, optional) — The number of seconds you want the gateway available - `private_ip` (string, optional) — Private IP or DNS address of bastion server - `content` (string, optional) — The content of private key of bastion server ### Response ```json { "response": { "ok": true } } ``` --- ## Update Gateway URL: https://developers.cloud66.com/v3/endpoints/gateway/#update Endpoint: PUT /accounts/:account_id/gateways/:id OAuth scope: admin Update gateway information. **Related models:** Gateway ### Parameters - `id` (integer, required) — The gateway id - `account_id` (string, required) — The account id - `name` (string, optional) — Gateway name - `username` (string, optional) — Username of bastion server - `address` (string, optional) — Public IP or DNS address of bastion server - `ttl` (integer, optional) — The number of seconds you want the gateway available - `private_ip` (string, optional) — Private IP or DNS address of bastion server - `content` (string, optional) — The content of private key of bastion server ### Response ```json { "response": { "ok": true } } ``` --- ## Delete Gateway URL: https://developers.cloud66.com/v3/endpoints/gateway/#delete Endpoint: DELETE /accounts/:account_id/gateways/:id OAuth scope: admin Delete a gateway. **Related models:** Gateway ### Parameters - `id` (integer, required) — The gateway id - `account_id` (string, required) — The account id --- ## Gateway URL: https://developers.cloud66.com/v3/endpoints/gateway/#reference OAuth scope: public Gateway endpoints provide access to Cloud 66 gateway functionality. This section contains endpoints for managing gateway configurations and settings. **Related models:** Gateway --- ## List Image Repositories URL: https://developers.cloud66.com/v3/endpoints/image-repositories/#list Endpoint: GET /stacks/:stack_id/image_repositories OAuth scope: public Get list of all image repositories for a stack. **Related models:** Image Repository ### Parameters - `stack_id` (string, required) — The stack UID ### Response ```json { "response": [ { "id": 1, "name": "my-app-repo", "url": "quay.io/mycompany/my-app", "username": "myuser", "created_at": "2014-08-29T17:21:25Z", "updated_at": "2014-08-29T17:21:25Z" } ], "count": 1, "pagination": { "previous": null, "next": null, "current": 1, "per_page": 30, "count": 1, "pages": 1 } } ``` --- ## List Jobs URL: https://developers.cloud66.com/v3/endpoints/jobs/#list Endpoint: GET /stacks/:stack_id/jobs OAuth scope: public Get list of all jobs of a stack. **Related models:** Job, Pagination ### Parameters - `stack_id` (string, required) — The stack UID ### Response ```json { "response": [ { "id": 1, "name": "database_cleanup", "command": "bundle exec rake db:cleanup", "run_on": "all_servers", "created_at": "2014-08-29T17:21:25Z", "updated_at": "2014-08-29T17:21:25Z" } ], "count": 1, "pagination": { "previous": null, "next": null, "current": 1, "per_page": 30, "count": 1, "pages": 1 } } ``` --- ## List Notifications URL: https://developers.cloud66.com/v3/endpoints/notifications/#list Endpoint: GET /notifications OAuth scope: public Get list of all notifications. **Related models:** Notification, Pagination ### Response ```json { "response": [ { "id": 1, "user_id": 1, "alert_type": 5, "alert_value": "backup_ok", "stack_id": "5999b763474b0eafa5fafb64bff0ba80", "channel": "email", "created_at": "2014-08-29T17:21:25Z", "updated_at": "2014-08-29T17:21:25Z" } ], "count": 1, "pagination": { "previous": null, "next": null, "current": 1, "per_page": 30, "count": 1, "pages": 1 } } ``` --- ## Authenticated Ping URL: https://developers.cloud66.com/v3/endpoints/ping/#auth Endpoint: GET /ping/auth OAuth scope: public # Authenticated Ping Tests API connectivity with authentication. This endpoint verifies that the API is accessible and the OAuth token is valid, returning user and account information to confirm successful authentication. ## Use Cases - **Health Checks**: Verify API availability and authentication status - **Token Validation**: Confirm OAuth tokens are still valid - **User Context**: Retrieve current user and account information - **Integration Testing**: Test authenticated API connectivity ## Response Fields - `ok` - Always `true` for successful operations - `message` - Confirmation message with user and account IDs - `user_id` - Current user's unique identifier - `account_id` - Current account's unique identifier - `user_name` - User's display name - `account_name` - Account's display name This endpoint requires valid OAuth authentication. Use `/ping` for unauthenticated connectivity testing. **Related models:** User, Account ### Response ```json { "ok": true, "message": "all good. authenticated. User ID is 123. Account ID is 456", "user_id": 123, "account_id": 456, "user_name": "John Doe", "account_name": "My Company" } ``` --- ## Basic Ping URL: https://developers.cloud66.com/v3/endpoints/ping/#basic Endpoint: GET /ping # Basic Ping Tests API connectivity without authentication. This endpoint verifies that the API is accessible without requiring any authentication, making it useful for checking basic API availability and network connectivity. ## Use Cases - **Health Checks**: Monitor API availability without authentication - **Network Testing**: Verify network connectivity to Cloud66 API - **Service Status**: Check if the API service is running - **Load Balancer Checks**: Simple endpoint for load balancer health checks ## Response Fields - `ok` - Always `true` for successful operations - `message` - Simple confirmation message This endpoint does not require any authentication or API keys. It's designed for basic connectivity testing. ## Related Endpoints For authenticated connectivity testing, use the [Authenticated Ping](/v3/endpoints/ping/auth) endpoint. ### Response ```json { "ok": true, "message": "all good. unauthenticated" } ``` --- ## Get Process URL: https://developers.cloud66.com/v3/endpoints/processes/#get Endpoint: GET /stacks/:stack_id/processes/:id OAuth scope: public Get information about a specific process. **Related models:** Process ### Response ```json { "response":[ { "md5":"5999b763474b0eafa5fafb64bff0ba80", "name":"worker", "command":"bundle exec rake jobs:work", "servers":{"server_name":1} }, { "md5":"1230fd91f8c9e4e56c1b14dd0391702", "name":"scheduler", "command":"bundle exec rake jobs:schedule", "servers":{"server_name":1} } ], "count":2, "pagination": { "previous":null, "next":null, "current":1, "per_page":30, "count":2, "pages":1 } } ``` --- ## List Processes URL: https://developers.cloud66.com/v3/endpoints/processes/#list Endpoint: GET /stacks/:stack_id/processes OAuth scope: public Get list of all processes for a stack. **Related models:** Process, Pagination ### Parameters - `stack_id` (string, required) — Stack ID - `server_uid` (integer, optional) — Filter processes by server ID ### Response ```json { "response":[ { "md5":"5999b763474b0eafa5fafb64bff0ba80", "name":"worker", "command":"bundle exec rake jobs:work", "servers":{"server_name":1} }, { "md5":"1230fd91f8c9e4e56c1b14dd0391702", "name":"scheduler", "command":"bundle exec rake jobs:schedule", "servers":{"server_name":1} } ], "count":2, "pagination": { "previous":null, "next":null, "current":1, "per_page":30, "count":2, "pages":1 } } ``` --- ## Scale Process URL: https://developers.cloud66.com/v3/endpoints/processes/#scale Endpoint: POST /stacks/:stack_id/processes/:id/scale OAuth scope: public Scale a process on the stack. **Related models:** Process ### Response ```json { "response": [ { "id":10, "user":"acme@example.com", "resource_type":"stack", "action":"Process_scale", "resource_id":"283", "started_via":"api", "started_at":"2025-01-01T19:08:05Z", "finished_at":null, "finished_success":null, "finished_message":null } ] } ``` --- ## Cloud Reference Data URL: https://developers.cloud66.com/v3/endpoints/reference/#clouds Endpoint: GET /reference/clouds # Cloud Reference Data Retrieves reference data for cloud providers, including available server sizes, regions, and basic cloud information. This endpoint provides static reference data used for stack configuration and does not require authentication. ## Supported Cloud Providers - **aws** - Amazon Web Services - **azure_rm** - Microsoft Azure Resource Manager - **digitalocean** - DigitalOcean - **googlecloud** - Google Cloud Platform - **hetzner** - Hetzner Cloud - **linode** - Linode - **ovh** - OVH Cloud - **vultr** - Vultr ## Filter Options ### Cloud Information - `clouds` - Returns array of cloud provider names - `clouds_full` - Returns cloud names with descriptions ### Server Sizes - `sizes` - Returns available server sizes (names only) - `sizes_full` - Returns server sizes with specifications (CPU, RAM, etc.) ### Regions - `regions` - Returns available regions (IDs only) - `regions_full` - Returns regions with display names ## Query Examples ### All Cloud Data ``` GET /reference/clouds ``` Returns complete data for all cloud providers. ### Specific Cloud Provider ``` GET /reference/clouds?cloud=aws ``` Returns data only for AWS. ### Filter by Data Type ``` GET /reference/clouds?filter=sizes_full ``` Returns detailed server size information for all clouds. ### Combined Filtering ``` GET /reference/clouds?cloud=googlecloud&filter=regions ``` Returns only region IDs for Google Cloud. ## Response Formats ### Default Response (All Data) When no filters are specified, returns complete sizes and regions data for all or specified cloud providers. ### Single Cloud Response When filtering by a specific cloud, the response structure is flattened to show only that cloud's data. ### Filtered Response When using data type filters, only the requested data type is returned. This endpoint provides public reference data and does not require authentication or API keys. ## Error Responses **Related models:** Cloud ### Parameters - `cloud` (string, optional) — Filter by specific cloud provider (aws, azure_rm, digitalocean, googlecloud, hetzner, linode, ovh, vultr) - `filter` (string, optional) — Filter response data (clouds, clouds_full, regions, regions_full, sizes, sizes_full) ### Response ```json { "aws": { "sizes": { "t3.micro": "1 vCPU, 1 GB RAM", "t3.small": "1 vCPU, 2 GB RAM", "t3.medium": "2 vCPUs, 4 GB RAM" }, "regions": { "us-east-1": "US East (N. Virginia)", "us-west-2": "US West (Oregon)", "eu-west-1": "Europe (Ireland)" } }, "googlecloud": { "sizes": { "e2-micro": "1 vCPU, 1 GB RAM", "e2-small": "1 vCPU, 2 GB RAM", "e2-medium": "1 vCPU, 4 GB RAM" }, "regions": { "us-central1": "US Central (Iowa)", "europe-west1": "Europe West (Belgium)" } } } ``` --- ## Nginx Modules Reference URL: https://developers.cloud66.com/v3/endpoints/reference/#nginx-modules Endpoint: GET /reference/nginx_modules # Nginx Modules Reference Retrieves reference information about available Nginx modules that can be configured in Cloud66 stacks. This endpoint provides static reference data about module capabilities and does not require authentication. ## Use Cases - **Stack Configuration**: Determine available Nginx modules for web server configuration - **Feature Planning**: Understand what Nginx capabilities are available - **Documentation**: Reference module information for configuration guides ## Module Information Each module entry includes: - `name` - Human-readable module name - `description` - Brief description of module functionality - `version` - Module version information ## Common Nginx Modules The response typically includes modules for: - **SSL/TLS Support** - HTTPS and certificate management - **Geographic IP** - Location-based request handling - **Real IP Detection** - Proper client IP handling behind proxies - **Compression** - Content compression modules - **Security** - Security-related modules - **Performance** - Caching and optimization modules This endpoint provides public reference data about Nginx modules and does not require authentication or API keys. ## Related Configuration This reference data is typically used when: - Configuring web servers in stack creation - Setting up custom Nginx configurations - Planning stack architecture with specific Nginx features **Related models:** Stack, Service ### Response ```json { "http_geoip_module": { "name": "GeoIP Module", "description": "Provides geographic location information based on client IP addresses", "version": "1.0" }, "http_ssl_module": { "name": "SSL Module", "description": "Enables HTTPS and SSL/TLS support", "version": "1.0" }, "http_realip_module": { "name": "Real IP Module", "description": "Allows changing the client address to value from request header", "version": "1.0" } } ``` --- ## List Server Groups URL: https://developers.cloud66.com/v3/endpoints/server-groups/#list Endpoint: GET /stacks/:stack_id/server_groups OAuth scope: public Get list of all server groups of a stack. **Related models:** Server Group, Pagination ### Parameters - `stack_id` (string, required) — The stack UID ### Response ```json { "response": [ { "id": 128, "name": "web", "created_at": "2014-08-29T17:21:25Z", "updated_at": "2014-08-29T17:21:25Z" } ], "count": 1, "pagination": { "previous": null, "next": null, "current": 1, "per_page": 30, "count": 1, "pages": 1 } } ``` --- ## Get Server Setting URL: https://developers.cloud66.com/v3/endpoints/server-settings/#get-single Endpoint: GET /stacks/:stack_id/servers/:server_id/settings/:id OAuth scope: public Get information about a single server setting. **Related models:** Server Setting Get information of a single server setting item ### Parameters - `stack_id` (string, required) — The stack UID - `server_id` (string, required) — The server uid - `id` (string, required) — The server setting item ID ### Response ```json { "response": { "key": "server.name", "value": "Caribou" } } ``` --- ## Get Server Settings URL: https://developers.cloud66.com/v3/endpoints/server-settings/#get Endpoint: GET /stacks/:stack_id/servers/:server_id/settings OAuth scope: public Get list of all settings of a server. **Related models:** Server Setting, Pagination ### Parameters - `stack_id` (string, required) — The stack UID - `server_id` (string, required) — The server UID ### Response ```json { "response": [ { "key": "server.name", "value": "Caribou", "readonly": true, "warning_text": "Warning! Changing this value will also modify your Cloud 66 *.c66.me DNS values" } ], "count": 1, "pagination": { "previous": null, "next": null, "current": 1, "per_page": 30, "count": 1, "pages": 1 } } ``` --- ## List Server Settings URL: https://developers.cloud66.com/v3/endpoints/server-settings/#list Endpoint: GET /stacks/:stack_id/servers/:server_id/settings OAuth scope: admin Get list of all server settings for a server. **Related models:** Server Setting, Pagination Get list of all settings for a server. ### Parameters - `stack_id` (string, required) — The stack UID - `server_id` (string, required) — The server UID ### Response ```json { "response": [ { "id": 1, "key": "server.timezone", "value": "UTC", "readonly": false, "created_at": "2014-08-29T17:21:25Z", "updated_at": "2014-08-29T17:21:25Z" } ], "count": 1, "pagination": { "previous": null, "next": null, "current": 1, "per_page": 30, "count": 1, "pages": 1 } } ``` --- ## Update Server Settings URL: https://developers.cloud66.com/v3/endpoints/server-settings/#update Endpoint: PUT /stacks/:stack_id/servers/:server_id/settings/:id OAuth scope: admin Update value of a server setting item. **Related models:** Server Setting ### Parameters - `stack_id` (string, required) — The stack UID - `server_id` (string, required) — The server UID - `id` (string, required) — The server setting item ID - `value` (string, required) — The server setting item new value ### Response ```json { "response": { "id": 9, "user": "test@cloud66.com", "resource_type": "server", "action": "server-set: server.name", "resource_id": "445", "started_via": "api", "started_at": "2014-09-01T13:07:35Z", "finished_at": null, "finished_success": null, "finished_message": null } } ``` --- ## Get Server URL: https://developers.cloud66.com/v3/endpoints/servers/#get Endpoint: GET /stacks/:stack_id/servers/:server_id OAuth scope: public Get information about a single server. **Related models:** Server ### Parameters - `stack_id` (string, required) — The stack UID - `server_id` (string, required) — The server UID ### Response ```json { "response": { "uid": "f8468fc145ea49bac474b30a8fea888d", "vendor_uid": "2492780", "name": "Caribou", "address": "146.185.133.183", "distro": "ubuntu", "distro_version": "14.04", "dns_record": "caribou.aws-us-east-1.cloud66.net", "user_name": "root", "server_type": "p", "server_roles": ["rails", "web", "app", "db:mysql:master"], "server_group_id": 128, "stack_uid": "5999b763474b0eafa5fafb64bff0ba80", "has_agent": true, "params": { "availability_zone": "us-east-1a", "size": "t2.micro", "region": "us-east-1", "ecs_instance_profile": null }, "created_at": "2014-08-29T17:21:25Z", "updated_at": "2014-08-30T17:21:25Z", "region": "us-east-1", "availability_zone": "us-east-1a", "ext_ipv4": "146.185.133.183", "health_state": 3, "int_ipv4": "10.177.13.137", "int_ipv6": null, "ext_ipv6": null } } ``` --- ## List Servers URL: https://developers.cloud66.com/v3/endpoints/servers/#list Endpoint: GET /stacks/:stack_id/servers OAuth scope: public Get list of all the servers of a stack. **Related models:** Server, Pagination ### Parameters - `stack_id` (string, required) — The stack UID ### Response ```json { "response": [ { "uid": "f8468fc145ea49bac474b30a8fea888d", "vendor_uid": "2492780", "name": "Caribou", "address": "146.185.133.183", "distro": "ubuntu", "distro_version": "14.04", "dns_record": "caribou.aws-us-east-1.cloud66.net", "user_name": "root", "server_type": "p", "server_roles": ["rails", "web", "app", "db:mysql:master"], "server_group_id": 128, "stack_uid": "5999b763474b0eafa5fafb64bff0ba80", "has_agent": true, "params": { "availability_zone": "us-east-1a", "size": "t2.micro", "region": "us-east-1", "ecs_instance_profile": null }, "created_at": "2014-08-29T17:21:25Z", "updated_at": "2014-08-30T17:21:25Z", "region": "us-east-1", "availability_zone": "us-east-1a", "ext_ipv4": "146.185.133.183", "health_state": 3, "int_ipv4": "10.177.13.137", "int_ipv6": null, "ext_ipv6": null } ], "count": 1, "pagination": { "previous": null, "next": null, "current": 1, "per_page": 30, "count": 1, "pages": 1 } } ``` --- ## Reboot Server URL: https://developers.cloud66.com/v3/endpoints/servers/#reboot Endpoint: POST /stacks/:stack_id/servers/:server_id/reboot OAuth scope: admin Reboot a server. **Related models:** Server ### Parameters - `stack_id` (string, required) — The stack UID - `server_id` (string, required) — The server UID ### Response ```json { "response": { "ok": true, "message": "Server reboot initiated" } } ``` --- ## List Services URL: https://developers.cloud66.com/v3/endpoints/services/#list Endpoint: GET /stacks/:stack_id/services OAuth scope: public Get list of all services of a stack. **Related models:** Service, Pagination ### Parameters - `stack_id` (string, required) — The stack UID ### Response ```json { "response": [ { "name": "web", "service_name": "web", "image": "quay.io/cloud66/sample-rails", "build_command": null, "command": "bundle exec rackup -p 3000", "build_root": null, "git_url": "http://github.com/cloud66-samples/awesome-app.git", "git_branch": "fig", "created_at": "2015-02-10T17:41:37Z", "updated_at": "2015-02-17T14:40:17Z" } ], "count": 1, "pagination": { "previous": null, "next": null, "current": 1, "per_page": 30, "count": 1, "pages": 1 } } ``` --- ## Get Container Session URL: https://developers.cloud66.com/v3/endpoints/sessions/#fetch Endpoint: GET /stacks/:stack_id/sessions/fetch OAuth scope: redeploy # Get Container Session Retrieves container session information for debugging and troubleshooting purposes. Returns either a specific session by ID or the most recent session for a specified service. ## Session Lookup The endpoint supports two lookup methods: - **By Session ID** - Use `session_id` parameter to get a specific session - **By Service Name** - Use `service_name` parameter to get the most recent session for that service If both parameters are provided, `session_id` takes precedence. ## Container Sessions Sessions allow users to establish interactive connections to running containers for: - **Debugging applications** - Inspect running processes and logs - **Troubleshooting issues** - Examine container filesystem and configuration - **Interactive shell access** - Execute commands inside containers - **Performance monitoring** - Monitor container resource usage ## Access Requirements - **SSH Key Download Permission** - User must have SSH key download permissions on the stack - **Container Stacks Only** - Sessions are only available for container-based stacks - **Active Sessions** - Returns information about currently active sessions ## Connection Information The response includes connection details needed to establish the session: - Connection host and port - Authentication credentials - Container and service identifiers - Session status and metadata This endpoint only works with container-based stacks. Traditional server stacks do not support container sessions. ## Error Responses **Related models:** Session, Stack, Service ### Parameters - `stack_id` (string, optional) — Stack UID - `session_id` (string, optional) — Database ID for a specific session - `service_name` (string, optional) — Service name to get the most recent session for ### Response ```json { "id": 123, "service_name": "web", "container_name": "web-container-abc123", "status": "active", "connection_info": { "host": "session.cloud66.com", "port": 22, "username": "session_user" }, "created_at": "2023-01-15T10:30:00Z", "updated_at": "2023-01-15T10:30:00Z" } ``` --- ## Create Container Session URL: https://developers.cloud66.com/v3/endpoints/sessions/#create Endpoint: POST /stacks/:stack_id/sessions OAuth scope: redeploy # Create Container Session Creates a new interactive container session for the specified service. This enables debugging and troubleshooting by providing shell access to running containers. ## Session Creation Process 1. **Validation** - Verifies user permissions and stack type 2. **Service Verification** - Confirms the service exists and is running 3. **Session Limits** - Checks current session count (max 15 per service) 4. **Async Creation** - Starts session creation as a background task 5. **Connection Setup** - Establishes secure connection to container ## Session Management - **Session Limits** - Maximum of 15 concurrent sessions per service - **Automatic Cleanup** - Oldest sessions are stopped when limit is exceeded - **Background Processing** - Session creation is handled asynchronously - **Secure Access** - Sessions use secure authentication mechanisms ## Use Cases - **Application Debugging** - Inspect running applications and processes - **Log Investigation** - Examine application and system logs directly - **Configuration Changes** - Temporary configuration modifications for testing - **Performance Analysis** - Monitor resource usage and system performance - **Troubleshooting** - Diagnose issues in production environments ## Session Lifecycle 1. **Pending** - Session creation initiated but not yet ready 2. **Active** - Session is established and ready for use 3. **Stopped** - Session has been terminated or expired 4. **Failed** - Session creation or maintenance failed ## Access Requirements - **SSH Key Download Permission** - User must have SSH key download permissions - **Container Stacks Only** - Sessions are only supported on container-based stacks - **Valid Service** - Specified service must exist in the active rollout variant Session creation is performed asynchronously. Monitor the returned AsyncAction to track session creation progress. ## Error Responses **Related models:** Session, AsyncAction, Stack, Service ### Parameters - `stack_id` (string, optional) — Stack UID - `service_name` (string, optional) — Name of the service to create a session for ### Request body ```json { "service_name": "web" } ``` ### Response ```json { "id": 456, "user_id": 123, "resource_type": "stack", "action": "create_session", "status": "pending", "started_at": "2023-01-15T10:30:00Z", "finished_at": null, "created_at": "2023-01-15T10:30:00Z", "updated_at": "2023-01-15T10:30:00Z" } ``` --- ## Get Stack Alert URL: https://developers.cloud66.com/v3/endpoints/stack-alerts/#show Endpoint: GET /stacks/:stack_id/alerts/:alert_name OAuth scope: public Returns comprehensive details about the specified stack alert configuration. Retrieves the alert settings including notification channels, thresholds, and current status for the specified alert type on the stack. **Related models:** Stack, Alert **Common Alert Names:** - **deployment_success**: Deployment completed successfully - **deployment_failure**: Deployment failed - **server_down**: Server became unavailable - **server_up**: Server became available - **scaling_complete**: Auto-scaling operation completed - **backup_complete**: Backup operation completed ### Parameters - `stack_id` (string, optional) — Stack UID - `alert_name` (string, optional) — Alert name (e.g., "deployment_success", "server_down") ### Response ```json { "response": { "name": "deployment_success", "description": "Notifies when a deployment completes successfully", "channels": [ { "type": "email", "enabled": true, "recipients": ["admin@example.com"] }, { "type": "slack", "enabled": true, "webhook_url": "https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK" } ], "active": true, "settings": { "frequency": "immediate", "threshold": 1 } } } ``` --- ## List Stack Alerts URL: https://developers.cloud66.com/v3/endpoints/stack-alerts/#list Endpoint: GET /stacks/:stack_id/alerts OAuth scope: public Returns a collection of alert configurations for the specified stack. Stack alerts provide notification capabilities for various stack events including deployments, server status changes, and system health monitoring. Each alert can be configured with multiple notification channels. **Related models:** Stack, Alert **Available Alert Types:** - **deployment_success**: Deployment completed successfully - **deployment_failure**: Deployment failed - **server_down**: Server became unavailable - **server_up**: Server became available - **scaling_complete**: Auto-scaling operation completed - **backup_complete**: Backup operation completed ### Parameters - `stack_id` (string, optional) — Stack UID ### Response ```json { "response": [ { "name": "deployment_success", "description": "Notifies when a deployment completes successfully", "channels": [ { "type": "email", "enabled": true, "recipients": ["admin@example.com"] }, { "type": "slack", "enabled": true, "webhook_url": "https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK" } ], "active": true }, { "name": "server_down", "description": "Notifies when a server goes down", "channels": [ { "type": "email", "enabled": true, "recipients": ["ops@example.com", "admin@example.com"] } ], "active": true } ] } ``` --- ## Update Stack Alerts URL: https://developers.cloud66.com/v3/endpoints/stack-alerts/#update Endpoint: PUT /stacks/:stack_id/alerts OAuth scope: admin Updates multiple stack alert configurations in a single operation. Modifies notification settings for specified alerts on the stack. Validates changes against business rules and permissions before applying updates. **Related models:** Stack, Alert **Configurable Alert Types:** - **deployment_success**: Deployment completed successfully - **deployment_failure**: Deployment failed - **server_down**: Server became unavailable - **server_up**: Server became available - **scaling_complete**: Auto-scaling operation completed - **backup_complete**: Backup operation completed **Channel Configuration:** - **email**: Recipients list with email addresses - **slack**: Webhook URL for Slack integration - **webhook**: Custom webhook endpoints - **sms**: SMS notification settings This endpoint allows updating multiple alert configurations simultaneously. Only specified alerts in the request will be modified - other existing alerts remain unchanged. ### Parameters - `stack_id` (string, optional) — Stack UID - `alerts` (string, optional) — Alert configurations to update, keyed by alert name ### Request body ```json { "alerts": { "deployment_success": { "channels": [ { "type": "email", "enabled": true, "recipients": ["admin@example.com", "dev-team@example.com"] }, { "type": "slack", "enabled": true, "webhook_url": "https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK" } ], "active": true, "settings": { "frequency": "immediate", "threshold": 1 } }, "server_down": { "channels": [ { "type": "email", "enabled": true, "recipients": ["ops@example.com"] } ], "active": true, "settings": { "frequency": "immediate", "threshold": 1 } } } } ``` ### Response ```json { "response": { "ok": true, "message": "Alerts updated successfully" } } ``` --- ## Get Stack Setting URL: https://developers.cloud66.com/v3/endpoints/stack-settings/#get Endpoint: GET /stacks/:stack_id/settings/:id OAuth scope: public Get information of a single setting item. **Related models:** Stack Setting ### Parameters - `stack_id` (string, required) — The stack UID - `id` (string, required) — The setting item ID ### Response ```json { "response": { "key": "git.branch", "value": "master" } } ``` --- ## List Stack Settings URL: https://developers.cloud66.com/v3/endpoints/stack-settings/#list Endpoint: GET /stacks/:stack_id/settings OAuth scope: admin Get list of all settings for a stack. **Related models:** Stack Setting, Pagination ### Parameters - `stack_id` (string, required) — The stack UID ### Response ```json { "response": [ { "id": 1, "key": "stack.timezone", "value": "UTC", "readonly": false, "created_at": "2014-08-29T17:21:25Z", "updated_at": "2014-08-29T17:21:25Z" } ], "count": 1, "pagination": { "previous": null, "next": null, "current": 1, "per_page": 30, "count": 1, "pages": 1 } } ``` --- ## Update Stack Setting URL: https://developers.cloud66.com/v3/endpoints/stack-settings/#update Endpoint: PUT /stacks/:stack_id/settings/:id OAuth scope: admin Update value of a setting item. **Related models:** Stack Setting ### Parameters - `stack_id` (string, required) — The stack UID - `id` (integer, required) — The setting item ID - `value` (string, required) — The setting item new value ### Response ```json { "response": { "id": 7, "user": "test@cloud66.com", "resource_type": "stack", "action": "stack-set: git.branch", "resource_id": "280", "started_via": "api", "started_at": "2014-09-01T12:47:24Z", "finished_at": null, "finished_success": null, "finished_message": null } } ``` --- ## Get Stack URL: https://developers.cloud66.com/v3/endpoints/stacks/#get Endpoint: GET /stacks/:id OAuth scope: public Retrieve the details of the stack specified in the request. **Related models:** Stack ### Stack status values | Status | Code | Description | | ----------- | :---: | ----------------------------------------- | | STK_QUEUED | 0 | Pending analysis | | STK_SUCCESS | 1 | Deployed successfully | | STK_FAILED | 2 | Deployment failed | | STK_ANALYSING | 3 | Analyzing | | STK_ANALYSED | 4 | Analyzed | | STK_QUEUED_FOR_DEPLOYING | 5 | Queued for deployment | | STK_DEPLOYING | 6 | Deploying | | STK_TERMINAL_FAILURE | 7 | Unable to analyze | ### Stack health status values | Status | Code | Description | | ----------- | :---: | ------------------------------------------ | | HLT_UNKNOWN | 0 | Unknown | | HLT_BUILDING | 1 | Building | | HLT_PARTIAL | 2 | Impaired | | HLT_OK | 3 | Healthy | | HLT_BROKEN | 4 | Failed | ### Parameters - `id` (string, required) — Unique identifier of the stack ### Response ```json { "response": { "uid": "5999b763474b0eafa5fafb64bff0ba80", "name": "Awesome App", "git": "http://github.com/cloud66-samples/awesome-app.git", "git_branch": "fig", "environment": "production", "cloud": "DigitalOcean", "fqdn": "awesome-app.dev.c66.me", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2014-08-14T01:46:53+00:00", "last_activity_iso": "2014-08-14T01:46:53+00:00", "maintenance_mode": false, "has_loadbalancer": false, "created_at": "2014-08-14 00:38:14 UTC", "updated_at": "2014-08-14 01:46:52 UTC", "deploy_directory": "/var/deploy/awesome_app", "cloud_status": "partial", "created_at_iso": "2014-08-14T00:38:14Z", "updated_at_iso": "2014-08-14T01:46:52Z", "redeploy_hook": "http://hooks.cloud66.com/stacks/redeploy/b806f1c3344eb3aa2a024b23254b75b3/6d677352a6b2eefec6e345ee2b491521" } } ``` --- ## Get Stack Action URL: https://developers.cloud66.com/v3/endpoints/stacks/#action-get Endpoint: GET /stacks/:stack_id/actions/:id OAuth scope: public Retrieve the details of an asynchronous action performed for the the stack specified in the request based on the supplied action ID. **Related models:** Stack ### Parameters - `stack_id` (string, required) — Unique identifier of the stack - `id` (integer, required) — Identifier of the asynchronous action ### Response ```json { "response": { "id": 6566418, "user": "person@company.com", "resource_type": "stack", "action": "application_deployment", "resource_id": "84195", "started_via": "api", "started_at": "2023-10-11T11:43:57Z", "finished_at": "2023-10-11T11:47:42Z", "finished_success": true, "finished_message": "Completed successfully", "finished_result": {}, "metadata": { "user_reference": "my-useful-id" } } } ``` --- ## List Stacks URL: https://developers.cloud66.com/v3/endpoints/stacks/#list Endpoint: GET /stacks OAuth scope: public Retrieves a paged list of all the stack objects the user can access. **Related models:** Stack, Pagination ### Response ```json { "response": [ { "uid": "5999b763474b0eafa5fafb64bff0ba80", "name": "Awesome App", "git": "http://github.com/cloud66-samples/awesome-app.git", "git_branch": "fig", "environment": "production", "cloud": "DigitalOcean", "fqdn": "awesome-app.dev.c66.me", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2014-08-14T01:46:53+00:00", "last_activity_iso": "2014-08-14T01:46:53+00:00", "maintenance_mode": false, "has_loadbalancer": false, "created_at": "2014-08-14 00:38:14 UTC", "updated_at": "2014-08-14 01:46:52 UTC", "deploy_directory": "/var/deploy/awesome_app", "cloud_status": "partial", "created_at_iso": "2014-08-14T00:38:14Z", "updated_at_iso": "2014-08-14T01:46:52Z", "redeploy_hook": "http://hooks.cloud66.com/stacks/redeploy/b806f1c3344eb3aa2a024b23254b75b3/6d677352a6b2eefec6e345ee2b491521" } ], "count": 1, "pagination": { "previous": null, "next": null, "current": 1, "per_page": 30, "count": 1, "pages": 1 } } ``` --- ## SSL Certificates URL: https://developers.cloud66.com/v3/endpoints/stacks/#ssl-certificates Endpoint: GET /stacks/:stack_id/ssl_certificates OAuth scope: admin You can use this method to query, add, delete or update SSL certificates on a stack. **Related models:** Stack, SSL Certificate, Pagination ### HTTP Methods - `GET /stacks/:stack_id/ssl_certificates` - List SSL certificates - `POST /stacks/:stack_id/ssl_certificates` - Create SSL certificate - `GET /stacks/:stack_id/ssl_certificates/:id` - Get SSL certificate - `PATCH /stacks/:stack_id/ssl_certificates/:id` - Update SSL certificate - `PUT /stacks/:stack_id/ssl_certificates/:id` - Update SSL certificate - `DELETE /stacks/:stack_id/ssl_certificates/:id` - Delete SSL certificate POST, PATCH and PUT should use the following object format: ```json { "ssl_certificate": { "server_names": "mywebsite.com", "ssl_termination": true, "type": "lets_encrypt", "wildcard": true, "dns_provider_uuid": "dp-fbe3dd78cdc600b187b38c4d4b6b016b" } } ``` ### Parameters - `stack_id` (string, required) — Unique identifier of the stack - `type` (string, required) — Type of certificate (manual or lets_encrypt) - `ssl_termination` (bool, required) — Whether SSL certificate is terminated on the load balancer or not - `server_names` (string, required) — comma separated list of domains - `wildcard` (bool, optional) — Whether the certificate must support wildcarded domain names - only applies to type lets_encrypt - `dns_provider_uuid` (string, optional) — DNS provider to use for the Let's Encrypt DNS challenge - `certificate` (string, optional) — The certificate address - `key` (string, optional) — The certificate key - `intermediate_certificate` (string, optional) — The intermediate certificate chain ### Response ```json { "response": [ { "uuid": "ssl-9ad095613rrr4e0b8f718302bab8709e", "name": "pp-ticker-prod-cllaz", "server_group_id": null, "server_names": "www.fyp111.co", "sha256_fingerprint": "481f22f00e117e209dbde4c2ae3831401109fc824784943e39a194a3adb64082", "ca_name": "Let's Encrypt", "type": "lets_encrypt", "wildcard": false, "dns_provider_uuid": null, "ssl_termination": true, "has_intermediate_cert": true, "status": 3, "created_at": "2023-01-26T10:23:34Z", "updated_at": "2023-01-26T10:26:29Z", "expires_at": "2023-04-26T09:24:32Z", "certificate": null, "key": null, "intermediate_certificate": null } ], "count": 1, "pagination": { "previous": null, "next": null, "current": 1, "per_page": 30, "count": 1, "pages": 1 } } ``` --- ## Stack Actions List URL: https://developers.cloud66.com/v3/endpoints/stacks/#actions-list Endpoint: GET /stacks/:id/actions OAuth scope: public Retrieve a paged list of all asynchronous actions performed for the stack specified in the request. You can filter actions by your own metadata using `user_reference` (note: metadata needs to be added to the action when it is invoked to be available here). **Related models:** Stack, Pagination ### The stack action object | Property | Data type | Description | Sample value | | ------------- | --------- | ----------------------------------- | ---------------- | | id | int | The numeric identifier of the stack action. Identifiers increment by one for each performed action. | `10` | | user_reference | string (up to 255 chars) | Returns actions where the metadata matches the query. | `useful-reference-123` | | user | string | The email address of the user who performed the stack action. | `hello@cloud66.com`| | resource_type | string | The resource for which the action was performed, which is `stack` in this case. | `stack` | | action | string | The action that was performed for the stack. | `restart` | | resource_id | int | The unique ID of the resource | `283` | | started_via | string | The process that initiated the action, which is the UI, API, or command line. | `api` | | started_at | datetime | The date and time the action was initiated, in UTC datetime. | `2014-09-01T19:08:05Z` | | finished_at | datetime | The date and time the action was completed, in UTC datetime. | `2014-09-01T19:08:09Z` | | finished_success | bool | Whether the action completed successfully. | `true` | | finished_message | string | If applicable, the system message associated with the completed action. | `null` | ### Parameters - `id` (string, required) — Unique identifier of the stack - `user_reference` (string, optional) — Returns actions where the metadata matches the query (up to 255 chars) ### Response ```json { "response": [ { "id": 6566418, "user": "person@company.com", "resource_type": "stack", "action": "application_deployment", "resource_id": "84195", "started_via": "api", "started_at": "2023-10-11T11:43:57Z", "finished_at": "2023-10-11T11:47:42Z", "finished_success": true, "finished_message": "Completed successfully", "finished_result": {}, "metadata": { "user_reference": "my-useful-id" } } ], "count": 1, "pagination": { "previous": null, "next": null, "current": 1, "per_page": 30, "count": 1, "pages": 1 } } ``` --- ## Create Stack URL: https://developers.cloud66.com/v3/endpoints/stacks/#create Endpoint: POST /stacks OAuth scope: redeploy Create and build a new docker stack. Either manifest definition, or `cloud`, `region`, `size` and `build_type` must be passed as params. **Related models:** Stack ### Parameters - `name` (string, required) — New stack name - `environment` (string, required) — New stack environment - `service_yaml` (string, required) — The services definition of the new docker stack - `manifest_yaml` (string, optional) — The manifest definition of the new docker stack - `cloud` (string, optional) — Cloud provider to create servers in - `key_name` (string, optional) — Name of the cloud provider key (Default or first available key for the cloud if not specified) - `region` (string, optional) — Region within the cloud to create servers in - `size` (string, optional) — Size of the server - `build_type` (string, optional) — Deploy all services to single or multi servers ### Response ```json { "response": { "id": 10, "user": "test@cloud66.com", "resource_type": "stack", "action": "stack_create", "resource_id": "283", "started_via": "api", "started_at": "2015-09-01T19:08:05Z", "finished_at": null, "finished_success": null, "finished_message": null } } ``` --- ## Reboot Stack Servers URL: https://developers.cloud66.com/v3/endpoints/stacks/#reboot-servers Endpoint: POST /stacks/:stack_id/reboot_servers OAuth scope: reboot You can use this method to reboot the stack or specific server group of a stack. **Related models:** Stack, Server ### Parameters - `stack_id` (string, required) — Unique identifier of the stack - `strategy` (string, required) — parallel or serial - `group` (string, optional) — all or web/db/redis etc (default is web) ### Response ```json { "response": { "id": 10, "user": "test@cloud66.com", "resource_type": "stack", "action": "stack_reboot", "resource_id": "283", "started_via": "api", "started_at": "2016-01-01T19:08:05Z", "finished_at": null, "finished_success": null, "finished_message": null } } ``` --- ## Run Stack Action URL: https://developers.cloud66.com/v3/endpoints/stacks/#run-action Endpoint: POST /stacks/:stack_id/actions OAuth scope: redeploy Perform an asynchronous action for the stack specified in the request. You can use this method to restart the stack, clear the stack's cache, enable maintenance mode, manage database replication, and control containers, services, and processes. **Related models:** Stack ### Available Commands | Command | Comments | Extra Parameters | | ---------- | ---------- | ---------------- | | clear_caches | Clears all application caches for the stack | None | | container_restart | Restarts a particular container on the given stack | • `container_id`:`container-id-or-name` | | disable_replication_slave_db | Disable replication to the specified slave database server | • `server_uid`:`server-uid`
• `db_type`:`postgresql`, `redis`, `mysql` (optional) | | maintenance_mode | Enable or disable maintenance mode for a stack | • `value`:`1` for enable or `0` for disable | | process_pause | Pauses the specified process | • `process_name`:`process-name` (optional)
• `server_uid`:`server-uid` (optional) | | process_restart | Restarts the specified process | • `process_name`:`process-name` (optional)
• `server_uid`:`server-uid` (optional) | | process_resume | Resumes the specified process | • `process_name`:`process-name` (optional)
• `server_uid`:`server-uid` (optional) | | promote_slave_db | Promote the specified slave database server to a standalone master | • `server_uid`:`server-uid`
• `db_type`:`postgresql`, `redis`, `mysql` (optional) | | restart | Restarts all stack components | None | | resync_slave_db | Re-sync the specified slave database server with its master database server | • `server_uid`:`server-uid`
• `db_type`:`postgresql`, `mysql` (optional) | | service_pause | Pauses all the containers from the given service | • `service_name`:`service-name` (optional)
• `server_uid`:`server-uid` (optional) | | service_restart | Restarts all the containers from the given service | • `service_name`:`service-name` (optional)
• `server_uid`:`server-uid` (optional) | | service_resume | Resumes all the containers from the given service | • `service_name`:`service-name` (optional)
• `server_uid`:`server-uid` (optional) | ### Parameters - `stack_id` (string, required) — Unique identifier of the stack - `command` (string, required) — The action to perform for the stack. Valid values are clear_caches, maintenance_mode, restart, promote_slave_db, resync_slave_db, disable_replication_slave_db, container_restart, service_restart, service_pause, service_resume, process_restart, process_pause, and process_resume. ### Response ```json { "response": { "id": 10, "user": "test@cloud66.com", "resource_type": "stack", "action": "clear_caches", "resource_id": "283", "started_via": "api", "started_at": "2014-09-01T19:08:05Z", "finished_at": null, "finished_success": null, "finished_message": null } } ``` --- ## Tagging Components URL: https://developers.cloud66.com/v3/endpoints/tagging-components/#reference OAuth scope: public Tagging components allow you to organize and categorize your Cloud 66 resources using custom tags. This section contains endpoints for managing tags on various Cloud 66 components including stacks, servers, and services. **Related models:** Tag --- ## List Tags URL: https://developers.cloud66.com/v3/endpoints/tags/#list Endpoint: GET /tags/:entity_type/:entity_id OAuth scope: public Get a list of tags for entities (servers & loadbalancers) by entity type and entity ID. **Related models:** Tag, Pagination ### Parameters - `entity_type` (string, required) — Type of the entity - `entity_id` (string, required) — ID of the entity ### Response ```json { "response":[ { "entity_type":"loadbalancer", "entity_id":"17823", "tags": [{"value":"foo","reserved":false},{"value":"bar","reserved":false}], "created_at_iso":"2021-01-04T21:32:33+0000", "updated_at_iso":"2021-01-05T11:12:23+0000" } ], "count":1, "pagination": { "previous":null, "next":null, "current":1, "per_page":30, "count":1, "pages":1 } } ``` --- ## Add Tags URL: https://developers.cloud66.com/v3/endpoints/tags/#add Endpoint: POST /tags/:entity_type/:entity_id OAuth scope: public Add tags to an entity (server or loadbalancer). Completely **replaces** tags of the object with tags provided. **Related models:** Tag ### Parameters - `entity_type` (string, required) — Type of the entity - `entity_id` (string, required) — ID of the entity - `tags` (array, required) — Array of tag values to be POSTed ### Response ```json { "response":[ { "entity_type":"loadbalancer", "entity_id":"17823", "tags": [{"value":"foo","reserved":false},{"value":"bar","reserved":false}], "created_at_iso":"2021-01-04T21:32:33+0000", "updated_at_iso":"2021-01-05T11:12:23+0000" } ], "count":1, "pagination": { "previous":null, "next":null, "current":1, "per_page":30, "count":1, "pages":1 } } ``` --- ## Update Tags URL: https://developers.cloud66.com/v3/endpoints/tags/#update Endpoint: PATCH /tags/:entity_type/:entity_id OAuth scope: public Update tags on an entity (server or loadbalancer). **Adds** or **deletes** tags based on the `operations` parameter. Deleting non-existent tags is not an error, will simply be ignored. Performs deletions first, then additions. **Related models:** Tag ### Parameters - `entity_type` (string, required) — Type of the entity - `entity_id` (string, required) — ID of the entity - `operations` (array, required) — An array of operation objects with "op" (add or delete) and "tags" array ### Response ```json { "response":[ { "entity_type":"loadbalancer", "entity_id":"17823", "tags": [{"value":"foo","reserved":false},{"value":"bar","reserved":false}], "created_at_iso":"2021-01-04T21:32:33+0000", "updated_at_iso":"2021-01-05T11:12:23+0000" } ], "count":1, "pagination": { "previous":null, "next":null, "current":1, "per_page":30, "count":1, "pages":1 } } ``` --- ## Delete Tags URL: https://developers.cloud66.com/v3/endpoints/tags/#delete Endpoint: DELETE /tags/:entity_type/:entity_id OAuth scope: public Delete all tags on an entity (server or loadbalancer). **Related models:** Tag ### Parameters - `entity_type` (string, required) — Type of the entity - `entity_id` (string, required) — ID of the entity ### Response ```json { "response":[ { "entity_type":"loadbalancer", "entity_id":"17823", "tags": [], "created_at_iso":"2021-01-04T21:32:33+0000", "updated_at_iso":"2021-01-05T11:12:23+0000" } ], "count":1, "pagination": { "previous":null, "next":null, "current":1, "per_page":30, "count":1, "pages":1 } } ``` --- ## Get User URL: https://developers.cloud66.com/v3/endpoints/users/#get Endpoint: GET /users/:id OAuth scope: users Get detailed information about a user. **Related models:** User ### Parameters - `id` (integer, required) — The user ID ### Response ```json { "response": { "id": 2, "email": "jim@gmail.com", "primary_account_id": 2, "locked": false, "access_profile": { "account_profile": { "can_create_stack": true, "can_admin_users": false, "can_payment": false, "can_add_cloud_key": false, "can_del_cloud_key": true, "can_view_acc_notifications": false, "can_edit_acc_notifications": true, "can_view_audit": false, "can_view_docker_img_key": false, "can_del_ssh_key": false, "can_edit_personal_token": false, "can_del_authorized_app": false, "can_view_custom_env": false, "can_edit_custom_env": false, "can_add_developers_app": false, "can_del_developers_app": false, "can_edit_git_key": false, "can_edit_gateway": false, "default_roles": [ "Viewer" ] }, "stack_profiles": [ { "stack_uid": "740f81b98eb847fab0df538ea8780d9d", "role": "Deployer" }, { "stack_uid": "b5f4eaaf56b5768f272ab875d2ba48b1", "role": "Viewer" } ] }, "uses_tfa": false, "timezone": "UTC", "has_valid_phone": false, "developer_program": false, "github_login": false, "last_login": "2016-01-28T13:12:16Z", "devices": [], "created_at": "2016-01-28T13:12:13Z", "updated_at": "2016-01-28T13:12:16Z", "cloud_status": "healthy" } } ``` --- ## List Users URL: https://developers.cloud66.com/v3/endpoints/users/#list Endpoint: GET /users OAuth scope: admin Get list of all users in the account. **Related models:** User, Pagination ### Response ```json { "response": [ { "id": 1, "email": "test@cloud66.com", "primary_account_id": 1, "locked": false, "uses_tfa": false, "timezone": "UTC", "has_valid_phone": false, "developer_program": false, "created_at": "2014-08-29T17:21:25Z", "updated_at": "2014-08-29T17:21:25Z" } ], "count": 1, "pagination": { "previous": null, "next": null, "current": 1, "per_page": 30, "count": 1, "pages": 1 } } ``` --- ## Add Device URL: https://developers.cloud66.com/v3/endpoints/users/#device-add Endpoint: POST /users/:id/devices OAuth scope: users Add a new device for the user. Note: Android support is not currently available. **Related models:** User ### Parameters - `id` (integer, required) — The user ID - `device_type` (integer, required) — Device type (1 = iOS, 2 = Android) - `sub_type` (integer, required) — Device subtype (1 = iPhone, 2 = iPad, 3 = iPod) - `token` (string, required) — The token of the device ### Response ```json { "response": { "device_type": 1, "sub_type": 1, "token": "mmccdd", "enabled": true, "created_at": "2014-09-01 09:15:50 UTC", "updated_at": "2014-09-01 09:15:50 UTC", "created_at_iso": "2014-09-01T09:15:50Z", "updated_at_iso": "2014-09-01T09:15:50Z" } } ``` --- ## Update Device URL: https://developers.cloud66.com/v3/endpoints/users/#device-update Endpoint: PUT /users/:id/devices OAuth scope: users Update `device_type` or `sub_type` of a device. **Related models:** User ### Parameters - `id` (integer, required) — The user ID - `device_type` (integer, required) — Device type (1 = iOS, 2 = Android) - `sub_type` (integer, required) — Device subtype (1 = iPhone, 2 = iPad, 3 = iPod) - `token` (string, required) — The token of the device --- ## Update User URL: https://developers.cloud66.com/v3/endpoints/users/#update Endpoint: PUT /users/:id OAuth scope: admin Update user information. Currently only access profile section changes are applied. **Related models:** User ### Parameters - `id` (integer, required) — The user ID ### Response ```json { "id": 2, "email": "jim@gmail.com", "primary_account_id": 2, "locked": false, "access_profile": { "account_profile": { "can_create_stack": true, "can_admin_users": false, "can_payment": false, "can_add_cloud_key": false, "can_del_cloud_key": true, "can_view_acc_notifications": false, "can_edit_acc_notifications": true, "can_view_audit": false, "can_view_docker_img_key": false, "can_del_ssh_key": false, "can_edit_personal_token": false, "can_del_authorized_app": false, "can_view_custom_env": false, "can_edit_custom_env": false, "can_add_developers_app": false, "can_del_developers_app": false, "can_edit_git_key": false, "can_edit_gateway": false, "default_roles": [ "Viewer" ] }, "stack_profiles": [ { "stack_uid": "740f81b98eb847fab0df538ea8780d9d", "role": "Deployer" }, { "stack_uid": "b5f4eaaf56b5768f272ab875d2ba48b1", "role": "Viewer" } ] }, "uses_tfa": false, "timezone": "UTC", "has_valid_phone": false, "developer_program": false, "github_login": false, "last_login": "2016-01-28T13:12:16Z", "devices": [], "created_at": "2016-01-28T13:12:13Z", "updated_at": "2016-01-28T13:12:16Z", "cloud_status": "healthy" } ``` --- ## Delete Device URL: https://developers.cloud66.com/v3/endpoints/users/#device-delete Endpoint: DELETE /users/:id/devices/:token OAuth scope: users Delete a device. **Related models:** User ### Parameters - `id` (integer, required) — The user ID - `token` (string, required) — The token of the device --- ## Account Suspended URL: https://developers.cloud66.com/v3/webhooks/account/#suspended Event type: account.suspended This webhook is sent when an account is suspended due to billing issues, policy violations, or other reasons. The payload includes the timestamp, event type, and the name of the suspended account. ### Payload ```json { "timestamp": 1640995200, "event_type": "account.suspended", "account_name": "Awesome Account" } ``` --- ## ActiveProtect Block URL: https://developers.cloud66.com/v3/webhooks/active-protect/#block Event type: active.protect.block Related models: server, activeprotect-action This webhook is sent when ActiveProtect blocks an IP address due to suspicious activity. The payload includes server information where the block occurred and details about the blocked activity. ### Payload ```json { "timestamp": 1757011079, "event_type": "active.protect.block", "server": { "uid": "550e8400-e29b-41d4-a716-446655440001", "vendor_uid": "i-0123456789abcdef0", "name": "web-server-01", "address": "203.0.113.10", "distro": "ubuntu", "distro_version": "20.04", "dns_record": "web-01.example.com", "user_name": "cloud66", "server_type": "aws", "server_roles": [ "web", "docker" ], "server_group_id": 123, "stack_uid": "stack-550e8400-e29b-41d4-a716", "has_agent": true, "params": { "size": "t3.medium", "region": "us-east-1", "subnet": "subnet-12345" }, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:20:00Z", "region": "us-east-1", "availability_zone": "us-east-1a", "ext_ipv4": "203.0.113.10", "int_ipv4": "10.0.1.100", "ext_ipv6": "2001:db8::1", "int_ipv6": "fd00::1", "health_state": 1, "personal_key": false, "has_deploy_gateway": false, "deploy_gateway_address": null, "deploy_gateway_user_name": null }, "activeprotect_action": { "server": "550e8400-e29b-41d4-a716-446655440000", "address": "192.168.1.45", "country": "United States", "country_code": "US", "attack": "SSH", "port": 22, "banned": true, "action_date": "2024-02-15T14:23:41Z" } } ``` --- ## ActiveProtect Change URL: https://developers.cloud66.com/v3/webhooks/active-protect/#change Event type: active.protect.change Related models: server, watched-file This webhook is sent when ActiveProtect detects unauthorized file changes on your servers. The payload includes server information and file change details. ### Payload ```json { "timestamp": 1757011079, "event_type": "active.protect.change", "server": { "uid": "550e8400-e29b-41d4-a716-446655440001", "vendor_uid": "i-0123456789abcdef0", "name": "web-server-01", "address": "203.0.113.10", "distro": "ubuntu", "distro_version": "20.04", "dns_record": "web-01.example.com", "user_name": "cloud66", "server_type": "aws", "server_roles": [ "web", "docker" ], "server_group_id": 123, "stack_uid": "stack-550e8400-e29b-41d4-a716", "has_agent": true, "params": { "size": "t3.medium", "region": "us-east-1", "subnet": "subnet-12345" }, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:20:00Z", "region": "us-east-1", "availability_zone": "us-east-1a", "ext_ipv4": "203.0.113.10", "int_ipv4": "10.0.1.100", "ext_ipv6": "2001:db8::1", "int_ipv6": "fd00::1", "health_state": 1, "personal_key": false, "has_deploy_gateway": false, "deploy_gateway_address": null, "deploy_gateway_user_name": null }, "watched_file": { "server": "550e8400-e29b-41d4-a716-446655440001", "file_path": "/etc/nginx/nginx.conf", "is_changed": false, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:25:00Z" } } ``` --- ## Application Health Check Failed URL: https://developers.cloud66.com/v3/webhooks/application/#health-check-failed Event type: application.health_check.failed Related models: stack Triggered when application health checks fail. ### Payload ```json { "timestamp": 1757011079, "event_type": "application.health_check.failed", "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456" } ``` --- ## Application Integration Configured URL: https://developers.cloud66.com/v3/webhooks/application/#integration-configured Event type: application.integration.configured Related models: stack Triggered when a new integration (like monitoring tools) is configured for the stack. ### Payload ```json { "timestamp": 1757011079, "event_type": "application.integration.configured", "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456" } ``` --- ## Application Integration Removed URL: https://developers.cloud66.com/v3/webhooks/application/#integration-removed Event type: application.integration.removed Related models: stack Triggered when an integration is removed from the stack. ### Payload ```json { "timestamp": 1757011079, "event_type": "application.integration.removed", "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456" } ``` --- ## Application Update Failed URL: https://developers.cloud66.com/v3/webhooks/application/#update-failed Event type: application.update.failed Related models: stack Triggered when an application update fails. ### Payload ```json { "timestamp": 1757011079, "event_type": "application.update.failed", "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456" } ``` --- ## Application Update Pending URL: https://developers.cloud66.com/v3/webhooks/application/#update-pending Event type: application.update.pending Related models: stack This webhook is sent when an application update is queued. The payload includes stack information and the update type symbol. ### Payload ```json { "timestamp": 1757011079, "event_type": "application.update.pending", "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456" } ``` --- ## Application Update Started URL: https://developers.cloud66.com/v3/webhooks/application/#update-started Event type: application.update.started Related models: stack Triggered when an application update begins. ### Payload ```json { "timestamp": 1757011079, "event_type": "application.update.started", "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456" } ``` --- ## Application Update Succeeded URL: https://developers.cloud66.com/v3/webhooks/application/#update-succeeded Event type: application.update.succeeded Related models: stack Triggered when an application update completes successfully. ### Payload ```json { "timestamp": 1757011079, "event_type": "application.update.succeeded", "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456" } ``` --- ## Stack Created URL: https://developers.cloud66.com/v3/webhooks/application/#created Event type: stack.created Related models: stack This webhook is sent when a new stack is created. The payload includes complete stack information and deployment setup details. ### Payload ```json { "timestamp": 1757011079, "event_type": "stack.created", "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456" } ``` --- ## Deploy Started URL: https://developers.cloud66.com/v3/webhooks/application/#deploy-started Event type: stack.deploy.started Related models: stack, deploy-context This webhook is sent when a deployment begins. The payload includes stack information and deployment context with start details. ### Payload ```json { "timestamp": 1757011079, "event_type": "stack.deploy.started", "stack": { "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456" }, "deploy_context": { "id": 78901, "stack_id": 12345, "uid": "dc-a1b2c3d4e5f6", "type": "kubernetes", "created_at": "2024-02-15T09:30:00Z", "updated_at": "2024-02-15T10:15:00Z", "apply_infrastructure_upgrades": true, "apply_security_upgrades": true, "async_action_id": 55667, "authorized_by": "user-456", "auto_update_docker_versions": true, "deploy_strategy": "rolling", "deploy_type": "redeploy", "deployment_profile_id": 123, "force_infrastructure_upgrades": false, "github_deployment_id": 789012, "reboot_servers": false, "triggered_by": "john@example.com", "triggered_via": "webhook", "is_advanced": false, "scaler_id": 334, "take_server_snapshots": true } } ``` --- ## Stack Provision Failure URL: https://developers.cloud66.com/v3/webhooks/application/#provision-fail Event type: stack.provision.fail Related models: stack, deploy-context This webhook is sent when a stack provisioning operation fails. The payload includes the same stack information as successful provisioning but with failure details in the deploy context. ### Payload ```json { "timestamp": 1757011079, "event_type": "stack.provision.fail", "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456", "deploy_context": { "id": 158, "triggered_by": "Cloudia Sixton", "triggered_via": "web", "started_at": "2024-01-01T11:55:00Z", "finished_at": "2024-01-01T12:00:00Z", "started_at_iso": "2024-01-01T11:55:00Z", "finished_at_iso": "2024-01-01T12:00:00Z", "outcome": "success", "git_hash": "f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0", "deploy_session": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0", "deploy_type": "build", "is_head": true, "is_live": true, "reverted": false, "reverted_by": null, "reverted_at": null, "reverted_at_iso": null } } ``` --- ## Stack Provision Success URL: https://developers.cloud66.com/v3/webhooks/application/#provision-ok Event type: stack.provision.ok Related models: stack, deploy-context This webhook is sent when a stack provisioning operation completes successfully. The payload includes complete stack information and detailed deployment context. ### Payload ```json { "timestamp": 1757011079, "event_type": "stack.provision.ok", "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456", "deploy_context": { "id": 158, "triggered_by": "Cloudia Sixton", "triggered_via": "web", "started_at": "2024-01-01T11:55:00Z", "finished_at": "2024-01-01T12:00:00Z", "started_at_iso": "2024-01-01T11:55:00Z", "finished_at_iso": "2024-01-01T12:00:00Z", "outcome": "success", "git_hash": "f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0", "deploy_session": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0", "deploy_type": "build", "is_head": true, "is_live": true, "reverted": false, "reverted_by": null, "reverted_at": null, "reverted_at_iso": null } } ``` --- ## Stack Redeploy Failure URL: https://developers.cloud66.com/v3/webhooks/application/#redeploy-fail Event type: stack.redeploy.fail Related models: stack, deploy-context This webhook is sent when stack redeployment fails. The payload includes stack information and deploy context with failure details. ### Payload ```json { "timestamp": 1757011079, "event_type": "stack.redeploy.fail", "stack": { "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456" }, "deploy_context": { "id": 78901, "stack_id": 12345, "uid": "dc-a1b2c3d4e5f6", "type": "kubernetes", "created_at": "2024-02-15T09:30:00Z", "updated_at": "2024-02-15T10:15:00Z", "apply_infrastructure_upgrades": true, "apply_security_upgrades": true, "async_action_id": 55667, "authorized_by": "user-456", "auto_update_docker_versions": true, "deploy_strategy": "rolling", "deploy_type": "redeploy", "deployment_profile_id": 123, "force_infrastructure_upgrades": false, "github_deployment_id": 789012, "reboot_servers": false, "triggered_by": "john@example.com", "triggered_via": "webhook", "is_advanced": false, "scaler_id": 334, "take_server_snapshots": true } } ``` --- ## Redeploy Hook Failed URL: https://developers.cloud66.com/v3/webhooks/application/#redeploy-hook-fail Event type: stack.redeploy.hook.fail Related models: stack This webhook is sent when redeployment hooks fail to execute. The payload includes stack information and the failure reason. ### Payload ```json { "timestamp": 1757011079, "event_type": "stack.redeploy.hook.fail", "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456" } ``` --- ## Stack Redeploy Success URL: https://developers.cloud66.com/v3/webhooks/application/#redeploy-ok Event type: stack.redeploy.ok Related models: stack, deploy-context This webhook is sent when stack redeployment completes successfully. The payload includes the same stack information as provisioning but with redeployment context. ### Payload ```json { "timestamp": 1757011079, "event_type": "stack.redeploy.ok", "stack": { "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456" }, "deploy_context": { "id": 78901, "stack_id": 12345, "uid": "dc-a1b2c3d4e5f6", "type": "kubernetes", "created_at": "2024-02-15T09:30:00Z", "updated_at": "2024-02-15T10:15:00Z", "apply_infrastructure_upgrades": true, "apply_security_upgrades": true, "async_action_id": 55667, "authorized_by": "user-456", "auto_update_docker_versions": true, "deploy_strategy": "rolling", "deploy_type": "redeploy", "deployment_profile_id": 123, "force_infrastructure_upgrades": false, "github_deployment_id": 789012, "reboot_servers": false, "triggered_by": "john@example.com", "triggered_via": "webhook", "is_advanced": false, "scaler_id": 334, "take_server_snapshots": true } } ``` --- ## Stack Score Changed URL: https://developers.cloud66.com/v3/webhooks/application/#stackscore-changed Event type: stack.stackscore.changed Related models: stack This webhook is sent when the stack score changes. The payload includes stack information and a diff object with details of what changed in the score. ### Payload ```json { "timestamp": 1757011079, "event_type": "stack.stackscore.changed", "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456" } ``` --- ## App Authorization URL: https://developers.cloud66.com/v3/webhooks/auth/#app-auth Event type: app.auth This webhook is sent when an OAuth application is authorized to access your Cloud66 account. The payload includes user information and application identifier. ### Payload ```json { "timestamp": 1640995200, "event_type": "app.auth", "user": "user@example.com", "app": "7c2c4ab2ae7ed4c33c3dacd1e9715f796ec222fd8985341128d7f7d485349caf" } ``` --- ## App Deauthorization URL: https://developers.cloud66.com/v3/webhooks/auth/#app-deauth Event type: app.deauth This webhook is sent when an OAuth application authorization is revoked. The payload structure is the same as app.auth but indicates deauthorization. ### Payload ```json { "timestamp": 1640995200, "event_type": "app.deauth", "user": "user@example.com", "app": "7c2c4ab2ae7ed4c33c3dacd1e9715f796ec222fd8985341128d7f7d485349caf" } ``` --- ## Autoscaling Actions URL: https://developers.cloud66.com/v3/webhooks/autoscaling/#actions Event type: autoscaling.actions Related models: stack This webhook is sent when autoscaling successfully performs scaling actions (scale up or down). The payload includes stack information, scaler details, and action message describing what was done. ### Payload ```json { "timestamp": 1757011079, "event_type": "autoscaling.actions", "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456" } ``` --- ## Autoscaling Failed URL: https://developers.cloud66.com/v3/webhooks/autoscaling/#failed Event type: autoscaling.failed Related models: stack This webhook is sent when an autoscaling operation fails to complete. The payload includes stack information, scaler configuration, and failure details. ### Payload ```json { "timestamp": 1757011079, "event_type": "autoscaling.failed", "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456" } ``` --- ## Backup Verification Failed URL: https://developers.cloud66.com/v3/webhooks/backup/#verification-failed Event type: backup.verification.failed Related models: stack, backup This webhook is sent when backup verification fails, indicating the backup may be corrupted or incomplete. The payload includes stack information, backup details, and verification failure information. ### Payload ```json { "timestamp": 1757011079, "event_type": "backup.verification.failed", "stack": { "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456" }, "backup": { "id": 54321, "server_uid": "server-abc123", "db_type": "postgresql", "database_name": "myapp_production", "file_base": "backup_20240115_103000", "backup_date_iso": "2024-01-15T10:30:00Z", "backup_status": 0, "backup_result": "Backup completed successfully", "restore_status": 0, "restore_result": "Not restored", "created_at_iso": "2024-01-15T10:30:00Z", "updated_at_iso": "2024-01-15T10:35:00Z", "verify_status": 0, "verify_result": "Backup verified successfully", "storage_path": "/backups/postgresql/myapp_production/", "skip_tables": "temp_logs,cache_data", "backup_size": 1024000000 } } ``` --- ## Managed Backup Failure URL: https://developers.cloud66.com/v3/webhooks/backup/#managed-backup-fail Event type: managed_backup.fail Related models: stack, backup This webhook is sent when a managed backup operation fails. The payload includes stack information and backup failure details with error message. ### Payload ```json { "timestamp": 1757011079, "event_type": "managed_backup.fail", "stack": { "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456" }, "backup": { "id": 54321, "server_uid": "server-abc123", "db_type": "postgresql", "database_name": "myapp_production", "file_base": "backup_20240115_103000", "backup_date_iso": "2024-01-15T10:30:00Z", "backup_status": 0, "backup_result": "Backup completed successfully", "restore_status": 0, "restore_result": "Not restored", "created_at_iso": "2024-01-15T10:30:00Z", "updated_at_iso": "2024-01-15T10:35:00Z", "verify_status": 0, "verify_result": "Backup verified successfully", "storage_path": "/backups/postgresql/myapp_production/", "skip_tables": "temp_logs,cache_data", "backup_size": 1024000000 } } ``` --- ## Cloud Object Delete Failure URL: https://developers.cloud66.com/v3/webhooks/cloud-object/#delete-fail Event type: cloud_object.delete.fail Related models: cloud_object_delete_queue This webhook is sent when cloud resource deletion fails. The payload has the same structure as successful deletion but with status indicating failure and potential error details included. ### Payload ```json { "timestamp": 1640995200, "event_type": "cloud_object.delete.fail", "cloud_object_delete_queue": { "id": 42, "object_type": "load_balancer", "network_object_id": "c66_abc123def456", "object_name": "c66_abc123def456", "stack_id": 1, "stack_name": "Awesome Stack", "account_id": 11, "account_email": "user@example.com", "cloud_symbol": "aws", "vendor_id": "c66_abc123def456", "status": "failed", "created_at": "2024-01-01T12:30:45Z", "updated_at": "2024-01-01T12:35:30Z", "error_message": "Resource deletion failed: timeout" } } ``` --- ## Cloud Object Delete Success URL: https://developers.cloud66.com/v3/webhooks/cloud-object/#delete-ok Event type: cloud_object.delete.ok Related models: cloud_object_delete_queue This webhook is sent when a cloud resource (like load balancer, database, etc.) is successfully deleted. The payload includes object type and identification, stack and account information, and cloud provider details. ### Payload ```json { "timestamp": 1640995200, "event_type": "cloud_object.delete.ok", "cloud_object_delete_queue": { "id": 42, "object_type": "load_balancer", "network_object_id": "c66_abc123def456", "object_name": "c66_abc123def456", "stack_id": 1, "stack_name": "Awesome Stack", "account_id": 11, "account_email": "user@example.com", "cloud_symbol": "aws", "vendor_id": "c66_abc123def456", "status": "deleted", "created_at": "2024-01-01T12:30:45Z", "updated_at": "2024-01-01T12:35:30Z" } } ``` --- ## Container Down URL: https://developers.cloud66.com/v3/webhooks/container/#down Event type: container.down Related models: container This webhook is sent when a container stops running or becomes unresponsive. The payload includes container details (name, image, ports) and server information where the container was running. ### Payload ```json { "timestamp": 1757011079, "event_type": "container.down", "uid": "container-abc123def456", "name": "web-app-container", "server_uid": "server-789xyz", "server_name": "web-server-01", "service_name": "web", "image": "myapp/web:v1.2.3", "command": "bundle exec puma -C config/puma.rb", "started_at": "2024-01-15T10:30:00Z", "ports": [ { "container": 3000, "http": 80, "https": 443 } ], "private_ip": "10.0.1.15", "docker_ip": "172.17.0.2", "health_state": 1, "health_message": "Container is running normally", "health_source": "docker", "capture_output": true, "restart_on_deploy": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:35:00Z", "status": "running" } ``` --- ## Database Slave Failed URL: https://developers.cloud66.com/v3/webhooks/database/#slave-failed Event type: db.slave.failed Related models: server This webhook is sent when database slave replication fails or falls behind the master. The payload includes server information for the slave database, database type, and failure details. ### Payload ```json { "timestamp": 1757011079, "event_type": "db.slave.failed", "uid": "550e8400-e29b-41d4-a716-446655440001", "vendor_uid": "i-0123456789abcdef0", "name": "web-server-01", "address": "203.0.113.10", "distro": "ubuntu", "distro_version": "20.04", "dns_record": "web-01.example.com", "user_name": "cloud66", "server_type": "aws", "server_roles": [ "web", "docker" ], "server_group_id": 123, "stack_uid": "stack-550e8400-e29b-41d4-a716", "has_agent": true, "params": { "size": "t3.medium", "region": "us-east-1", "subnet": "subnet-12345" }, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:20:00Z", "region": "us-east-1", "availability_zone": "us-east-1a", "ext_ipv4": "203.0.113.10", "int_ipv4": "10.0.1.100", "ext_ipv6": "2001:db8::1", "int_ipv6": "fd00::1", "health_state": 1, "personal_key": false, "has_deploy_gateway": false, "deploy_gateway_address": null, "deploy_gateway_user_name": null } ``` --- ## Database Slave OK URL: https://developers.cloud66.com/v3/webhooks/database/#slave-ok Event type: db.slave.ok Related models: server This webhook is sent when database slave replication is functioning correctly after a previous issue. The payload includes server information for the slave database and database type (mysql, postgresql, etc.). ### Payload ```json { "timestamp": 1757011079, "event_type": "db.slave.ok", "uid": "550e8400-e29b-41d4-a716-446655440001", "vendor_uid": "i-0123456789abcdef0", "name": "web-server-01", "address": "203.0.113.10", "distro": "ubuntu", "distro_version": "20.04", "dns_record": "web-01.example.com", "user_name": "cloud66", "server_type": "aws", "server_roles": [ "web", "docker" ], "server_group_id": 123, "stack_uid": "stack-550e8400-e29b-41d4-a716", "has_agent": true, "params": { "size": "t3.medium", "region": "us-east-1", "subnet": "subnet-12345" }, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:20:00Z", "region": "us-east-1", "availability_zone": "us-east-1a", "ext_ipv4": "203.0.113.10", "int_ipv4": "10.0.1.100", "ext_ipv6": "2001:db8::1", "int_ipv6": "fd00::1", "health_state": 1, "personal_key": false, "has_deploy_gateway": false, "deploy_gateway_address": null, "deploy_gateway_user_name": null } ``` --- ## Free Disk Space Alert URL: https://developers.cloud66.com/v3/webhooks/disk/#space-alert Event type: free.disk.space.alert Related models: agent This webhook is sent when disk space falls below the configured threshold. The payload includes the server UID experiencing the disk space issue. ### Payload ```json { "timestamp": 1640995200, "event_type": "free.disk.space.alert", "server": "123123123123123123" } ``` --- ## Free Disk Space Normal URL: https://developers.cloud66.com/v3/webhooks/disk/#space-normal Event type: free.disk.space.normal Related models: agent This webhook is sent when disk space returns to normal levels after an alert. The payload structure is the same as free.disk.space.alert. ### Payload ```json { "timestamp": 1640995200, "event_type": "free.disk.space.normal", "server": "123123123123123123" } ``` --- ## Job Back On URL: https://developers.cloud66.com/v3/webhooks/job/#backon Event type: job.backon Related models: job This webhook is sent when a previously failing job executes successfully. The payload includes job information and success confirmation details. ### Payload ```json { "timestamp": 1757011079, "event_type": "job.backon", "uid": "job-550e8400-e29b-41d4-a716", "name": "daily-backup", "type": "backup", "cron": "0 2 * * *", "status": "active", "paused": false, "params": { "retention_days": 30, "compress": true, "target_location": "s3://backup-bucket/daily" }, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-10T09:15:00Z" } ``` --- ## Job Failure URL: https://developers.cloud66.com/v3/webhooks/job/#fail Event type: job.fail Related models: job This webhook is sent when a scheduled job execution fails. The payload includes job information and configuration, along with execution failure details. ### Payload ```json { "timestamp": 1757011079, "event_type": "job.fail", "uid": "job-550e8400-e29b-41d4-a716", "name": "daily-backup", "type": "backup", "cron": "0 2 * * *", "status": "active", "paused": false, "params": { "retention_days": 30, "compress": true, "target_location": "s3://backup-bucket/daily" }, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-10T09:15:00Z" } ``` --- ## Payment Done URL: https://developers.cloud66.com/v3/webhooks/payment/#payment-done Event type: payment.done This webhook is sent when a payment is successfully processed for an account. The payload includes the timestamp, event type, and the amount that was charged. ### Payload ```json { "timestamp": 1640995200, "event_type": "payment.done", "charged_amount": "$29.00" } ``` --- ## Payment Failed URL: https://developers.cloud66.com/v3/webhooks/payment/#payment-fail Event type: payment.fail This webhook is sent when a payment fails to process. The payload includes the timestamp, event type, the amount that failed to be charged, and the reason for the failure. ### Payload ```json { "timestamp": 1640995200, "event_type": "payment.fail", "charged_amount": "$9.00", "reason": "Your credit card company is not accessible" } ``` --- ## Process Down URL: https://developers.cloud66.com/v3/webhooks/process/#down Event type: process.down Related models: provproc This webhook is sent when a monitored process stops running. The payload includes process information and server details. ### Payload ```json { "timestamp": 1640995200, "event_type": "process.down", "process_name": "nginx", "server": { "name": "Meerkat", "uid": "123123123123123123" } } ``` --- ## Web Process Started URL: https://developers.cloud66.com/v3/webhooks/process/#web-started Event type: web.process.started This webhook is sent when a web process starts successfully. The payload includes stack UID and server UID where the process started. ### Payload ```json { "timestamp": 1640995200, "event_type": "web.process.started", "stack": "abc123def456", "server": "123123123123123123" } ``` --- ## Web Process Stopped URL: https://developers.cloud66.com/v3/webhooks/process/#web-stopped Event type: web.process.stopped This webhook is sent when a web process stops. The payload structure is the same as web.process.started. ### Payload ```json { "timestamp": 1640995200, "event_type": "web.process.stopped", "stack": "abc123def456", "server": "123123123123123123" } ``` --- ## Web Process Unknown URL: https://developers.cloud66.com/v3/webhooks/process/#web-unknown Event type: web.process.unknown This webhook is sent when a web process status cannot be determined. The payload structure is the same as web.process.started. ### Payload ```json { "timestamp": 1640995200, "event_type": "web.process.unknown", "stack": "abc123def456", "server": "123123123123123123" } ``` --- ## Server Back Online URL: https://developers.cloud66.com/v3/webhooks/server/#backon Event type: server.backon Related models: agent This webhook is sent when a previously offline server comes back online. The payload structure is the same as server.stopped but indicates the server is now responding. ### Payload ```json { "timestamp": 1640995200, "event_type": "server.backon", "uid": "550e8400-e29b-41d4-a716-446655440001", "status": 1, "server": "550e8400-e29b-41d4-a716-446655440001", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:20:00Z", "created_at_iso": "2024-01-15T10:30:00Z", "updated_at_iso": "2024-02-15T14:20:00Z" } ``` --- ## Server IP Change Failed URL: https://developers.cloud66.com/v3/webhooks/server/#ip-change-fail Event type: server.ip.change.fail Related models: agent This webhook is sent when an IP address change operation fails for a server. The payload includes server information and the new_ext_ipv4 field containing the IP address that failed to be assigned. ### Payload ```json { "timestamp": 1640995200, "event_type": "server.ip.change.fail", "uid": "550e8400-e29b-41d4-a716-446655440001", "status": 1, "server": "550e8400-e29b-41d4-a716-446655440001", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:20:00Z", "created_at_iso": "2024-01-15T10:30:00Z", "updated_at_iso": "2024-02-15T14:20:00Z", "new_ext_ipv4": "111.111.111.111" } ``` --- ## Server Stopped URL: https://developers.cloud66.com/v3/webhooks/server/#stopped Event type: server.stopped Related models: agent This webhook is sent when a server stops responding or becomes unavailable. This typically indicates infrastructure issues, server crashes, or network connectivity problems. ### Payload ```json { "timestamp": 1640995200, "event_type": "server.stopped", "uid": "550e8400-e29b-41d4-a716-446655440001", "status": 1, "server": "550e8400-e29b-41d4-a716-446655440001", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:20:00Z", "created_at_iso": "2024-01-15T10:30:00Z", "updated_at_iso": "2024-02-15T14:20:00Z" } ``` --- ## Service Build Failure URL: https://developers.cloud66.com/v3/webhooks/service/#build-fail Event type: service.build.fail Related models: stack, service, image This webhook is sent when a service build fails. The payload includes stack information, service details, and build outcome status indicating failure with build failure details. ### Payload ```json { "timestamp": 1757011079, "event_type": "service.build.fail", "stack": { "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456" }, "service": { "name": "web", "containers": [ { "id": "container-123", "status": "running", "server_uid": "550e8400-e29b-41d4-a716-446655440001" }, { "id": "container-124", "status": "running", "server_uid": "550e8400-e29b-41d4-a716-446655440002" } ], "source_type": "git", "git_ref": "main", "image_name": "myapp/web", "image_uid": "sha256:1234567890abcdef", "image_tag": "latest", "command": "bundle exec rails server -b 0.0.0.0 -p 3000", "build_command": "bundle install && npm install && npm run build", "deploy_command": "bundle exec rake db:migrate", "wrap_command": null, "desired_count": 3 } } ``` --- ## Service Build Success URL: https://developers.cloud66.com/v3/webhooks/service/#build-ok Event type: service.build.ok Related models: stack, service, image This webhook is sent when a service build completes successfully. The payload includes stack information, service details (name, image, containers), build outcome status, and Docker image information. ### Payload ```json { "timestamp": 1757011079, "event_type": "service.build.ok", "stack": { "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456" }, "service": { "name": "web", "containers": [ { "id": "container-123", "status": "running", "server_uid": "550e8400-e29b-41d4-a716-446655440001" }, { "id": "container-124", "status": "running", "server_uid": "550e8400-e29b-41d4-a716-446655440002" } ], "source_type": "git", "git_ref": "main", "image_name": "myapp/web", "image_uid": "sha256:1234567890abcdef", "image_tag": "latest", "command": "bundle exec rails server -b 0.0.0.0 -p 3000", "build_command": "bundle install && npm install && npm run build", "deploy_command": "bundle exec rake db:migrate", "wrap_command": null, "desired_count": 3 } } ``` --- ## SSH Key Downloaded URL: https://developers.cloud66.com/v3/webhooks/ssh/#key-downloaded Event type: ssh_key.downloaded Related models: stack This webhook is sent when someone downloads SSH keys for server access. The payload includes stack and server information, along with the user who downloaded the keys. ### Payload ```json { "timestamp": 1757011079, "event_type": "ssh_key.downloaded", "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": [ "myapp-production", "myapp-staging" ], "considerations": { "warnings": [], "notices": [ "Stack is healthy" ] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456", "server": "web-server-01", "user_email": "john@example.com" } ``` --- ## SSL Certificate Expire Soon URL: https://developers.cloud66.com/v3/webhooks/ssl/#expire-soon Event type: ssl_certificate.expire.soon Related models: ssl_certificate This webhook is sent when an SSL certificate is approaching expiration (typically 30 days before). The payload includes certificate details with expiry information and domains that will be affected. ### Payload ```json { "timestamp": 1640995200, "event_type": "ssl_certificate.expire.soon", "ssl_certificate": { "stack_id": 123, "name": "Awesome SSL Certificate", "server_names": "example.com,awesome-example.com", "lets_encrypt": true, "has_intermediate_cert": true, "ssl_termination": true, "status": "installed", "cert_expiry": "2024-02-01T00:00:00Z", "days_until_expiry": 30, "created_at": "2024-01-01T12:30:45Z", "updated_at": "2024-01-01T12:35:30Z" } } ``` --- ## SSL Certificate Install Failure URL: https://developers.cloud66.com/v3/webhooks/ssl/#install-fail Event type: ssl_certificate.install.fail Related models: ssl_certificate This webhook is sent when SSL certificate installation fails. The payload structure is the same as ssl_certificate.install.ok but with status indicating failure and error details. ### Payload ```json { "timestamp": 1640995200, "event_type": "ssl_certificate.install.fail", "ssl_certificate": { "stack_id": 123, "name": "Awesome SSL Certificate", "server_names": "example.com,awesome-example.com", "lets_encrypt": true, "has_intermediate_cert": false, "ssl_termination": false, "status": "failed", "error_message": "Certificate validation failed", "created_at": "2024-01-01T12:30:45Z", "updated_at": "2024-01-01T12:35:30Z" } } ``` --- ## SSL Certificate Install Success URL: https://developers.cloud66.com/v3/webhooks/ssl/#install-ok Event type: ssl_certificate.install.ok Related models: ssl_certificate This webhook is sent when an SSL certificate is successfully installed. The payload includes certificate details (domains, expiry, type) and installation status and configuration. ### Payload ```json { "timestamp": 1640995200, "event_type": "ssl_certificate.install.ok", "ssl_certificate": { "stack_id": 123, "name": "Awesome SSL Certificate", "server_names": "example.com,awesome-example.com", "lets_encrypt": true, "has_intermediate_cert": true, "ssl_termination": true, "status": "installed", "cert_expiry": "2024-07-01T00:00:00Z", "created_at": "2024-01-01T12:30:45Z", "updated_at": "2024-01-01T12:35:30Z" } } ``` --- ## Account URL: https://developers.cloud66.com/v3/models/account/ Accounts represent organizational units in Cloud 66 that own and manage stacks. Users can belong to multiple accounts and have different roles within each account. Unique account identifier Email address of the account owner Account creation timestamp in ISO8601 format Last modification timestamp in ISO8601 format Number of stacks associated with this account List of cloud provider names used by this account's stacks True if this account matches the user's primary account Human-readable account name set by the user List of unmanaged cloud servers (only when include_servers=true and account is primary) Shell command for registering new servers to this account UUID for the account's configuration store namespace ### Example ```json { "id": 12345, "owner": "john@example.com", "created_at_iso": "2023-01-15T10:30:00Z", "updated_at_iso": "2024-02-20T14:45:00Z", "stack_count": 8, "used_clouds": ["aws", "digitalocean", "azure"], "current_account": true, "friendly_name": "Production Environment", "unmanaged_servers": [ { "id": 67890, "name": "web-server-01", "ip": "192.168.1.100" } ], "server_registration_script": "curl -sSL https://app.cloud66.com/registrations/new | sudo bash -s abc123def456", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000" } ``` --- ## ActiveProtect Action URL: https://developers.cloud66.com/v3/models/activeprotect-action/ Fail2ban actions represent security events where IP addresses are banned or monitored due to suspicious activity. These actions are automatically generated when fail2ban detects attack patterns such as brute force login attempts. The UID of the server where the fail2ban action occurred. The IP address that triggered the fail2ban action. The country name associated with the IP address. May be null for private or internal IP addresses. The ISO country code for the IP address. May be null for private or internal IP addresses. The type of attack that triggered the ban (e.g., SSH, HTTP, FTP). The network port involved in the attack. May be null if not applicable. Whether the IP address is currently banned by fail2ban. The timestamp when the action occurred, in ISO 8601 format. **Related models:** Server ### Example ```json { "server": "550e8400-e29b-41d4-a716-446655440000", "address": "192.168.1.45", "country": "United States", "country_code": "US", "attack": "SSH", "port": 22, "banned": true, "action_date": "2024-02-15T14:23:41Z" } ``` --- ## Alert URL: https://developers.cloud66.com/v3/models/alert/ Alert configuration objects define notification settings for various events within Cloud66. Alerts can be configured at the stack level or application group level, with support for multiple notification channels. The name of the alert to configure (e.g., "deployment_failed", "server_down", "deployment_success"). Array of subscription channel configurations that define how and where notifications are sent. ## Subscription Channels Each subscription object in the `subscriptions` array supports different notification channels: The notification channel type. Supported values: "email", "slack", "webhook", "browser". Required when channel is "slack". The Slack webhook URL for posting notifications. Required when channel is "webhook". The HTTP endpoint URL to receive webhook notifications. ## Channel Types - **email**: Basic email notifications sent to account users - **slack**: Notifications posted to Slack channels via webhook integration - **webhook**: HTTP POST notifications to custom endpoints - **browser**: In-browser notifications displayed in the Cloud66 dashboard ## Common Alert Types - **deployment_failed**: Triggered when stack deployments fail - **deployment_success**: Triggered when stack deployments succeed - **server_down**: Triggered when servers become unavailable - **server_up**: Triggered when servers come back online - **backup_failed**: Triggered when backup operations fail - **backup_success**: Triggered when backup operations succeed **Related models:** ApplicationGroup, Stack, Notification ### Example ```json { "alert_name": "deployment_failed", "subscriptions": [ { "channel": "email" }, { "channel": "slack", "slack_url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX" }, { "channel": "webhook", "webhook_url": "https://api.example.com/alerts" } ] } ``` --- ## ApplicationGroup URL: https://developers.cloud66.com/v3/models/application-group/ Application groups are logical collections of related stacks that can be managed together for configuration and monitoring purposes. They enable bulk operations like alert configuration across multiple stacks that share common characteristics. The unique identifier of the application group. The name of the application group (1-128 characters). The ID of the account that owns this application group. The ISO 8601 timestamp when the application group was created. The ISO 8601 timestamp when the application group was last updated. Array of rules that determine which stacks belong to this group (based on name, tag, branch, environment, or ID). Array of stacks that currently belong to this application group. **Grouping Rules:** Application groups can automatically include stacks based on various criteria: - **name**: Stack name patterns - **tag**: Stack tags - **branch**: Git branch names - **environment**: Environment names (e.g., production, staging) - **id**: Specific stack IDs **Use Cases:** - **Bulk Alert Configuration**: Set notification preferences for all stacks in a group - **Environment Management**: Group stacks by environment for consistent operations - **Team Organization**: Organize stacks by team or project ownership **Related models:** Stack, Alert ### Example ```json { "id": 5678, "name": "Production Apps", "account_id": 12345, "created_at": "2023-01-15T10:30:00Z", "updated_at": "2024-02-20T14:45:00Z", "rules": [ { "type": "environment", "value": "production" }, { "type": "tag", "value": "web-app" } ], "stacks": [ { "uid": "abc123def456", "name": "my-web-app" } ] } ``` --- ## ApplicationVariant URL: https://developers.cloud66.com/v3/models/application-variant/ Application variants enable advanced deployment strategies including blue-green deployments, canary releases, and preview environments. Each variant represents a different version of an application with specific traffic routing configuration. The name of the application variant. The unique identifier of the application variant. The Kubernetes namespace for this variant. The percentage of traffic routed to this variant (0-100). The name of the traffic split configuration. The current status of the variant (e.g., "active", "canary", "preview"). The git commit hash associated with this variant. The deployment session identifier. Array of DNS records associated with this variant. The ISO 8601 timestamp when the application variant was created. The ISO 8601 timestamp when the application variant was last updated. **Variant Types:** - **Active**: The current production version receiving 100% traffic - **Canary**: A rollout variant receiving a percentage of traffic for testing - **Blue/Green**: A rollout variant for blue-green deployments - **Preview**: A preview environment for testing changes **Related models:** Stack ### Example ```json { "name": "canary", "uid": "variant-456def789", "namespace": "my-app-canary", "traffic_percentage": 10, "traffic_split_name": "main-canary-split", "status": "canary", "git_hash": "a1b2c3d4e5f6", "deploy_session": "deploy-session-123", "dns_record": [ "canary.myapp.com", "test.myapp.com" ], "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:45:00Z" } ``` --- ## AsyncAction URL: https://developers.cloud66.com/v3/models/async-action/ AsyncActions track the progress and results of long-running background operations. They provide real-time status updates for operations like deployments, server reboots, database operations, and other asynchronous tasks. The unique identifier of the async action. The email address of the user who initiated the action. The type of resource being operated on (e.g., "Stack", "Server", "Database"). The name of the action being performed (e.g., "deploy", "restart", "database_create"). The database ID of the target resource. How the action was initiated (e.g., "api", "web", "hook"). The ISO 8601 timestamp when the action was started. The ISO 8601 timestamp when the action completed (null if still running). Whether the action completed successfully (null if still running). Human-readable completion message (null if still running). Structured result data containing operation-specific details (null if still running). Additional action-specific metadata and parameters. **Common Action Types:** - **deploy**: Stack deployment operations - **restart**: Server restart operations - **database_create**: Database creation - **database_delete**: Database deletion - **database_user_create**: Database user creation - **database_user_delete**: Database user deletion - **stack_reboot**: Stack server reboot operations **Stack Action Types:** - **clear_caches**: Clear all application caches for a stack - **maintenance_mode**: Enable or disable maintenance mode for a stack - **promote_slave_db**: Promote a slave database server to master - **resync_slave_db**: Re-sync a slave database server with its master - **disable_replication_slave_db**: Disable database replication for a slave server - **container_restart**: Restart a specific container - **service_restart**: Restart containers for a specific service - **service_pause**: Pause containers for a specific service - **service_resume**: Resume containers for a specific service - **process_restart**: Restart processes on stack servers - **process_pause**: Pause processes on stack servers - **process_resume**: Resume processes on stack servers **Related models:** Stack, Server, Database, User ### Example ```json { "id": 98765, "user": "john@example.com", "resource_type": "Stack", "action": "deploy", "resource_id": 12345, "started_via": "api", "started_at": "2024-01-15T10:30:00Z", "finished_at": "2024-01-15T10:45:00Z", "finished_success": true, "finished_message": "Deployment completed successfully", "finished_result": { "deploy_session": "deploy-session-123", "git_hash": "a1b2c3d4e5f6", "servers_deployed": 3 }, "metadata": { "git_ref": "main", "deployment_strategy": "rolling" } } ``` --- ## Backup URL: https://developers.cloud66.com/v3/models/backup/ Backups represent database backup snapshots that are managed by Cloud 66. These backups can be created automatically on a schedule or manually, and support various database types including MySQL, PostgreSQL, Redis, and MongoDB. The unique identifier of the backup. The UID of the server where this backup was created. The type of database backed up (mysql, postgresql, redis, or mongodb). The name of the database that was backed up. The base filename for the backup files. The date and time when the backup was taken, in ISO 8601 format. The status code of the backup operation (0 for success). The result message from the backup operation. The status code of any restore operation performed with this backup. The result message from any restore operation. The date and time the backup record was created, in ISO 8601 format. The date and time the backup record was last updated, in ISO 8601 format. The status code of the backup verification process. The result message from the backup verification. The storage location path where the backup files are stored. Comma-separated list of database tables that were excluded from the backup. The size of the backup in bytes. ### Example ```json { "id": 54321, "server_uid": "server-abc123", "db_type": "postgresql", "database_name": "myapp_production", "file_base": "backup_20240115_103000", "backup_date_iso": "2024-01-15T10:30:00Z", "backup_status": 0, "backup_result": "Backup completed successfully", "restore_status": 0, "restore_result": "Not restored", "created_at_iso": "2024-01-15T10:30:00Z", "updated_at_iso": "2024-01-15T10:35:00Z", "verify_status": 0, "verify_result": "Backup verified successfully", "storage_path": "/backups/postgresql/myapp_production/", "skip_tables": "temp_logs,cache_data", "backup_size": 1024000000 } ``` --- ## Cloud URL: https://developers.cloud66.com/v3/models/cloud/ Clouds represent the cloud providers available for deploying stacks. Each cloud provider has specific regions, server sizes, and configuration options. The internal identifier symbol for the cloud provider. The API key name used for this cloud provider. The user-friendly display name of the cloud provider. An array of available regions for this cloud provider. An array of available server sizes, each containing an id and name. The default server size for this cloud provider. The default region for this cloud provider. ### Example ```json { "name": "aws", "key_name": "aws_access_key", "display_name": "Amazon Web Services", "regions": [ "us-east-1", "us-west-2", "eu-west-1", "ap-southeast-1" ], "server_sizes": [ { "id": "t3.micro", "name": "t3.micro (1 vCPU, 1GB RAM)" }, { "id": "t3.small", "name": "t3.small (1 vCPU, 2GB RAM)" }, { "id": "t3.medium", "name": "t3.medium (2 vCPU, 4GB RAM)" } ], "default_size": "t3.small", "default_region": "us-east-1" } ``` --- ## Container URL: https://developers.cloud66.com/v3/models/container/ Containers represent Docker containers running on your servers, managed by Cloud 66. They contain information about the container's configuration, network settings, and health status. The unique Docker container ID. The name of the container. The UID of the server where this container is running. The name of the server where this container is running. The name of the service this container belongs to. The Docker image used to create this container. The command that the container executes when it starts. The date and time when the container was started, in ISO 8601 format. An array of port mappings for the container. The private IP address assigned to the container. The Docker network IP address of the container. The health status code of the container. A message describing the health status of the container. The source of the health check information. Whether output from this container is being captured. Whether this container should be restarted during deployments. The date and time the container record was created, in ISO 8601 format. The date and time the container record was last updated, in ISO 8601 format. The current status of the container (e.g., running, stopped). ### Example ```json { "uid": "container-abc123def456", "name": "web-app-container", "server_uid": "server-789xyz", "server_name": "web-server-01", "service_name": "web", "image": "myapp/web:v1.2.3", "command": "bundle exec puma -C config/puma.rb", "started_at": "2024-01-15T10:30:00Z", "ports": [ { "container": 3000, "http": 80, "https": 443 } ], "private_ip": "10.0.1.15", "docker_ip": "172.17.0.2", "health_state": 1, "health_message": "Container is running normally", "health_source": "docker", "capture_output": true, "restart_on_deploy": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:35:00Z", "status": "running" } ``` --- ## DatabaseUser URL: https://developers.cloud66.com/v3/models/database-user/ Database users represent user accounts within database server groups that have access to specific databases. They include authentication credentials and access permissions. The unique identifier of the database user. The unique identifier of the stack that owns this database user. The ID of the server group that hosts this database user. The username for database authentication. The host pattern from which the user can connect (e.g., "localhost", "%"). The password for database authentication (only returned when explicitly requested with appropriate permissions). The hashed password (only returned when explicitly requested with appropriate permissions). The ISO 8601 timestamp when the database user was created. The ISO 8601 timestamp when the database user was last updated. **Related models:** Database, Server Group, Stack ### Example ```json { "uid": "dbuser-789ghi012", "stack_uid": "stack-abc123", "server_group_id": 567, "username": "app_user", "host": "%", "password": "[REDACTED]", "password_hash": "[REDACTED]", "created_at_iso": "2023-01-15T10:30:00Z", "updated_at_iso": "2023-06-20T14:15:00Z" } ``` --- ## Database URL: https://developers.cloud66.com/v3/models/database/ Databases represent database instances within server groups that support database operations. They contain database-specific configuration, size metrics, and connection information. The unique identifier of the database. The unique identifier of the stack that owns this database. The ID of the server group that hosts this database. The name of the database. The collation setting for the database (e.g., "utf8mb4_unicode_ci"). The character encoding for the database (e.g., "utf8mb4"). The size of the database in bytes. The number of rows across all tables in the database. The ISO 8601 timestamp when the database was created. The ISO 8601 timestamp when the database was last updated. **Related models:** Server Group, Stack, Database User ### Example ```json { "uid": "database-456def789", "stack_uid": "stack-abc123", "server_group_id": 567, "database_name": "myapp_production", "collation": "utf8mb4_unicode_ci", "encoding": "utf8mb4", "size_bytes": 1073741824, "size_rows": 250000, "created_at_iso": "2023-01-15T10:30:00Z", "updated_at_iso": "2024-01-15T09:15:00Z" } ``` --- ## DeployContext URL: https://developers.cloud66.com/v3/models/deploy-context/ # DeployContext DeployContext represents the configuration and settings for a deployment operation on a stack. It contains all the parameters and options that control how a deployment is executed, including infrastructure updates, security patches, deployment strategies, and operational settings. Unique identifier for the deploy context. The ID of the stack this deploy context belongs to. Unique identifier string for the deploy context, automatically generated with format `dc-{hex}`. The type of deploy context, indicating the specific deployment strategy or framework being used. ISO8601 timestamp when the deploy context was created. ISO8601 timestamp when the deploy context was last updated. Whether to apply infrastructure upgrades during deployment. When true, servers may be updated with latest operating system packages and infrastructure components. Whether to apply security patches and updates during deployment. Focuses specifically on security-related package updates. ID of the associated async action that tracks the deployment operation's progress and status. Identifier of the user or system that authorized this deployment context. Whether to automatically update Docker versions during infrastructure upgrades. Only applies when `apply_infrastructure_upgrades` is true. The deployment strategy to use (e.g., rolling, parallel, serial). Defines how the deployment is executed across multiple servers. The type of deployment operation (e.g., redeploy, build, scale, revert). Determines the specific deployment workflow to execute. ID of the deployment profile containing predefined deployment settings and configurations. Whether to force infrastructure upgrades even if they might cause downtime. Only applies when `apply_infrastructure_upgrades` is true. ID of the associated GitHub deployment when triggered via GitHub integration. Whether servers should be rebooted after deployment if required by infrastructure or security updates. Identifier of the user or system that triggered this deployment. The method or interface used to trigger the deployment (e.g., web, api, webhook, git). Whether this deployment uses advanced configuration options or custom settings. ID of the scaler configuration used for auto-scaling deployments. Whether to create server snapshots before performing the deployment for rollback purposes. **Related models:** Stack, Async Action ### Example ```json { "id": 78901, "stack_id": 12345, "uid": "dc-a1b2c3d4e5f6", "type": "kubernetes", "created_at": "2024-02-15T09:30:00Z", "updated_at": "2024-02-15T10:15:00Z", "apply_infrastructure_upgrades": true, "apply_security_upgrades": true, "async_action_id": 55667, "authorized_by": "user-456", "auto_update_docker_versions": true, "deploy_strategy": "rolling", "deploy_type": "redeploy", "deployment_profile_id": 123, "force_infrastructure_upgrades": false, "github_deployment_id": 789012, "reboot_servers": false, "triggered_by": "john@example.com", "triggered_via": "webhook", "is_advanced": false, "scaler_id": 334, "take_server_snapshots": true } ``` --- ## Deployment URL: https://developers.cloud66.com/v3/models/deployment/ Deployments represent the deployment history and operations for your stacks. Each deployment tracks the git commit, trigger source, outcome, and timing information. The unique identifier of the deployment. The user or system that triggered this deployment. Information about how the deployment was triggered, including code and meaning (web, api, or hook). The date and time when the deployment started, in ISO 8601 format. The date and time when the deployment finished, in ISO 8601 format. The deployment outcome, including code and meaning (pending, success, or failed). The git commit hash for this deployment. The git reference (branch or tag) used for this deployment. The unique session identifier for this deployment. The type of deployment, including code and meaning (build, redeploy, scale, first_build, or revert). Whether this deployment is the current HEAD deployment. Whether this deployment is currently live. Whether this deployment has been reverted. The user who reverted this deployment, if applicable. The date and time when this deployment was reverted, in ISO 8601 format. Whether this deployment is currently in progress. The URL to view the git commit for this deployment. The UUID of the snapshot associated with this deployment. ### Example ```json { "id": 456789, "triggered_by": "john@example.com", "triggered_via": { "code": "web", "meaning": "Web Interface" }, "started_at": "2024-02-15T14:30:00Z", "finished_at": "2024-02-15T14:45:30Z", "outcome": { "code": "success", "meaning": "Successful" }, "git_hash": "a1b2c3d4e5f6789012345678901234567890abcd", "git_ref": "main", "deploy_session": "deploy-session-uuid-12345", "deploy_type": { "code": "redeploy", "meaning": "Redeploy" }, "is_head": true, "is_live": true, "reverted": false, "reverted_by": null, "reverted_at": null, "is_deploying": false, "commit_url": "https://github.com/example/repo/commit/a1b2c3d4e5f6789012345678901234567890abcd", "snapshot_uuid": "550e8400-e29b-41d4-a716-446655440000" } ``` --- ## DNS Provider URL: https://developers.cloud66.com/v3/models/dns-provider/ Represents a DNS provider configuration used for managing domain names and DNS records in Cloud66 stacks. DNS providers enable automatic DNS management for applications and services deployed on the platform. Unique identifier for the DNS provider configuration. DNS provider type (e.g., "cloudflare", "route53", "digitalocean", etc.). DNS provider key or identifier used for API authentication. Human-readable display name for the DNS provider configuration. ISO 8601 formatted timestamp indicating when the DNS provider was configured. ISO 8601 formatted timestamp indicating when the DNS provider configuration was last updated. ## Supported DNS Providers Cloud66 supports integration with various DNS providers: - **Cloudflare** - Full DNS management with CDN capabilities - **Amazon Route 53** - AWS-integrated DNS service - **DigitalOcean DNS** - DigitalOcean's managed DNS service - **Google Cloud DNS** - Google Cloud Platform DNS service - **Azure DNS** - Microsoft Azure DNS service - **Other providers** - Various additional DNS service providers ## DNS Management Features DNS providers enable: - **Automatic DNS Records** - Automatic creation of A, CNAME, and other DNS records - **SSL Certificate Integration** - DNS validation for SSL certificates - **Load Balancer Integration** - DNS records pointing to load balancers - **Failover Support** - DNS-based failover and health checking - **Geographic Routing** - Location-based DNS responses ## Configuration Requirements Each DNS provider requires specific configuration: - **API Credentials** - Authentication tokens or API keys - **Domain Access** - Permissions to manage DNS records for specific domains - **Provider-Specific Settings** - Configuration options specific to each DNS service ## Use Cases - **Domain Management** - Centralized DNS record management for applications - **SSL Automation** - Automated SSL certificate provisioning with DNS validation - **Multi-Region Deployments** - DNS routing for globally distributed applications - **Development Environments** - Dynamic DNS records for staging and testing environments **Related models:** Stack, Service ### Example ```json { "uuid": "550e8400-e29b-41d4-a716-446655440000", "type": "cloudflare", "key": "cf-api-key-abcdef123456", "display_name": "Cloudflare - Production Domain", "created_at": "2023-01-15T10:30:00Z", "updated_at": "2024-01-10T15:22:00Z" } ``` --- ## ElasticAddress URL: https://developers.cloud66.com/v3/models/elastic-address/ Elastic addresses (also known as failover groups) provide high availability by allowing IP addresses to be moved between primary and secondary stacks during failover operations. They enable zero-downtime maintenance and automatic disaster recovery. The unique identifier of the elastic address. The elastic IP address that can be switched between stacks. Which stack currently owns the IP address ("primary" or "secondary"). The unique identifier of the primary stack (null if not configured). The display name of the primary stack (null if not configured). The unique identifier of the secondary/backup stack (null if not configured). The display name of the secondary/backup stack (null if not configured). Whether a failover operation is currently in progress. Whether the current user can edit this elastic address. The ISO 8601 timestamp when the elastic address was created. The ISO 8601 timestamp when the elastic address was last updated. **Key Features:** - **High Availability**: Automatic IP switching during stack failures - **Zero-Downtime Maintenance**: Manual failover for maintenance windows - **Multi-Stack Support**: Primary and secondary stack configuration - **Real-time Status**: Live monitoring of failover operations **Related models:** Stack ### Example ```json { "uid": "elastic-abc123def456", "address": "192.168.1.100", "current_stack": "primary", "primary_stack_uid": "stack-primary-123", "primary_stack_name": "my-app-prod", "secondary_stack_uid": "stack-secondary-456", "secondary_stack_name": "my-app-prod-backup", "busy_toggling": false, "readonly": false, "created_at": "2023-01-15T10:30:00Z", "updated_at": "2024-01-10T09:45:00Z" } ``` --- ## Environment Variable URL: https://developers.cloud66.com/v3/models/environment-variable/ Environment variables are configuration values that can be set for your stacks. They can be used to store application settings, API keys, and other configuration data that your application needs. The unique identifier of the environment variable. The name of the environment variable. The value of the environment variable. Whether this environment variable is locked and cannot be modified. The date and time the environment variable was created, in ISO 8601 format. The date and time the environment variable was last updated, in ISO 8601 format. Whether this environment variable contains sensitive password data. Whether this environment variable was automatically generated by the system. An array of historical values for this environment variable, showing changes over time. ### Example ```json { "id": 7890, "key": "DATABASE_URL", "value": "postgresql://user:pass@localhost:5432/myapp_prod", "readonly": false, "created_at": "2023-01-15T10:30:00Z", "updated_at": "2024-01-10T14:20:00Z", "is_password": true, "is_generated": false, "history": [ { "value": "postgresql://user:pass@localhost:5432/myapp_prod", "created_at": "2024-01-10T14:20:00Z" }, { "value": "postgresql://user:oldpass@localhost:5432/myapp_prod", "created_at": "2023-01-15T10:30:00Z" } ] } ``` --- ## Failover Group URL: https://developers.cloud66.com/v3/models/failover-group/ Failover groups (formerly elastic addresses) provide high availability by managing automatic failover between primary and secondary stacks. They control traffic routing to ensure continuous service availability. The unique identifier of the failover group. The elastic IP address or DNS endpoint for the failover group. The identifier of the stack currently receiving traffic (primary or secondary). The UID of the primary stack in this failover group. The display name of the primary stack. The UID of the secondary (backup) stack in this failover group. The display name of the secondary (backup) stack. Whether the failover group is currently switching between stacks. Whether the current user has read-only access to this failover group. The date and time the failover group was created, in ISO 8601 format. The date and time the failover group was last updated, in ISO 8601 format. ### Example ```json { "uid": "failover-group-789xyz", "address": "production-app.mycompany.com", "current_stack": "primary", "primary_stack_uid": "stack-primary-abc123", "primary_stack_name": "production-web-app", "secondary_stack_uid": "stack-secondary-def456", "secondary_stack_name": "production-web-app-backup", "busy_toggling": false, "readonly": false, "created_at": "2023-01-15T10:30:00Z", "updated_at": "2024-01-05T16:45:00Z" } ``` --- ## Firewall Rule URL: https://developers.cloud66.com/v3/models/firewall-rule/ Firewall rules define network access controls for your servers. They specify which IP addresses, servers, or server groups can communicate on specific ports and protocols. The unique identifier of the firewall rule. The source IP address or CIDR block that traffic originates from. The ID of the source server group that traffic originates from. The UID of the source server that traffic originates from. The destination IP address or CIDR block that traffic is directed to. The ID of the destination server group that traffic is directed to. The UID of the destination server that traffic is directed to. The network protocol for this rule (tcp, udp, or icmp). The port or port range for this rule (e.g., "80", "443", "8000-8999"). The type of firewall rule (static, dynamic, or user). Optional comments or description for this firewall rule. The date and time the firewall rule was created, in ISO 8601 format. The date and time the firewall rule was last updated, in ISO 8601 format. ### Example ```json { "id": 789, "from_ip": "192.168.1.0/24", "from_group_id": null, "from_server_id": null, "to_ip": null, "to_group_id": 123, "to_server_id": null, "protocol": "tcp", "port": "443", "rule_type": "user", "comments": "Allow HTTPS traffic from office network", "created_at": "2024-01-20T09:15:00Z", "updated_at": "2024-02-10T16:30:00Z" } ``` --- ## Gateway URL: https://developers.cloud66.com/v3/models/gateway/ Gateways provide secure access points for connecting to your infrastructure. They act as bastion hosts or jump servers for SSH access to your servers. The unique identifier of the gateway. The name of the gateway. The username for connecting to the gateway. The public IP address or hostname of the gateway. The private IP address of the gateway within the network. The time-to-live for the gateway connection, in ISO 8601 format. A truncated preview of the gateway configuration content. The date and time the gateway was created, in ISO 8601 format. The date and time the gateway was last updated, in ISO 8601 format. The email of the user who created the gateway. The identifier of the user who last updated the gateway. ### Example ```json { "id": 567, "name": "production-gateway", "username": "gateway-user", "address": "gateway.example.com", "private_ip": "10.0.1.100", "ttl": "2024-02-16T14:30:00Z", "content": "Host production-gateway\n HostName gateway.example.com\n User gateway-user...", "created_at_iso": "2024-01-15T10:30:00Z", "updated_at_iso": "2024-02-15T12:45:00Z", "created_by": "admin@example.com", "updated_by": "admin@example.com" } ``` --- ## Image Repository URL: https://developers.cloud66.com/v3/models/image-repository/ Image repositories represent Docker container registries where your Docker images are stored. These can be public or private registries that your stacks use to pull container images. The unique identifier of the image repository. The URL of the image repository. The name of the image repository. The username for authenticating with the repository. The email address associated with the repository account. The date and time the repository was added, in ISO 8601 format. The date and time the repository was last updated, in ISO 8601 format. ### Example ```json { "id": 234, "url": "https://registry.hub.docker.com", "name": "docker-hub-repo", "username": "mycompany", "email": "devops@example.com", "created_at_iso": "2024-01-10T08:30:00Z", "updated_at_iso": "2024-02-05T14:20:00Z" } ``` --- ## Job URL: https://developers.cloud66.com/v3/models/job/ Jobs represent scheduled or background tasks that run on your stacks. They can be configured to run on specific schedules using cron expressions and perform various maintenance and operational tasks. The unique identifier of the job. The name of the job. The type of job, indicating its specific function. The cron expression defining when the job runs. The current status of the job. Whether the job is currently paused and not running on schedule. Additional parameters and configuration for the job. The date and time the job was created. The date and time the job was last updated. ### Example ```json { "uid": "job-550e8400-e29b-41d4-a716", "name": "daily-backup", "type": "backup", "cron": "0 2 * * *", "status": "active", "paused": false, "params": { "retention_days": 30, "compress": true, "target_location": "s3://backup-bucket/daily" }, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-10T09:15:00Z" } ``` --- ## Notification URL: https://developers.cloud66.com/v3/models/notification/ Notifications represent alert configurations and subscriptions for various events in your Cloud 66 infrastructure. They allow you to receive alerts about important system events and status changes. The name or type of the alert notification. An array of subscription configurations for this alert, defining who receives notifications and how. ### Example ```json { "alert_name": "deployment_failure", "subscriptions": [ { "type": "email", "target": "team@example.com", "enabled": true }, { "type": "slack", "target": "#alerts", "enabled": true, "webhook_url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX" } ] } ``` --- ## Pagination URL: https://developers.cloud66.com/v3/models/pagination/ Pagination metadata returned with list responses to help navigate through large result sets. The current page number (1-based). The next page number, or null if this is the last page. The previous page number, or null if this is the first page. The total number of items across all pages. The total number of pages available. ### Example ```json { "current": 2, "next": 3, "prev": 1, "count": 127, "pages": 7 } ``` --- ## Process URL: https://developers.cloud66.com/v3/models/process/ Processes are background processes that are running on your servers and are managed by Cloud 66. The MD5 hash is used to uniquely identify the process configuration and can be useful for caching or comparison purposes. The name of the process, such as "web", "worker", or "scheduler". This helps in identifying the role of the process within the application stack. This is the command that the process executes to perform its tasks. It typically includes the executable and any necessary arguments. A hash mapping server names to the number of instances of this process running on each server. This helps in understanding the distribution of the process across the infrastructure. ### Example ```json { "md5": "a1b2c3d4e5f6789012345678901234567890abcd", "name": "web", "command": "bundle exec puma -C config/puma.rb", "servers": { "web-server-01": 2, "web-server-02": 2, "web-server-03": 1 } } ``` --- ## Secret URL: https://developers.cloud66.com/v3/models/secret/ Represents a secure configuration value used for sensitive application data such as API keys, database passwords, and authentication tokens. Secrets can be defined at either the stack level or inherited from the account level. The secret key name used to reference this secret in configurations and applications. The encrypted secret value as stored in the system. This is the encrypted form for security purposes. The decrypted secret value. Handle with extreme care as this contains the actual sensitive data. Whether this secret is inherited from the account level (true) or defined at the stack level (false). ISO 8601 formatted timestamp when the secret was created. ISO 8601 formatted timestamp when the secret was last updated. ## Secret Inheritance Secrets can be configured at two levels: ### Account-Level Secrets - **Global scope** - Available to all stacks within the account - **Centralized management** - Manage common secrets in one place - **Inherited flag** - Marked with `inherited: true` - **Examples** - Third-party API keys, organization-wide credentials ### Stack-Level Secrets - **Stack-specific** - Only available to the specific stack - **Local overrides** - Can override inherited secrets with stack-specific values - **Inherited flag** - Marked with `inherited: false` - **Examples** - Database credentials, environment-specific tokens ## Security Considerations The `raw_value` field contains the actual decrypted secret value. Exercise extreme caution when accessing this field and ensure proper access controls and audit logging are in place. ### Encryption - **At rest** - All secret values are encrypted when stored - **In transit** - Secrets are transmitted over encrypted connections - **Access control** - Limited to authorized users and applications - **Audit logging** - Secret access and modifications are logged ## Use Cases - **Database credentials** - Connection strings and passwords - **API authentication** - Third-party service API keys and tokens - **Certificate keys** - Private keys for SSL/TLS certificates - **Encryption keys** - Application-level encryption keys - **Service credentials** - Authentication for external services ## Best Practices - **Minimal permissions** - Grant access only to users and applications that need it - **Regular rotation** - Regularly update secret values, especially for critical systems - **Environment separation** - Use different secrets for development, staging, and production - **Secret scanning** - Monitor for accidental secret exposure in code or logs **Related models:** Stack, User ### Example ```json { "key": "DATABASE_PASSWORD", "value": "encrypted:AES256:base64encodedencryptedvalue==", "raw_value": "mySecretPassword123!", "inherited": false, "created_at_iso": "2024-01-15T10:30:00Z", "updated_at_iso": "2024-02-10T14:25:00Z" } ``` --- ## Server Group URL: https://developers.cloud66.com/v3/models/server-group/ Server groups are logical collections of servers that share similar roles or purposes within a stack. They help organize and manage servers based on their function. The unique identifier of the server group. The display name of the server group. The type of server group, indicating its purpose or role. The date and time the server group was created, in ISO 8601 format. The date and time the server group was last updated, in ISO 8601 format. ### Example ```json { "id": 123, "name": "web-servers", "type": "web", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-10T12:15:00Z" } ``` --- ## Server URL: https://developers.cloud66.com/v3/models/server/ Servers represent the compute instances in your infrastructure, whether they are cloud servers or your own servers. They contain information about the server's configuration, location, and health status. The unique identifier of the server. The cloud provider's identifier for this server. The name of the server. The external IP address of the server. The Linux distribution running on the server. The version of the Linux distribution. The DNS record associated with this server. The username for SSH access to this server. The type of server (BYOS for Bring Your Own Server, or Cloud with provider name). An array of roles assigned to this server (e.g., web, db, docker). The ID of the server group this server belongs to. The UID of the stack this server belongs to. Whether the Cloud 66 agent is installed on this server. Additional parameters and metadata for the server. The date and time the server was created, in ISO 8601 format. The date and time the server was last updated, in ISO 8601 format. The cloud provider region where this server is located. The availability zone within the region. The external IPv4 address of the server. The internal IPv4 address of the server. The external IPv6 address of the server, if available. The internal IPv6 address of the server, if available. The health status code of the server. Whether this server uses personal SSH keys for multi-user access. Whether this server has a deploy gateway configured. The address of the deploy gateway, if configured. The username for the deploy gateway, if configured. ### Example ```json { "uid": "550e8400-e29b-41d4-a716-446655440001", "vendor_uid": "i-0123456789abcdef0", "name": "web-server-01", "address": "203.0.113.10", "distro": "ubuntu", "distro_version": "20.04", "dns_record": "web-01.example.com", "user_name": "cloud66", "server_type": "aws", "server_roles": ["web", "docker"], "server_group_id": 123, "stack_uid": "stack-550e8400-e29b-41d4-a716", "has_agent": true, "params": { "size": "t3.medium", "region": "us-east-1", "subnet": "subnet-12345" }, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:20:00Z", "region": "us-east-1", "availability_zone": "us-east-1a", "ext_ipv4": "203.0.113.10", "int_ipv4": "10.0.1.100", "ext_ipv6": "2001:db8::1", "int_ipv6": "fd00::1", "health_state": 1, "personal_key": false, "has_deploy_gateway": false, "deploy_gateway_address": null, "deploy_gateway_user_name": null } ``` --- ## Service URL: https://developers.cloud66.com/v3/models/service/ Services represent containerized applications or microservices running in your stack. They define the Docker images, commands, and configurations for your application components. The name of the service. An array of container objects that belong to this service, showing all running instances. The source type for the service image (e.g., git, image). The git reference (branch or tag) used for building this service. The Docker image name for this service. The unique identifier of the Docker image. The Docker image tag version. The command that the service containers execute when they start. The command used to build the Docker image for this service. The command executed during deployment of this service. The wrapper command used to execute the service in specific environments. For Kubernetes-based stacks, the desired number of replicas for this service. ### Example ```json { "name": "web", "containers": [ { "id": "container-123", "status": "running", "server_uid": "550e8400-e29b-41d4-a716-446655440001" }, { "id": "container-124", "status": "running", "server_uid": "550e8400-e29b-41d4-a716-446655440002" } ], "source_type": "git", "git_ref": "main", "image_name": "myapp/web", "image_uid": "sha256:1234567890abcdef", "image_tag": "latest", "command": "bundle exec rails server -b 0.0.0.0 -p 3000", "build_command": "bundle install && npm install && npm run build", "deploy_command": "bundle exec rake db:migrate", "wrap_command": null, "desired_count": 3 } ``` --- ## Session URL: https://developers.cloud66.com/v3/models/session/ Represents an interactive container session that provides shell access to running containers for debugging and troubleshooting purposes. Sessions enable developers to connect directly to containers in their stacks for real-time inspection and problem solving. Unique session identifier used to reference this specific session. Human-readable title or description for the session. Name of the service this session is connected to. Kubernetes namespace where the session container is running (for Kubernetes-based stacks). Command or shell that will be executed when the session starts (e.g., "/bin/bash", "/bin/sh"). Name of the deployment that contains the target container. Kubernetes pod name where the session is established (for Kubernetes-based stacks). Specific container name within the pod or deployment for multi-container scenarios. ## Session Types Sessions are created based on the stack type: ### Kubernetes Sessions - **Pod-based** - Connect to specific pods in deployments - **Namespace isolation** - Sessions operate within stack namespaces - **kubectl integration** - Uses Kubernetes APIs for session management ### Docker Sessions - **Container-based** - Connect directly to Docker containers - **Service targeting** - Sessions target specific service containers - **Docker integration** - Uses Docker APIs for container access ## Session Lifecycle 1. **Creation** - Session is requested for a specific service 2. **Provisioning** - Container connection is established 3. **Active** - Session is ready for interactive use 4. **Termination** - Session ends automatically or manually ## Use Cases - **Application Debugging** - Inspect running application processes - **Log Analysis** - Real-time log monitoring and analysis - **Configuration Inspection** - Examine runtime configuration files - **Performance Monitoring** - Monitor system resources and performance - **Database Operations** - Direct database client access - **File System Exploration** - Browse and modify container filesystem ## Security Considerations - **Permission-based Access** - Requires SSH key download permissions - **Session Limits** - Maximum concurrent sessions per service (typically 15) - **Audit Logging** - All session activities are logged for security - **Secure Connections** - All session traffic is encrypted **Related models:** Stack, Service, AsyncAction ### Example ```json { "uid": "session-550e8400-e29b-41d4-a716", "title": "Debug web service", "service_name": "web", "namespace": "myapp-production", "command": "/bin/bash", "deployment_name": "web-deployment", "pod_name": "web-deployment-7d4f8c6b5d-xyz12", "container_name": "web" } ``` --- ## SSL Certificate URL: https://developers.cloud66.com/v3/models/ssl-certificate/ Represents an SSL/TLS certificate used for securing web traffic in Cloud66 stacks. Certificates can be either manually uploaded or automatically provisioned through Let's Encrypt integration. Unique identifier for the SSL certificate. Certificate display name, typically the primary domain name. ID of the server group this certificate is associated with. Comma-separated list of domain names covered by this certificate. SHA256 fingerprint of the certificate for verification purposes. May be null if certificate parsing failed. Certificate Authority name (e.g., "Let's Encrypt") or null for manually uploaded certificates. Certificate type: "lets_encrypt" for automatically provisioned certificates or "manual" for externally obtained certificates. Whether this is a wildcard certificate (covers *.domain.com patterns). UUID of the DNS provider used for Let's Encrypt domain validation. Only applicable for Let's Encrypt certificates. SSL termination configuration setting. Whether an intermediate certificate is present in the certificate chain. Current certificate status (e.g., "active", "expired", "pending"). ISO 8601 formatted timestamp when the certificate was created. ISO 8601 formatted timestamp when the certificate was last updated. ISO 8601 formatted timestamp when the certificate expires. May be null if expiration cannot be determined. Always null in API responses for security reasons. Used only for certificate upload operations. Always null in API responses for security reasons. Used only for certificate upload operations. Always null in API responses for security reasons. Used only for certificate upload operations. ## Certificate Types ### Let's Encrypt Certificates - **Automatic provisioning** - Certificates are automatically obtained and renewed - **DNS validation** - Uses configured DNS providers for domain validation - **Free certificates** - No cost for basic SSL certificates - **Wildcard support** - Can provision wildcard certificates with DNS validation ### Manual Certificates - **External certificates** - Certificates obtained from any Certificate Authority - **Upload required** - Certificate, private key, and intermediate certificates must be uploaded - **Custom CA support** - Supports certificates from any trusted Certificate Authority - **Extended validation** - Can use EV and OV certificates ## Security Considerations Certificate private keys and certificate content are never exposed through the API for security reasons. The `certificate`, `key`, and `intermediate_certificate` fields are always null in API responses. ## Use Cases - **Web application security** - Securing HTTP traffic with SSL/TLS - **API endpoint protection** - Securing REST API endpoints - **Custom domain certificates** - Certificates for custom domains - **Wildcard domain coverage** - Single certificate for multiple subdomains **Related models:** DnsProvider, Stack, Server ### Example ```json { "uuid": "550e8400-e29b-41d4-a716-446655440000", "name": "example.com", "server_group_id": 123, "server_names": "example.com,www.example.com", "sha256_fingerprint": "A1:B2:C3:D4:E5:F6:78:90:AB:CD:EF:12:34:56:78:90:AB:CD:EF:12:34:56:78:90:AB:CD:EF:12:34:56:78:90:AB", "ca_name": "Let's Encrypt", "type": "lets_encrypt", "wildcard": false, "dns_provider_uuid": "dns-550e8400-e29b-41d4-a716", "ssl_termination": "nginx", "has_intermediate_cert": true, "status": "active", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T09:45:00Z", "expires_at": "2024-04-15T10:30:00Z", "certificate": null, "key": null, "intermediate_certificate": null } ``` --- ## Stack Setting URL: https://developers.cloud66.com/v3/models/stack-setting/ Stack settings operations return async action responses that track the progress and result of configuration changes to your stack settings. The unique identifier of the async action. The email of the user who initiated the action. The type of resource being modified (typically "stack" for settings). The specific action being performed on the stack settings. The ID of the resource being modified (stack ID for stack settings). How the action was initiated (e.g., "api", "web", "cli"). The date and time when the action started, in ISO 8601 format. The date and time when the action completed, in ISO 8601 format. Whether the action completed successfully. A message describing the result of the action. Detailed results of the completed action. Additional metadata associated with the action. ### Example ```json { "id": 78901, "user": "admin@example.com", "resource_type": "stack", "action": "update_settings", "resource_id": "stack-550e8400-e29b-41d4-a716", "started_via": "api", "started_at": "2024-02-15T10:30:00Z", "finished_at": "2024-02-15T10:32:45Z", "finished_success": true, "finished_message": "Stack settings updated successfully", "finished_result": { "updated_settings": ["maintenance_mode", "load_balancer_timeout"], "values_changed": 2 }, "metadata": { "settings_updated": { "maintenance_mode": false, "load_balancer_timeout": 30 } } } ``` --- ## Stack URL: https://developers.cloud66.com/v3/models/stack/ Stacks are the core organizational unit in Cloud 66, representing a complete application environment including servers, services, databases, and configurations. The unique identifier of the stack. The display name of the stack. The ID of the account that owns this stack. The git repository URL associated with the stack. The git branch or reference being deployed. The environment name for this stack (e.g., production, staging, development). The cloud provider name or "no_cloud" for BYOS stacks. The fully qualified domain name for the stack. The primary programming language of the stack. The framework used by the stack (e.g., rails, nodejs, docker). The current status code of the stack. The current health state code of the stack. The date and time of the last activity on the stack. The date and time of the last activity in ISO 8601 format. Whether the stack is currently in maintenance mode. Whether the stack has a load balancer configured. The date and time the stack was created, in ISO 8601 format. The date and time the stack was last updated, in ISO 8601 format. The deployment directory path on the servers. The status of cloud resources for this stack. The backend type for the stack. The implementation version of the stack. The current stack revision number. Whether the stack is currently performing an operation. The friendly name and email of the account owner. Whether this stack is a Kubernetes cluster. Whether this stack is deployed inside a cluster. The name of the cluster this stack belongs to, if applicable. The main application address for accessing the stack. The UUID namespace for the stack's configuration store. For Kubernetes stacks, the list of namespaces used. Important considerations or warnings about the stack state. The webhook URL for triggering redeployments (when exposed). ### Example ```json { "uid": "stack-550e8400-e29b-41d4-a716", "name": "my-production-app", "account_id": 12345, "git": "git@github.com:mycompany/myapp.git", "git_branch": "main", "environment": "production", "cloud": "aws", "fqdn": "myapp.example.com", "language": "ruby", "framework": "rails", "status": 1, "health": 3, "last_activity": "2024-02-15 14:30:00 UTC", "last_activity_iso": "2024-02-15T14:30:00Z", "maintenance_mode": false, "has_loadbalancer": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:30:00Z", "deploy_directory": "/var/deploy/myapp", "cloud_status": "deployed", "backend": "kubernetes", "version": "4", "revision": "42", "is_busy": false, "account_name": "Production Team (team@example.com)", "is_cluster": false, "is_inside_cluster": true, "cluster_name": "production-cluster", "application_address": "https://myapp.example.com", "configstore_namespace": "550e8400-e29b-41d4-a716-446655440000", "namespaces": ["myapp-production", "myapp-staging"], "considerations": { "warnings": [], "notices": ["Stack is healthy"] }, "redeploy_hook": "https://hooks.cloud66.com/stacks/redeploy/abc123def456" } ``` --- ## Tag URL: https://developers.cloud66.com/v3/models/tag/ Tags allow you to label and organize your infrastructure components like servers and load balancers. They provide a flexible way to categorize and manage resources across your stacks. The type of entity being tagged (e.g., "server", "loadbalancer"). The unique identifier of the entity being tagged. An array of tag objects, each containing a value and reserved flag indicating if it's a system-reserved tag. The date and time the tags were first created, in ISO 8601 format. The date and time the tags were last updated, in ISO 8601 format. ### Example ```json { "entity_type": "server", "entity_id": "550e8400-e29b-41d4-a716-446655440001", "tags": [ { "value": "production", "reserved": false }, { "value": "web-tier", "reserved": false }, { "value": "managed-by-cloud66", "reserved": true } ], "created_at_iso": "2024-01-15T10:30:00Z", "updated_at_iso": "2024-02-10T14:25:00Z" } ``` --- ## User URL: https://developers.cloud66.com/v3/models/user/ Users represent individual user accounts in Cloud 66. Users can belong to multiple accounts with different roles and permissions. The unique identifier of the user. The email address of the user. The ID of the user's primary account. An array of account roles showing all accounts this user has access to. Whether the user account is locked. The user's access profile including account profile, stack profiles, and ACLs. Whether the user has two-factor authentication enabled. The user's preferred timezone. Whether the user has a validated phone number. Whether the user is part of the developer program. Whether the user logs in using GitHub authentication. The date and time of the user's last login, in ISO 8601 format. An array of devices registered for this user. The date and time the user account was created, in ISO 8601 format. The date and time the user account was last updated, in ISO 8601 format. The status of the user's cloud provider connections. ### Example ```json { "id": 12345, "email": "john@example.com", "primary_account_id": 67890, "accounts": [ { "id": 67890, "role": "owner", "name": "Production Team" }, { "id": 98765, "role": "admin", "name": "Development Team" } ], "locked": false, "access_profile": { "account_profile": "admin", "stack_profiles": ["deployment", "monitoring"], "acls": ["read", "write", "deploy"] }, "uses_tfa": true, "timezone": "America/New_York", "has_valid_phone": true, "developer_program": false, "github_login": true, "last_login": "2024-02-15T09:30:00Z", "devices": [ { "id": "device-123", "name": "MacBook Pro", "trusted": true } ], "created_at": "2023-06-15T10:30:00Z", "updated_at": "2024-02-15T09:30:00Z", "cloud_status": "connected" } ``` --- ## Watched File URL: https://developers.cloud66.com/v3/models/watched-file/ Watched files represent files that are being monitored for changes on your servers. Cloud66 tracks these files for integrity monitoring and can alert you when important configuration or application files are modified. The UID of the server where the file is being monitored. The absolute path to the monitored file on the server. Whether the file has been modified since the last check. Changes are detected through file modification time, size, or checksum comparison. The date and time when monitoring for this file was set up, in ISO 8601 format. The date and time of the last status check for this file, in ISO 8601 format. **Related models:** Server ### Example ```json { "server": "550e8400-e29b-41d4-a716-446655440001", "file_path": "/etc/nginx/nginx.conf", "is_changed": false, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-02-15T14:25:00Z" } ``` --- ## Workflow URL: https://developers.cloud66.com/v3/models/workflow/ Represents an automated workflow configuration that defines custom deployment processes and CI/CD pipelines. Workflows allow for complex, multi-step automation beyond the default Cloud66 deployment process. Unique identifier for the workflow (UUID format). Human-readable name of the workflow. Indicates whether this is the default workflow for the associated formation or stack. Array of tag strings associated with this workflow for organization and filtering. Workflow definition body containing the actual workflow YAML configuration (only included when full_content=true). ISO 8601 formatted timestamp indicating when the workflow was created. ISO 8601 formatted timestamp indicating when the workflow was last updated. ## Workflow Configuration The `body` field contains YAML configuration that defines: - **Steps** - Individual tasks and commands to execute - **Dependencies** - Step execution order and prerequisites - **Conditions** - When and how steps should execute - **Environment** - Variables and settings for execution - **Notifications** - Alert configurations for workflow events ## Default Workflows When `default` is `true`, this workflow serves as the primary automation process for deployments. Non-default workflows can be triggered manually or by specific conditions. ## Workflow Execution Workflows are executed as part of: - **Deployment Pipelines** - Automated deployment processes - **Manual Triggers** - On-demand workflow execution - **Event-Based Triggers** - Triggered by specific stack or formation events - **Scheduled Runs** - Time-based workflow execution ## Use Cases - **Custom Deployment Steps** - Beyond standard Cloud66 deployment process - **Integration Testing** - Automated testing during deployments - **Database Migrations** - Coordinated database updates - **External Service Integration** - Calling external APIs or services - **Multi-Environment Promotion** - Coordinating deployments across environments **Related models:** Pipeline, Formation, Stack ### Example ```json { "uid": "workflow-550e8400-e29b-41d4-a716", "name": "production-deployment", "default": true, "tags": ["production", "deployment", "rails"], "body": "version: '1'\nsteps:\n - name: run-tests\n command: bundle exec rspec\n on_success: deploy\n - name: deploy\n command: cap production deploy\n notifications:\n - type: slack\n channel: '#deployments'", "created_at_iso": "2024-01-15T10:30:00Z", "updated_at_iso": "2024-02-10T16:45:00Z" } ``` --- ## Cloud 66 Client Libraries URL: https://developers.cloud66.com/v3/sdks/sdks/ Cloud 66 provides client libraries to help you integrate with our API more easily. Currently, we maintain an official SDK for Go, with community contributions welcome for other languages. ## Official SDK ### Go We provide an official Go client library that offers a complete interface to the Cloud 66 API: - **Repository**: [cloud66-oss/cloud66](https://github.com/cloud66-oss/cloud66) - **Features**: Full API coverage, multiple authentication methods, and comprehensive Cloud 66 platform support - **Installation**: `go get github.com/cloud66-oss/cloud66` The SDK supports multiple authentication methods: - Cloud 66 Toolbelt token (stored in `~/.cloud66/cx.json`) - Personal Access Token from your Cloud 66 account - Custom token file location ```go import "github.com/cloud66-oss/cloud66" // Get client (uses default Toolbelt token) client := cloud66.GetClient("", "", "") // List your stacks stacks, err := client.StackList() if err != nil { log.Fatal(err) } // Work with your stacks for _, stack := range stacks { fmt.Printf("Stack: %s (%s)\n", stack.Name, stack.Environment) } ``` ## Community Libraries While we don't maintain official SDKs for other languages, the Cloud 66 API is a standard REST API that can be consumed by any HTTP client. Many community members have created unofficial libraries for various languages. ## Building Your Own Client If no SDK exists for your preferred language, you can easily build one using our comprehensive API documentation. Our REST API supports: - **Authentication**: OAuth 2.0 and API tokens - **Standard HTTP methods**: GET, POST, PUT, DELETE - **JSON responses**: Consistent data format across all endpoints - **Error handling**: Standard HTTP status codes with detailed error messages ### Getting Started 1. Choose your preferred HTTP client library 2. Implement authentication (see our [Authentication guide](/v3/getting-started/authentication)) 3. Start with basic operations like listing stacks 4. Refer to our API reference for endpoint details We welcome contributions of community SDKs and are happy to link to well-maintained libraries in other languages.