GET
/
v2
/
ping
AhaSend Go SDK
package main

import (
  "context"
  "fmt"
  "log"

  "github.com/AhaSend/ahasend-go/api"
)

func main() {
  // Create API client with authentication
  client := api.NewAPIClient(
    api.WithAPIKey("aha-sk-your-64-character-key"),
  )

  // Create context for the API call
  ctx := context.Background()

  // Call the ping endpoint
  response, httpResp, err := client.UtilityAPI.Ping(ctx)
  if err != nil {
    log.Fatalf("Error pinging API: %v", err)
  }

  // Check response
  if httpResp.StatusCode == 200 {
    fmt.Printf("✅ Ping successful! Status: %d\n", httpResp.StatusCode)
    if response != nil && response.Message != "" {
        fmt.Printf("Response: %s\n", response.Message)
    }
  } else {
    fmt.Printf("❌ Unexpected status code: %d\n", httpResp.StatusCode)
  }
}
{
  "message": "pong"
}
The ping endpoint is a simple health check, particularly useful for:
  • API Key Validation: Test if your API key is valid without performing any other operations
  • Service Health Monitoring: Check if the AhaSend API is available for automated monitoring systems
  • Connection Testing: Verify network connectivity before sending important emails
  • Integration Testing: Validate your authentication setup during development

Authentication

This endpoint requires a valid API key with any scope. It’s the most permissive endpoint in the API, making it ideal for basic connectivity testing without requiring specific permissions.

Authorizations

Authorization
string
header
required

API key for authentication

Response

200
application/json

Pong response

The response is of type object.