> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://api.docs.modulards.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.docs.modulards.com/_mcp/server.

# Show site certificate

GET https://api.modulards.com/api/public/v1/sites/{site}/certificate

Returns the site's SSL certificate summary as a `site-certificates` JSON:API resource (a computed structure wrapping the site, not a stored model): `200` with `{"data": {"type": "site-certificates", "id": "<site id>", "attributes": {...}}, "jsonapi": {"version": "1.1"}}`. The document id is the website's own id; there is no separate `site_id` attribute.

`attributes`, in order: `configured` (boolean), `enabled` (boolean|null), `ssl_status` (`up` / `down` / `unknown` / null), `issuer` (`{cn, o, c, ou}`|null), `subject` (`{cn, o, c, ou}`|null), `valid_from` (string|null), `valid_to` (string|null), `days_until_expiry` (integer|null, negative once expired), `protocol` (string|null, e.g. `TLSv1.3`) and `sans` (string array|null).

Path variable `site` is the exact site id (e.g. `12345`). A site without a certificate service answers 200 with `configured: false` and every other attribute null.

This endpoint accepts **no query parameters at all**: any key (`filter`, `sort`, `page`, `include`, `fields`, anything) answers 422. Sites of other organizations — and members without the certificate read permission — answer 404. A read-only token is enough. The MCP twin of this endpoint is the `sites-certificate-show` tool.

Reference: https://api.docs.modulards.com/modular-ds-public-api/security-health/show-site-certificate

## Authentication

- `Authorization` header (bearer token, required) — Personal access token created in the Modular DS dashboard; read-only tokens can only call GET endpoints.

## Request

### Path parameters

- `site` (string, required)

## Response

### 200

200 - Certificate

- `data` (object, optional)
  - `attributes` (object, optional)
    - `configured` (boolean, optional)
    - `days_until_expiry` (double, optional)
    - `enabled` (boolean, optional)
    - `issuer` (object, optional)
      - `c` (string, optional)
      - `cn` (string, optional)
      - `o` (string, optional)
      - `ou` (any, optional, nullable)
    - `protocol` (string, optional)
    - `sans` (list of string, optional)
    - `ssl_status` (string, optional)
    - `subject` (object, optional)
      - `c` (any, optional, nullable)
      - `cn` (string, optional)
      - `o` (any, optional, nullable)
      - `ou` (any, optional, nullable)
    - `valid_from` (string, optional)
    - `valid_to` (string, optional)
  - `id` (string, optional)
  - `links` (object, optional)
    - `self` (string, optional)
  - `type` (string, optional)
- `jsonapi` (object, optional)
  - `version` (string, optional)

## Examples

**Response**

```json
{
  "data": {
    "attributes": {
      "configured": true,
      "days_until_expiry": 39,
      "enabled": true,
      "issuer": {
        "c": "US",
        "cn": "R11",
        "o": "Let's Encrypt",
        "ou": null
      },
      "protocol": "TLSv1.3",
      "sans": [
        "acme-corp.com",
        "www.acme-corp.com"
      ],
      "ssl_status": "up",
      "subject": {
        "c": null,
        "cn": "acme-corp.com",
        "o": null,
        "ou": null
      },
      "valid_from": "2026-08-01 00:00:00",
      "valid_to": "2026-10-30 12:00:00"
    },
    "id": "101",
    "links": {
      "self": "https://api.modulards.com/api/public/v1/sites/101/certificate"
    },
    "type": "site-certificates"
  },
  "jsonapi": {
    "version": "1.1"
  }
}
```

**SDK Code**

```python 200 - Certificate
import requests

url = "https://api.modulards.com/api/public/v1/sites/site/certificate"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript 200 - Certificate
const url = 'https://api.modulards.com/api/public/v1/sites/site/certificate';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go 200 - Certificate
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.modulards.com/api/public/v1/sites/site/certificate"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 200 - Certificate
require 'uri'
require 'net/http'

url = URI("https://api.modulards.com/api/public/v1/sites/site/certificate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java 200 - Certificate
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.modulards.com/api/public/v1/sites/site/certificate")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php 200 - Certificate
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.modulards.com/api/public/v1/sites/site/certificate', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp 200 - Certificate
using RestSharp;

var client = new RestClient("https://api.modulards.com/api/public/v1/sites/site/certificate");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift 200 - Certificate
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/sites/site/certificate")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```