Skip to main content
DELETE
/
v2
/
accounts
/
{account_id}
/
members
/
{user_id}
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()
  userID := uuid.New()

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

  // Remove the member from the account by user ID
  response, httpResp, err := client.AccountsAPI.RemoveAccountMember(ctx, accountID, userID)
  if err != nil {
    log.Fatalf("Error removing account member: %v", err)
  }

  if httpResp.StatusCode == 200 {
    fmt.Printf("✅ Account member removed! 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": "Operation completed successfully"
}

Authorizations

Authorization
string
header
required

API key for authentication

Path Parameters

account_id
string<uuid>
required

Account ID

user_id
string<uuid>
required

User ID

Response

Member removed successfully

message
string
required

Success message