Skip to main content
POST
/
v2
/
accounts
/
{account_id}
/
sub-accounts
/
{sub_account_id}
/
unsuspend
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()
  subAccountID := uuid.New()

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

  // Unsuspend the sub account
  response, httpResp, err := client.SubAccountsAPI.UnsuspendSubAccount(ctx, accountID, subAccountID)
  if err != nil {
    log.Fatalf("Error unsuspending sub account: %v", err)
  }

  if httpResp.StatusCode == 200 {
    fmt.Printf("✅ Sub account unsuspended! Status: %d\n", httpResp.StatusCode)
    if response != nil {
      fmt.Printf("Sub Account ID: %s\n", response.ID)
      fmt.Printf("Status: %s\n", response.Status)
    }
  } else {
    fmt.Printf("❌ Unexpected status code: %d\n", httpResp.StatusCode)
  }
}
{
  "object": "sub_account",
  "id": "2f3c5d2a-9ef8-4c91-a5f4-79990c8c1d3a",
  "parent_account_id": "9d0cf9d0-4f5e-4674-bcf1-8ec39968b6e1",
  "name": "Acme Subsidiary",
  "website": "acme.example.com",
  "status": "active",
  "monthly_credit": 0,
  "created_at": "2024-01-01T00:00:00Z",
  "domain_count": 2,
  "member_count": 3,
  "last_activity_at": "2024-01-15T12:00:00Z"
}
Platform Partner feature: Sub Accounts is part of our Platform Partner capabilities and is currently in early access. Contact us to enable it on your account.

Authorizations

Authorization
string
header
required

API key for authentication

Path Parameters

account_id
string<uuid>
required

Parent account ID

sub_account_id
string<uuid>
required

Sub account ID

Response

Sub account unsuspended successfully

object
enum<string>
required

Object type identifier

Available options:
sub_account
id
string<uuid>
required

Unique identifier for the sub account

parent_account_id
string<uuid>
required

Parent account ID

created_at
string<date-time>
required

When the sub account was created

name
string
required

Sub account name

website
string<fqdn>
required

Account website domain

Maximum string length: 255
status
enum<string>
required

Current sub-account status

Available options:
active,
suspended,
parent-suspended,
deleted
monthly_credit
integer<int64>
required

Optional monthly cap; 0 means no cap

Required range: x >= 0
domain_count
integer<int64>
required

Number of domains owned by the sub account

Required range: x >= 0
member_count
integer<int64>
required

Number of direct members on the sub account

Required range: x >= 0
last_activity_at
string<date-time> | null
required

Last recorded sub-account email activity