# Ssl

> Source: https://developers.cloud66.com/v3/webhooks/ssl/

## 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"
  }
}
```
