> ## Documentation Index
> Fetch the complete documentation index at: https://docs.advay.ca/llms.txt
> Use this file to discover all available pages before exploring further.

# Increment hits (POST)

> One of X-Auth-Token header or token query is required.

Increment the counter for an id and return the updated value.

Authentication

* Send your secret via `X-Auth-Token` header or `?token=` query.

Before you test

* Use your own deployment URL (e.g., `https://<project>.vercel.app`) and your secret token from the server env (`SECRET_TOKEN`).
* The public instance at `https://nums.advay.ca` is read-friendly; incrementing requires your own secret.

Example (self-hosted)

```bash theme={null}
curl -H "X-Auth-Token: $SECRET_TOKEN" "https://<project>.vercel.app/hit?id=home"
```

Tip

* Viewing counts does not require any token. See `/count` and `/count.txt`.


## OpenAPI

````yaml POST /hit
openapi: 3.0.3
info:
  title: nums API
  version: 1.0.0
  description: Simple hit counter and badge service.
servers:
  - url: https://nums.advay.ca
security: []
paths:
  /hit:
    post:
      summary: Increment and return hits for an id (POST)
      description: One of X-Auth-Token header or token query is required.
      parameters:
        - in: query
          name: id
          schema:
            type: string
          description: Counter id (default home)
        - in: header
          name: X-Auth-Token
          schema:
            type: string
          required: false
          description: >-
            Secret token for authentication (required unless token query
            provided)
        - in: query
          name: token
          schema:
            type: string
          required: false
          description: Secret token (alternative to header)
        - in: query
          name: url
          schema:
            type: string
          required: false
          description: Optional custom deployment URL (defaults to https://nums.advay.ca)
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  hits:
                    type: integer
                  source:
                    type: string
                    description: Optional source indicator (redis or memory)
        '401':
          description: Unauthorized

````