Skip to content
Docs

Quickstart in six steps.

From the API key to offline verification and the MCP client. Replace the variables and run in order.

API key → send → status → proof-bundle → verify → MCP

  1. 01environment variables

    Authenticate with an API key

    Export the key you receive at onboarding. Every /v1/* route requires Authorization: Bearer.

    environment variables
    export MAILACK_API_KEY="mlk_..."
    export MAILACK_API_URL="https://api.mailack.com"
    
    # Cada petición lleva la clave en Authorization.
    curl -s "$MAILACK_API_URL/v1/messages" \
      -H "Authorization: Bearer $MAILACK_API_KEY" \
      -H "Accept: application/json"
  2. 02POST /v1/messages

    Send the first message

    POST /v1/messages with Idempotency-Key. Keep the id from the response; you use it in the next steps.

    POST /v1/messages
    MESSAGE_ID=$(curl -s -X POST "$MAILACK_API_URL/v1/messages" \
      -H "Authorization: Bearer $MAILACK_API_KEY" \
      -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{
        "from": "noreply@acme.mx",
        "to": "cliente@ejemplo.com",
        "subject": "Primer mensaje",
        "html": "<p>Hola desde mailack.</p>"
      }' | jq -r .id)
    
    echo "$MESSAGE_ID"
  3. 03GET /v1/messages/{id}

    Check its status

    GET /v1/messages/{id} returns delivery status, events and message metadata.

    GET /v1/messages/{id}
    curl -s "$MAILACK_API_URL/v1/messages/$MESSAGE_ID" \
      -H "Authorization: Bearer $MAILACK_API_KEY" | jq .
  4. 04GET /v1/messages/{id}/proof-bundle

    Download the proof bundle

    GET /v1/messages/{id}/proof-bundle. Includes the canonical hash, inclusion proof and, when present, the PSC certificate.

    GET /v1/messages/{id}/proof-bundle
    curl -s "$MAILACK_API_URL/v1/messages/$MESSAGE_ID/proof-bundle" \
      -H "Authorization: Bearer $MAILACK_API_KEY" \
      -o bundle.json
    
    # Campos de la constancia del PSC en el bundle:
    # certificate_id, serial_number, policy_oid, algorithm_oid, sealed_at
    jq '{certificate_id, serial_number, sealed_at}' bundle.json
  5. 05./bin/mailack-verify

    Verify offline

    Run mailack-verify against the bundle and, if you have it, the original .eml. No network required.

    ./bin/mailack-verify
    ./bin/mailack-verify bundle.json -eml mensaje.eml
    
    # Sin el .eml solo valida hash del bundle, inclusión Merkle y raíz vs constancia.
    ./bin/mailack-verify bundle.json
  6. 06mcpServers.mailack

    Connect the MCP server

    Register mailack-mcp in your MCP client. The agent can send, query, verify and operate through the exposed tools.

    mcpServers.mailack
    {
      "mcpServers": {
        "mailack": {
          "command": "./bin/mailack-mcp",
          "env": {
            "MAILACK_API_KEY": "mlk_...",
            "MAILACK_API_URL": "https://api.mailack.com"
          }
        }
      }
    }

Full API reference

The complete OpenAPI reference is delivered at onboarding. This page is the shortest path to a first verified proof bundle.