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

# Stats

GET http://localhost:8000/api/v1/stats

Returns template/certificate counts for current tenant.

Scope: `stats.read`

Reference: https://developer-docs.certifly-seven.com/certifly-seven-gateway-api/health-stats/stats

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Certifly Seven Gateway API
  version: 1.0.0
paths:
  /api/v1/stats:
    get:
      operationId: stats
      summary: Stats
      description: |-
        Returns template/certificate counts for current tenant.

        Scope: `stats.read`
      tags:
        - subpackage_healthStats
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Health & Stats_Stats_Response_200'
servers:
  - url: http://localhost:8000
components:
  schemas:
    Health & Stats_Stats_Response_200:
      type: object
      properties:
        tenant_id:
          type: string
        templates_count:
          type: integer
        certificates_count:
          type: integer
      required:
        - tenant_id
        - templates_count
        - certificates_count
      title: Health & Stats_Stats_Response_200
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## SDK Code Examples

```python Health & Stats_Stats_example
import requests

url = "http://localhost:8000/api/v1/stats"

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

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

print(response.json())
```

```javascript Health & Stats_Stats_example
const url = 'http://localhost:8000/api/v1/stats';
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 Health & Stats_Stats_example
package main

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

func main() {

	url := "http://localhost:8000/api/v1/stats"

	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 Health & Stats_Stats_example
require 'uri'
require 'net/http'

url = URI("http://localhost:8000/api/v1/stats")

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

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

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

```java Health & Stats_Stats_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("http://localhost:8000/api/v1/stats")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Health & Stats_Stats_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'http://localhost:8000/api/v1/stats', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Health & Stats_Stats_example
using RestSharp;

var client = new RestClient("http://localhost:8000/api/v1/stats");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Health & Stats_Stats_example
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8000/api/v1/stats")! 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()
```