# Organization Accounts ## Get organization accounts `client.Organizations.OrganizationAccounts.Get(ctx, organizationID, query) (*[]OrganizationAccountGetResponse, error)` **get** `/organizations/{organization_id}/accounts` Retrieve a list of accounts that belong to a specific organization. (Currently in Closed Beta - see https://developers.cloudflare.com/fundamentals/organizations/) ### Parameters - `organizationID string` - `query OrganizationAccountGetParams` - `AccountPubname param.Field[OrganizationAccountGetParamsAccountPubname]` - `Contains string` (case-insensitive) Filter the list of accounts to where the account_pubname contains a particular string. - `EndsWith string` (case-insensitive) Filter the list of accounts to where the account_pubname ends with a particular string. - `StartsWith string` (case-insensitive) Filter the list of accounts to where the account_pubname starts with a particular string. - `Direction param.Field[OrganizationAccountGetParamsDirection]` Sort direction for the order_by field. Valid values: `asc`, `desc`. Defaults to `asc` when order_by is specified. - `const OrganizationAccountGetParamsDirectionAsc OrganizationAccountGetParamsDirection = "asc"` - `const OrganizationAccountGetParamsDirectionDesc OrganizationAccountGetParamsDirection = "desc"` - `Name param.Field[OrganizationAccountGetParamsName]` - `Contains string` (case-insensitive) Filter the list of accounts to where the name contains a particular string. - `EndsWith string` (case-insensitive) Filter the list of accounts to where the name ends with a particular string. - `StartsWith string` (case-insensitive) Filter the list of accounts to where the name starts with a particular string. - `OrderBy param.Field[OrganizationAccountGetParamsOrderBy]` Field to order results by. Currently supported values: `account_name`. When not specified, results are ordered by internal account ID. - `const OrganizationAccountGetParamsOrderByAccountName OrganizationAccountGetParamsOrderBy = "account_name"` - `PageSize param.Field[int64]` The amount of items to return. Defaults to 10. - `PageToken param.Field[string]` An opaque token returned from the last list response that when provided will retrieve the next page. Parameters used to filter the retrieved list must remain in subsequent requests with a page token. ### Returns - `type OrganizationAccountGetResponseEnvelopeResult []OrganizationAccountGetResponse` - `ID string` - `CreatedOn Time` - `Name string` - `Settings OrganizationAccountGetResponseSettings` - `AbuseContactEmail string` - `AccessApprovalExpiry Time` - `APIAccessEnabled bool` - `DefaultNameservers string` Use [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-list-dns-settings) instead. Deprecated. - `EnforceTwofactor bool` - `UseAccountCustomNSByDefault bool` Use [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-list-dns-settings) instead. Deprecated. - `Type OrganizationAccountGetResponseType` - `const OrganizationAccountGetResponseTypeStandard OrganizationAccountGetResponseType = "standard"` - `const OrganizationAccountGetResponseTypeEnterprise OrganizationAccountGetResponseType = "enterprise"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/organizations" ) func main() { client := cloudflare.NewClient( option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) organizationAccounts, err := client.Organizations.OrganizationAccounts.Get( context.TODO(), "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8", organizations.OrganizationAccountGetParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", organizationAccounts) } ``` #### Response ```json { "errors": [], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "id", "created_on": "2019-12-27T18:11:19.117Z", "name": "name", "settings": { "abuse_contact_email": "abuse_contact_email", "access_approval_expiry": "2019-12-27T18:11:19.117Z", "api_access_enabled": true, "default_nameservers": "default_nameservers", "enforce_twofactor": true, "use_account_custom_ns_by_default": true }, "type": "standard" } ], "result_info": { "next_page_token": "next_page_token", "total_size": 0 }, "success": true } ``` ## Domain Types ### Organization Accounts - `type OrganizationAccounts struct{…}` - `ID string` Identifier - `Name string` Account name - `Type OrganizationAccountsType` - `const OrganizationAccountsTypeStandard OrganizationAccountsType = "standard"` - `const OrganizationAccountsTypeEnterprise OrganizationAccountsType = "enterprise"` - `CreatedOn Time` Timestamp for the creation of the account - `ManagedBy OrganizationAccountsManagedBy` Parent container details - `ParentOrgID string` ID of the parent Organization, if one exists - `ParentOrgName string` Name of the parent Organization, if one exists - `Settings OrganizationAccountsSettings` 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