Companies API

The companies API enables you to manage companies. You associate companies with users and can use companies to filter when searching for users and to automatically assign tickets to the relevant account managers (agents). Companies can be configured with a domain, logo, followers, and an account manager. 

Get List of Companies

GET https://<tenant_subdomain>.wixanswers.com/api/v1/companies

Get the list of all companies.
Request Example:
1
GET https://<account_subdomain>.wixanswers.com/api/v1/companies/

Add Company

POST https://<tenant_subdomain>.wixanswers.com/api/v1/companies

Add a company. Also see Add Companies in Bulk.
Payload Params
Description
Type
Required
name
The company name
String
settings


Company settings:
* +emailDomainSettings (structure)
* +accountManagerSettings (structure) 
* followers (array of integers): List of agents who are notified about users associated with this company. Max 10.
Structure


+emailDomainSettings

Domain settings, structure of:

* emailDomain (string): Company's email domain
* autoAssociateUsers (Boolean): Whether to automatically associate this company with new users with this domain in their email addresses
Structure


+accountManagerSettings

Account manager settings: the account manager is the agent who manage tickets from users associated with this company. A structure of:

* accountManagerId (GUID): Agent ID
* autoAssignTickets (Boolean): Whether to automatically assign tickets from these users to this agent
Structure

info
General settings, structure of:

* logo (string): URL of company logo
* description (string): Company description
* externalId (string): Relevant only for tenants supporting SSO - the external ID in the tenant’s SSO auth system
Structure

customFields
Map of company custom field values, each field entry a structure of:
* <API field name> (string): The API name of the field (auto-generated; see Finding a Custom Field Name)
* <Custom Field value> (format depends on the field)
Structure

Payload Example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
POST https://<tenant_subdomain>.wixanswers.com/api/v1/companies

{
  "name":"Company1",
  "settings":{
    "emailDomainSettings":{
      "emailDomain":"company1.com",
      "autoAssociateUsers":true
    },
    "accountManagerSettings":{
      "accountManagerId":"e932c0a3-6e9b-43cf-b3a9-90f6ee6a5b07",
      "autoAssignTickets":true
    },
    "followers":["e932c0a3-6e9b-43cf-b3a9-90f6ee6a5b05"]
  },
  "info":{
    "logo":"https://a.com/company1.jpg",
    "description":"Company One"
  }
}

Add Companies in Bulk

POST https://<tenant_subdomain>.wixanswers.com/api/v1/companies/bulk

Add up to 100 companies at once. Also see Add Company.
Importing a Large Number of Records
To import a large number of companies, such as your initial company database, contact Wix Answers for assistance.
Payload Params
Description
Type
Required
companies
The company information, a list of between 1 and 100 "Add Company" structures.
Structure

override
When true, the import process updates any fields in matched companies. When false, no changes are made to matched companies.
Boolean

The default is false.

Payload Example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
POST https://<tenant_subdomain>.wixanswers.com/api/v1/companies/bulk

{
  "companies":
  [
    {
      "name":"Company1",
      "settings":{
        "emailDomainSettings":{
           "emailDomain":"company1.com",
           "autoAssociateUsers":true
         },
         "accountManagerSettings":{
           "accountManagerId":"e932c0a3-6e9b-43cf-b3a9-90f6ee6a5b07",
           "autoAssignTickets":true
         },
         "followers":["e932c0a3-6e9b-43cf-b3a9-90f6ee6a5b05"]
      },
      "info":{
        "logo":"https://a.com/company1.jpg",
        "description":"Company One"
      }
    }, // end of first company
    {
      "name":"Company2",
      ...
    }  // end of second company
  ]
}

Get Company Information

GET https://<tenant_subdomain>.wixanswers.com/api/v1/companies/{company GUID}

Get a company's information. The company ID is available in the Company object.
Request Example:
1
GET https://<account_subdomain>.wixanswers.com/api/v1/companies/e932c0a3-6e9b-43cf-b3a9-90f6ee6a5b06

Update Company

PUT https://<tenant_subdomain>.wixanswers.com/api/v1/companies/{company GUID}

Update a company's information. The company GUID is available in the company object. See Important Information about Updating Using the API.

Note that you cannot update a company's custom fields using this method. See Update a Company's Custom Fields.

See Add Company for payload information.
Payload Example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
PUT https://<tenant_subdomain>.wixanswers.com/api/v1/companies/eef2c0a3-6e9b-43cf-b3a9-0ae790f6ebbb

{
    "name":"Company1",
    "settings":{
        "emailDomainSettings":{
            "emailDomain":"company1.com",
            "autoAssociateUsers":true
        },
        "accountManagerSettings":{
            "accountManagerId":"e932c0a3-6e9b-43cf-b3a9-90f6ee6a5b07",
            "autoAssignTickets":true
        },
        "followers":["e932c0a3-6e9b-43cf-b3a9-90f6ee6a5b05"]},
        "info":{
            "logo":"https://a.com/company1.jpg",
            "description":"Company One"
        }
}

Update a Company's Custom Fields

PUT https://<tenant_subdomain>.wixanswers.com/api/v1/companies/{agent GUID}/fields

Update custom field values for a company record. For information about configuring the available custom fields for a company, see Custom Fields API.
Merge
Unlike most update scenarios in Wix Answers (see Important Information about Updating Structures Using the API), when updating company custom fields you can specify whether all existing custom field values are first removed, or whether the new values sent with this API call are added to the existing values.
Payload Params
Description 
Format
Required
customFields
A map of new field values, each mapping containing:
* <generated field name>: The field name generated by Wix Answers
* <new value>: The new value in the relevant format
Structure
merge
Whether to add the new values but leave any existing values that are not being replaced (true), or to first remove all existing custom field values and then add the new values (false).
Boolean

Payload Example:
1
2
3
4
5
6
7
8
9
PUT https://<tenant_subdomain>.wixanswers.com/api/v1/comapnies/77bc8694-5ccf-436c-ab2b-543563a5f425/fields

{
    "merge": false,
    "customFields": {
      "digitField":5,
      "stringField":"new value"
    }
}

Delete Company

DELETE https://<tenant_subdomain>.wixanswers.com/api/v1/companies/{company GUID}

Delete a company. If any users are associated with the company, they are no longer associated to any company. Deleting a company has no effect on any tickets.
  • Authorization: Requires admin authorization level
  • Content type: application/json; charset=utf-8
  • Accept: application/json
  • Response: none
Request Example:
1
DELETE https://<account_subdomain>.wixanswers.com/api/v1/companies/e932c0a3-6e9b-43cf-b3a9-90f6ee6a5b06

Search Companies

POST https://<tenant_subdomain>.wixanswers.com/api/v1/search/admin

Get the list of companies matching criteria.
  • Authorization: Requires agent authorization level
  • Content type: application/json; charset=utf-8
  • Accept: application/json
  • Response: Structure including list of Company objects
Payload Params
Description
Type
Required
companyName
Return only the company matching this name.
String

companyIds
Filter by company IDs.
List of GUIDs

externalIds
Filter by company external IDs.
List of strings

companySortType
Return results sorted by:
* 10: best match to search string
* 20: company name, ascending (default)
* 30: company name, descending
* 40: creation date, ascending
* 50: creation date, descending
* 60: last update date, ascneding
* 70: last update date, descending
Integer

timeZone
Filter by companies in this time zone ??.
Long time zone name string, for example America/Denver

fromCreationDate
Filter by companies created on or after this date.
yyyy-MM-dd

toCreationDate
Filter by companies created on or before this date.
yyyy-MM-dd

fromLastUpdateDate
Filter by companies last updated on or after this date.
yyyy-MM-dd

toLastUpdateDate
Filter by companies last updated on or before this date.
yyyy-MM-dd

pageSize
The number of results to return on each page.
Integer, between 1 and 30. Default is 10.

page
The page of results to return.
Integer, 1 or greater. Default is 1.

Payload Example:
1
2
3
4
5
6
7
POST https://<tenant_subdomain>.wixanswers.com/api/v1/search/admin

{
    "companySortType":20,
    "pageSize":20,
    "page":1
}
Response Example:
1
2
3
4
5
6
7
8
9
{
  "items": [ List of @Company objects ],
  "itemsCount": 108,
  "page": 2,
  "numPages": 22,
  "previousPage": 1,
  "nextPage": 3,
  "pageSize": 5
}

Related Articles

Adding a Company to Your Contacts

Add a company to your Contacts so you can associate its individual employee contacts. When you associate contacts with a company, you can manage all their tickets from their Companies Page. You can also set SLA policies, assign account managers, add agents as followers, and more.Important:To add a company to your Contacts, you must be an administrator or have a custom role with the relevant actions enabled in the Contacts - Manage Companies permission.  To add a company to your Contacts: Hover over Contacts in the side panel and click Companies.  Click + Add Company.  Add the company's information: Enter the Company Name. Enter a Description of the company.  Enter the Email Domain of the company (e.g. Wix.com). Note: Leave Associate new users with email in this domain to this company checked to associate new contacts with the company if their email address ends with the Email Domain.   Add a company logo: Click + Add under Company Logo. Click Upload new image.  Select a file from your computer and click Open. (Optional) Click the Default SLA Policy drop-down and select an SLA policy to apply to the company's tickets. Learn more about creating SLA policies.  (Optional) Set an agent as the company's account manager: Click Set account manager for this company. Click the drop-down menu and select an agent.  (Optional) Leave Assign tickets from this company to the account manager checked to automatically assign tickets from the company to the account manager.  (Optional) Click Set company followers and select an agent from the drop-down menu to automatically notify them when there are updates to the company's tickets. Note: Add more followers by clicking the drop-down menu and selecting additional agents.  Click Create. Tip:You can edit an existing company from its Company Page. Learn More

2 min read