## Create an account `client.Accounts.New(ctx, body) (*Account, error)` **post** `/accounts` Create an account (only available for tenant admins at this time) ### Parameters - `body AccountNewParams` - `Name param.Field[string]` Account name - `Type param.Field[AccountNewParamsType]` - `const AccountNewParamsTypeStandard AccountNewParamsType = "standard"` - `const AccountNewParamsTypeEnterprise AccountNewParamsType = "enterprise"` - `Unit param.Field[AccountNewParamsUnit]` information related to the tenant unit, and optionally, an id of the unit to create the account on. see https://developers.cloudflare.com/tenant/how-to/manage-accounts/ - `ID string` Tenant unit ID ### Returns - `type Account struct{…}` - `ID string` Identifier - `Name string` Account name - `Type AccountType` - `const AccountTypeStandard AccountType = "standard"` - `const AccountTypeEnterprise AccountType = "enterprise"` - `CreatedOn Time` Timestamp for the creation of the account - `ManagedBy AccountManagedBy` Parent container details - `ParentOrgID string` ID of the parent Organization, if one exists - `ParentOrgName string` Name of the parent Organization, if one exists - `Settings AccountSettings` Account settings - `AbuseContactEmail string` Sets an abuse contact email to notify for abuse reports. - `EnforceTwofactor bool` Indicates whether membership in this account requires that Two-Factor Authentication is enabled ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/accounts" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) account, err := client.Accounts.New(context.TODO(), accounts.AccountNewParams{ Name: cloudflare.F("name"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", account.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "name": "Demo Account", "type": "standard", "created_on": "2014-03-01T12:21:02.0000Z", "managed_by": { "parent_org_id": "4536bcfad5faccb111b47003c79917fa", "parent_org_name": "Demo Parent Organization" }, "settings": { "abuse_contact_email": "abuse_contact_email", "enforce_twofactor": true } } } ```