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/

Get My Companies

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

Get the list of your companies.
  • Authorization: Requires user authorization token for specific user with verified email address
  • Content type: application/json; charset=utf-8
  • Accept: application/json
  • Response: List of Company objects
Request Example:
1
GET https://<account_subdomain>.wixanswers.com/api/v1/companies/my

Validate URLs Before Adding as Companies

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

Validate URLs as valid, invalid, or duplicates (of already added companies) before adding them as companies.

  • Authorization: Requires agent authorization token and permission FETCH_COMPANIES
  • Content type: application/json; charset=utf-8
  • Accept: application/json
  • Response: Map of URLs to statuses, see below
Payload Params
Description
Type
Required
domains
List of domains to validate.
List of strings

Max 10.

Payload Example:
1
2
3
4
5
POST https://<tenant_subdomain>.wixanswers.com/api/v1/companies/emailDomains/check

{
  "domains":["company1.com","company2.com"]
}
The response includes the validation status for each URL:
  • 0: Valid and non-duplicate domain
  • 10: Duplicate of existing company's domain
  • 20: Invalid domain

Response Example:
1
2
3
4
{
  "company1.com":0,
  "company2.com":10
}

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

contactEmailAddresses
Company contact email addresses, each one a structure of:
* email (string)
* name (string)
List of structures

Max 10.

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
30
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"
  },
  "contactEmailAddresses": [
    {
      "name": "John Q",
      "email": "johnq@company1.com"
    },
    {
      "name": "Cynthia B",
      "email": "cynthiab@company1.com"
    }
  ]
}

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
20
21
22
23
24
25
26
27
28
29
30
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"
    },
    "contactEmailAddresses": [
      {
        "name": "John Q",
        "email": "johnq@company1.com"
      },
      {
        "name": "Cynthia B",
        "email": "cynthiab@company1.com"
      }
    ]
}

Update a Company's Custom Fields

PUT https://<tenant_subdomain>.wixanswers.com/api/v1/companies/{company 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:
* <custom field GUID>: The field id
* <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/companies/77bc8694-5ccf-436c-ab2b-543563a5f425/fields

{
    "merge": false,
    "customFields": {
      "bd948e62-a3fd-4cf0-87f3-ee6a0ae7f3fa":5,
      "e932c0a3-6e9b-43cf-b3a9-0ae790f6ee6a":"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.
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/companies/search/admin

Get the list of companies matching criteria.
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

accountManagerIds
Filter by account manager IDs (agents)
List of GUIDs

Max 50.

customFieldFilters
Filter using a map of user custom field values; a structure of one or more fields and values, each one as follows:
* <API field name> (string): The API name of the field (auto-generated; see Finding a Custom Field Name)
* <Custom Field values / range> (format depends on the field):
  * fromDate (Date string)
  * toDate (Date string)
  * from (long)
  * to (long)
  * values (list)
  * text (string)
  * searchType (integer):
    * Contains (2)
    * No contains (3)
  * bool (Boolean)
Structure

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
* 80: company customer permission, ascending
* 90: company customer permission, 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.

toCreationDate
Filter by companies created on or before this date.

fromLastUpdateDate
Filter by companies last updated on or after this date.

toLastUpdateDate
Filter by companies last updated on or before this date.

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/companies/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
}