Skip to main content
GET
/
v2
/
accounts
/
{account_id}
/
members
AhaSend Go SDK
package main

import (
  "context"
  "fmt"
  "log"

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

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

  accountID := uuid.New()

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

  // List the members of the account
  response, httpResp, err := client.AccountsAPI.GetAccountMembers(ctx, accountID)
  if err != nil {
    log.Fatalf("Error listing account members: %v", err)
  }

  // Check response
  if httpResp.StatusCode == 200 {
    fmt.Printf("✅ Retrieved account members! Status: %d\n", httpResp.StatusCode)
    if response != nil {
      fmt.Printf("Found %d account members\n", len(response.Data))
      for _, member := range response.Data {
        fmt.Printf("- User: %s, Role: %s\n", member.UserID, member.Role)
      }
    }
  } else {
    fmt.Printf("❌ Unexpected status code: %d\n", httpResp.StatusCode)
  }
}
{
  "object": "list",
  "data": [
    {
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    }
  ]
}

Authorizations

Authorization
string
header
required

API key for authentication

Path Parameters

account_id
string<uuid>
required

Account ID

Response

List of account members

object
enum<string>
required

Object type identifier

Available options:
list
data
object[]
required

Array of account members