---
title: "API: createOrganization"
slug: "api-createorganization"
updated: 2022-08-31T18:03:58Z
published: 2022-08-31T18:03:58Z
canonical: "support.smarteru.com/api-createorganization"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.smarteru.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API: createOrganization

- Starting June 1, 2022, SmarterU will require all API calls to POST to HTTPS. Any POST to HTTP will result in the SU:01 error (i.e., No POST data detected.).
- If you are viewing the help in a language other than English, please change your language to English before copying and pasting any code. All API attributes and functions are in English.
- Tags are required unless specified.

## Description

The createOrganization method [adds an organization](/v1/docs/adding-an-organization) [](https://help.smarteru.com/about-organizations$top_of_page).

## Who Has Access

The following users have access to the createOrganization method:

- Users with the [Manage Organizations](/v1/docs/account-permission-manage-organizations) account permission.
- [Administrators and owners](/v1/docs/user-profile-information#access-level).

## API Call XML Package

```markup
<SmarterU>
   <AccountAPI>![CDATA[]]</AccountAPI>
   <UserAPI>![CDATA[]]</</UserAPI>
   <Method>getUserGroups</Method>
   <Parameters>

      <Organization>
         <Name><![CDATA[]]></Name>
         <Email><![CDATA[]]></Email>
         <CompanyID><![CDATA[]]></CompanyID>
         <Status><![CDATA[]]></Status>
         <PhonePrimary><![CDATA[]]></PhonePrimary>
         <PhoneAlternate><![CDATA[]]></PhoneAlternate>
         <Fax><![CDATA[]]></Fax>
         <Website><![CDATA[]]></Website>
         <Address1><![CDATA[]]></Address1>
         <Address2><![CDATA[]]></Address2>
         <City><![CDATA[]]></City>
         <PostalCode><![CDATA[]]></PostalCode>
         <Province><![CDATA[]]></Province>
         <Country><![CDATA[]]></Country>

         <CustomFields>
            <CustomField>
               <CustomFieldName><![CDATA[]]></CustomFieldName>
               <CustomFieldValue><![CDATA[]]></CustomFieldValue>
            </CustomField>
         </CustomFields>

       </Organization>

   </Parameters>
</SmarterU>
```

## Organization Tag Group

The Organization tag group is a container for the organization's details.

```markup
<Organization>
   <Name><![CDATA[]]></Name>
   <Email><![CDATA[]]></Email>
   <CompanyID><![CDATA[]]></CompanyID>
   <Status><![CDATA[]]></Status>
   <PhonePrimary><![CDATA[]]></PhonePrimary>
   <PhoneAlternate><![CDATA[]]></PhoneAlternate>
   <Fax><![CDATA[]]></Fax>
   <Website><![CDATA[]]></Website>
   <Address1><![CDATA[]]></Address1>
   <Address2><![CDATA[]]></Address2>
   <City><![CDATA[]]></City>
   <PostalCode><![CDATA[]]></PostalCode>
   <Province><![CDATA[]]></Province>
   <Country><![CDATA[]]></Country>

   <CustomFields>
      <CustomField>
         <CustomFieldName><![CDATA[]]></CustomFieldName>
         <CustomFieldValue><![CDATA[]]></CustomFieldValue>
      </CustomField>
   </CustomFields>
</Organization>
```

The Organization tag may contain the following.

### **Name**

The [organization's name](/v1/docs/organization-organization-information#organization-name-required).

### Email (optional)

The [organization's email address](/v1/docs/organization-contact-information#email).

### CompanyID (optional)

The [organization's user-specified identifier](/v1/docs/organization-organization-information#organization-id).

### Status (optional)

The [organization's status](/v1/docs/organization-organization-information#status). Acceptable values are *Active* or *Inactive*.

### PhonePrimary (optional)

The [organization's primary phone number](/v1/docs/organization-contact-information#phone-primary).

### PhoneAlternate (optional)

The [organization's alternate phone number](/v1/docs/organization-contact-information#phone-alternate).

### Fax (optional)

The [organization's fax number](/v1/docs/organization-contact-information#fax).

### Website (optional)

The [URL of the organization's website](/v1/docs/organization-contact-information#website).

### Address1 (optional)

The [first line of the organization's physical address](/v1/docs/organization-contact-information#address-line-1).

### Address2 (optional)

The [second line of the organization's physical address](/v1/docs/organization-contact-information#address-line-2).

### City (optional)

The [city where the organization is located](/v1/docs/organization-contact-information#city).

### PostalCode (optional)

The [postal code where the organization is located](/v1/docs/organization-contact-information#postalzip-code).

### Province (optional)

The [province where the organization is located](/v1/docs/organization-contact-information#region).

### Country (optional)

The [country where the organization is located](/v1/docs/organization-contact-information#country).

### CustomFields (optional)

A container for assigning values to custom organization fields. Refer to [CustomFields Tag Group](/v1/docs/api-createorganization#customfields-tag).

## CustomFields Tag

The CustomFields tag group is a container for assigning values to custom organization fields.

```markup
<CustomFields>
   <CustomField>
      <CustomFieldName><![CDATA[]]></CustomFieldName>
      <CustomFieldValue><![CDATA[]]></CustomFieldValue>
   </CustomField>
</CustomFields>
```

Each [custom organization field](/v1/docs/account-custom-organization-fields) is contained in a CustomField tag and contains the following.

### CustomFieldName

The [custom organization field's name](https://support.smarteru.com/docs/account-custom-organization-fields#name). This is the Name returned by the [listCustomFields](/v1/docs/api-listcustomfields) method.

### CustomFieldValue

The value you want to assign the custom organization field specified in the [CustomFieldName](/v1/docs/api-createorganization#customfieldname) tag.

## API Response XML Package

The [API response XML package](/v1/docs/api-response-xml-package) will always include a Result, Info, and [Errors](/v1/docs/api-createorganization#error-codes) tag.

```markup
<SmarterU>
   <Result></Result>
   <Info>
      <Organization><![CDATA[]]></Organization>
   </Info>
   <Errors>
      <Error>
         <ErrorID></ErrorID>
         <ErrorMessage></ErrorMessage>
      </Error>
   </Errors>
</SmarterU>
```

The response may also contain the following.

### Organization

The [organization's name](/v1/docs/organization-organization-information#organization-name-required).

### Example API Response XML Package

Below is an example of an API response XML package.

```markup
<SmarterU>
   <Result>Success</Results>
   <Info>
       <Organization><![CDATA[Top Toe Distributors]]></Organization>
   </Info>

   <Errors>
   </Errors>
</SmarterU>
```

## **Error Codes**

| Error Code | Message |
| --- | --- |
| CO:01 | The name provided is not valid. |
| CO:02 | The email address provided is not valid. |
| CO:03 | The company id provided is not valid. |
| CO:04 | The status provided is not valid. |
| CO:05 | The primary phone number provided is not valid. |
| CO:06 | The alternate phone number provided is not valid. |
| CO:07 | The fax provided is not valid. |
| CO:08 | The website provided is not valid. |
| CO:09 | The address 1 provided is not valid. |
| CO:10 | The address 2 provided is not valid. |
| CO:11 | The city provided is not valid. |
| CO:12 | The postal code provided is not valid. |
| CO:13 | The province provided is not valid. |
| CO:14 | The country provided is not valid. |
| CO:15 | A custom field name provided is not valid. |
| CO:16 | A custom field value provided is not valid. |
| CO:17 | The required permissions are not met to call the createOrganization method. |
| CO:19 | Organization name cannot be used. |

## Related

- [Account: Custom Organization Fields](/account-custom-organization-fields.md)
- [Adding an Organization](/adding-an-organization.md)
- [API: getOrganization](/api-getorganization.md)
- [API: listCustomFields](/api-listcustomfields.md)
- [API: listOrganizations](/api-listorganizations.md)
- [Organizations](/organizations.md)
