openapi: 3.0.0
info:
title: Yext API
version: '2.0'
servers:
- url: https://api.yextapis.com/v2
paths:
/accounts/{accountId}/entities:
get:
operationId: listEntities
parameters:
- schema:
minLength: 0
type: string
name: accountId
in: path
required: true
- schema:
minLength: 0
type: string
description: A date in `YYYYMMDD` format.
name: v
in: query
required: true
- schema:
minLength: 0
type: string
description: |
Optional parameter to return fields of type **Markdown** as HTML.
- `false`: **Markdown** fields will be returned as JSON
- `true`: **Markdown** fields will be returned as HTML
name: convertMarkdownToHTML
in: query
required: false
- schema:
minLength: 0
type: string
description: |
Optional parameter to return fields of type **Rich Text** as HTML.
- `false`: **Rich Text** fields will be returned as JSON
- `true`: **Rich Text** fields will be returned as HTML
name: convertRichTextToHTML
in: query
required: false
- schema:
minLength: 0
type: string
description: |
Comma-separated list of Entity types to filter on. Example: `"location,event"`
Should be from the following types:
* `atm`
* `event`
* `faq`
* `financialProfessional`
* `healthcareFacility`
* `healthcareProfessional`
* `hotel`
* `hotelRoomType`
* `job`
* `location`
* `organization`
* `product`
* `restaurant`
OR the API name of a custom entity type.
name: entityTypes
in: query
required: false
- schema:
minLength: 0
type: string
description: Comma-separated list of field names. When present, only the fields listed will be returned. You can use dot notation to specify substructures (e.g., `"address.line1"`). Custom fields are specified in the same way, albeit with their `c_*` name.
name: fields
in: query
required: false
- schema:
minLength: 0
type: string
description: |
This parameter represents one or more filtering conditions that are applied to the set of entities that would otherwise be returned. This parameter should be provided as a URL-encoded string containing a JSON object.
For example, if the filter JSON is `{"name":{"$eq":"John"}}`, then the filter param after URL-encoding will be: `filter=%7B%22name%22%3A%7B%22%24eq%22%3A%22John%22%7D%7D`
**Basic Filter Structure**
The filter object at its core consists of a *matcher*, a *field*, and an *argument*.
For example, in the following filter JSON:
```
{
"name":{
"$eq":"John"
}
}
```
`$eq` is the *matcher*, or filtering operation (equals, in this example),
`name` is the *field* being filtered by, and
`John` is *value* to be matched against.
**Combining Multiple Filters**
Multiple filters can be combined into one object using *combinators*. For example, the following filter JSON combines multiple filters using the combinator `$and`. `$or` is also supported.
```
{
"$and":[
{
"firstName":{
"$eq":"John"
}
},
{
"countryCode":{
"$in":[
"US",
"GB"
]
}
}
]
}
```
**Filter Negation**
Certain filter types may be negated. For example:
```
{
"$not": {
"name": {
"$eq": "John"
}
}
}
```
This can also be written more simply with a `!` in the `$eq` parameter. The following filter would have the same effect:
```
{
"name":{
"!$eq":"John"
}
}
```
**Filter Complement**
You can also search for the complement of a filter. This filter would match entities that do not contain "hello" in their descriptions, or do not have a description set. This is different from negation which can only match entities who have the negated field set to something.
```
{
"$complement":{
"description":{
"$contains":"hello"
}
}
}
```
**Addressing Subfields**
Subfields of fields can be addressed using the "dot" notation while filtering. For example, if you have a custom field called **`c_myCustomField`**:
```
{
"c_myCustomField":{
"age": 30,
"name": "Jim",
}
}
```
While filtering, subfields may be addressed using the "dot" notation.
```
{
"c_myCustomField.name":{
"!$eq":"John"
}
}
```
Fields that are nested deeper may be addressed using dot notation, as well. For example, if **`name`** in the above example was a compound field with two subfields **`first`** and **`last`**, **`first`** may be addressed as **`c_myCustomField.name.first`**.
**Field Support**
Entity fields correspond to certain filter types, which support matchers. Going by the example above, the field **`name`** supports the `TEXT` filter type, which supports `$eq` (equals) and `$startsWith` (starts with).
**TEXT**
The `TEXT` filter type is supported for text fields. (e.g., **`name`**, **`countryCode`**)
| Filter Type |
Syntax |
Description |
| Full |
fieldName: {contains: $search} |
$search is the search string |
| Text |
fieldName: {$type: [$search,...]} |
$type is one of [contains,doesNotContain,startsWith,equalTo], $search is an array of search strings, combined with OR |
| Text |
fieldName: $type |
$type is one of [empty,notEmpty] |
| Number |
fieldName: {$type: $value} |
$type is one of [eq,lt,gt,le,ge], $value is the numeric value |
| Number |
fieldName: {$type: [$value1, $value2]} |
$type is one of [between], $value1 and $value2 are numeric values |
| Date |
fieldName: {$type: $value} |
$type is one of [eq,lt,gt,le,ge], $value is a string of "YYYY-MM-DD" formatted date |
| Date |
fieldName: $type |
$type is one of [empty,notEmpty] |
| Date |
fieldName: {$type: [$value1, $value2]} |
$type is one of [between], $value1 and $value2 are strings of "YYYY-MM-DD" formatted date |
| Categories |
fieldName: {$type: [$id,...]} |
$type is one of [includes,notIncludes], $id is an array of numeric category IDs, combined with OR |
| Categories |
fieldName: $type |
$type is one of [none] |
| Assets |
fieldName: {$type: [$id,...]} |
$type is one of [includes,notIncludes], $id is an array of numeric category IDs, combined with OR |
| Assets |
fieldName: $type |
$type is one of [none] |
| Country |
fieldName: {$type: [$country,...]} |
$type is one of [includes,notIncludes], $country is an array of country code strings, combined with OR |
| PrimaryLanguage |
fieldName: {$type: [$language,...]} |
$type is one of [is,isNot], $language is an array of language code strings, combined with OR |
| AlternateLanguage |
fieldName: {$type: [$language,...]} |
$type is one of [includes, notIncludes], $language is an array of language code strings, combined with OR |
| StringSingle |
fieldName: {$type: [$string,...]} |
$type is one of [is,isNot], $string is an array of strings, combined with OR |
| StringList |
fieldName: {$type: [$string,...]} |
$type is one of [includes,notIncludes], $string is an array of strings, combined with OR |
| LocationType |
fieldName: {$type: [$id,...]} |
$type is one of [is,isNot], $id is an array of location type IDs, combined with OR |
| Bool |
fieldName: $type |
$type is one of [true,false] |
| Option |
fieldName: {$type: $id} |
$type is one of [is,isNot], $id is an option ID (For single option custom fields) |
| Option |
fieldName: {$type: [$id,...]} |
$type is one of [includes,notIncludes], $id is an array of option IDs, combined with OR (For multi option custom fields) |
| Folder |
fieldName: [$id,...] |
$id is a numeric folder ID |
| Folder |
fieldName: $id |
$id is a numeric folder ID |
| Folder |
fieldName: {$type: [$id,...]} |
$id is a numeric folder ID, $type is one of ['isIn', 'isNotIn'] |
| Labels |
fieldName: {$type: [$id,...]} |
$type is one of [includes,notIncludes], $id is an array of label IDs, combined with OR |
The following fields can be specified in the request (Field name/Filter Type/Example(s)):
| Field Name |
Filter Type |
Example(s) |
| location |
Full |
"location": {"contains": "Atlanta"} |
| name |
Text |
"name": {"startsWith": ["Guitar"]}, "name": {"contains": ["A","B"]} |
| address |
Text |
"address": {"startsWith": ["South"]} |
| address2 |
Text |
"address2": {"contains": ["Suite"]} |
| city |
Text |
"city": {"contains": ["Atlanta"]} |
| state |
Text |
"state": {"contains": ["AK","VA"]} |
| zip |
Text |
"zip": {"contains": ["M5K 7QB"]} |
| phones |
Text |
"phones": {"startsWith": ["703","571"]} |
| specialOffer |
Text |
"specialOffer": "notEmpty" |
| emails |
Text |
"emails": {"doesNotContain": ["@yext.com"]} |
| website |
Text |
"website": {"equalTo": ["https://www.yext.com/"]} |
| categories |
Categories |
"categories": {"includes": [23,755,34]} |
| closed |
Bool |
"closed": true |
| storeId |
Text |
"storeId": {"equalTo": ["MCD0001"]} |
| countryCode |
Country |
"countryCode": {"notIncludes": ["US"]} |
| products |
Text |
"products": {"startsWith": ["Burger","Fries"]} |
| services |
Text |
"services": {"contains": ["Manicures"]} |
| specialities |
Text |
"services": "notEmpty" |
| associations |
Text |
"associations": "empty" |
| brands |
Text |
"brands": {"equalTo": ["North Face"]} |
| languages |
Text |
"languages": {"equalTo": ["English","Spanish"]} |
| keywords |
Text |
"keywords": {"startsWith": ["Franchise"]} |
| menuIds |
IdList |
"menuIds": {"includes": ["m-23","755","menu34"]} |
| productListIds |
IdList |
"productListIds": {"notIncludes": ["pl-2"]} |
| calendarIds |
IdList |
"calendarIds": {"notIncludes": ["cal34"]} |
| bioIds |
IdList |
"bioIds": {"includes": ["b23","34"]} |
| custom### |
Text (for Multiline Text, URL, Text List, and Text Custom Fields), Number, Date, Bool, or Option |
"custom123": {"equalTo": ["asdf"]} |
| folder |
Folder |
"folder": 123, "folder": [123,456] |
| primary_language |
PrimaryLanguage |
"primary_language": {"is": "fr_CA"} |
| alternateProfileLanguage |
AlternateLanguage |
"alternateProfileLanguage": {"includes": ["en", "fr"]} |
| npi |
StringSingle |
"npi": {"is": ["1234567890", "1111111111"]} |
| conditionsTreated |
Text |
"conditionsTreated": {"startsWith": ["Influenza"]}, "conditionsTreated": {"contains": ["A","B"]} |
| lastUpdated |
Date |
"lastUpdated": {"eq": "2018-01-01"}, "lastUpdated": {"between": ["2017-01-01", "2018-01-01"]} |
| fieldsWithData |
Fields |
"fieldsWithData": ["email", "hours"] |
| fieldsWithoutData |
Fields |
"fieldsWithoutData": ["logo", "video"] |
| reviewCount |
Number |
"review_count": {"gt": 1}, "review_count ": {"lt": 10} |
| averageRating |
Number |
"averageRating": {"lt": 3} |
| locationType |
LocationType |
"locationType": {"is": [1]}, "locationType": {"isNot": [123]} |
| gender |
StringSingle |
"gender": {"is": ["FEMALE"]}, "gender": {"isNot": ["MALE"]} |
| degrees |
StringList |
"degrees": {"includes": ["MD"]}, "degrees": {"notIncludes": ["PHD"]} |
| experiences |
StringList |
"experiences": {"includes": ["FELLOWSHIP"]}, "experiences": {"notIncludes":["INTERNSHIP"]} |
| yearCompleted |
Number |
"yearCompleted": {"gt": 2000}, "yearCompleted": {"lt": 2015} |
| acceptingNewPatients |
Bool |
"acceptingNewPatients": true |
| firstName |
Text |
"firstName": {"startsWith": ["David"]}, "firstName": {"contains": ["A","B"]} |
| middleName |
Text |
"middleName": {"startsWith": ["P"]}, "middleName": {"contains": ["N","E"]} |
| lastName |
Text |
"lastName": {"startsWith": ["Sm"]}, "lastName": {"contains": ["Y","Z"]} |
| officeName |
Text |
"officeName": {"startsWith": ["Chiropractic"]}, "officeName": {"contains":["Center","P"]} |
| certifications |
Text |
"certifications": {"contains": ["Radiation Oncology"]} |
| institutionName |
Text |
"institutionName": {"startsWith": ["New York"]} |
| insuranceAccepted |
Text |
"insuranceAccepted": {"startsWith": ["United"]}, "insuranceAccepted":{"contains": ["C","Health"]} |
| admittingHospitals |
Text |
"admittingHospitals": {"startsWith": ["Children's"]}, "admittingHospitals":{"contains": ["Medical","University"]} |
| subscriptions |
IdList |
"subscriptions": {"notIncludes": ["123"]} |
| facebookAccounts |
IdList |
"facebookAccounts": {"notIncludes": ["1111"]} |
| foursquareAccounts |
IdList |
"foursquareAccounts": {"notIncludes": ["1111"]} |
| googleplusAccounts |
IdList |
"googleplusAccounts": {"notIncludes": ["1111"]} |
| labels |
Labels |
"labels": {"includes": [1, 100]} |
locationId:
name: locationId
in: path
required: true
schema:
type: string
listId:
name: listId
in: path
required: true
schema:
type: string
description: ID of this List.
language:
name: language
in: query
required: false
schema:
type: string
description: |
The language code corresponding to the language in which the user would like to retrieve the Google Fields. Only categories that apply to this language will be returned.
clientCategoryId:
name: clientCategoryId
in: query
required: false
schema:
type: string
description: |
A category id for the business or a Google category ID that, if specified, will filter the result to only include any Google Fields that the provided id maps to.
countryCode:
name: countryCode
in: query
required: false
schema:
type: string
description: |
The two-character ISO 3166-1 country code, if specified, will filter the result to only include any Google Fields that are eligible for that country.
entitiesPageToken:
name: pageToken
in: query
schema:
type: string
required: false
description: |
If a response to a previous request contained the **`pageToken`** field, pass that field's value as the **`pageToken`** parameter to retrieve the next page of data.
language_code:
name: language_code
in: path
schema:
type: string
required: true
description: Locale code.
publisherSiteId:
name: publisherSiteId
in: path
required: true
schema:
type: string
description: Publisher site ID.
listingsLocationIds:
name: locationIds
in: query
schema:
type: array
items:
type: string
description: |
Defaults to all account locations with a Listings subscription.
**Example:** loc123,loc456,loc789
style: simple
listingsPublisherIds:
name: publisherIds
in: query
schema:
type: array
items:
type: string
description: |
List of publisher IDs. If no IDs are specified, defaults to all publishers subscribed by the account.
**Example:** MAPQUEST,FACEBOOK
style: simple
listingsLocationId:
name: locationId
in: query
schema:
type: string
description: An account location ID with a Listings subscription.
listingsPublisherIdQuery:
name: publisherId
in: query
schema:
type: string
required: true
listingsPublisherId:
name: publisherId
in: path
schema:
type: string
required: true
locale:
name: locale
in: path
schema:
type: string
required: true
description: Locale code.
listingsVerficationEntityIds:
name: entityIds
in: query
schema:
type: string
required: false
description: |
A comma-separated list of Entity IDs.
If no IDs are specified, defaults to all entities with a listings subscription.
verificationLimit:
name: limit
in: query
schema:
type: integer
default: 100
description: Number of results to return.
listingsEntityIds:
name: entityIds
in: query
schema:
type: array
items:
type: string
description: |
Defaults to all account events with a subscription.
**Example:** entity123,entity456,entity789
style: simple
listingsEventPublisherIds:
name: publisherIds
in: query
schema:
type: array
items:
type: string
description: |
List of publisher IDs. If no IDs are specified, defaults to all publishers subscribed by the account.
**Example:** FACEBOOKEVENTS,EVENTBRITE
style: simple
QuestionAnswerFilter:
name: filter
required: false
schema:
type: string
in: query
description: |
This parameter represents one or more filtering conditions that are applied to the set of entities that would otherwise be returned. This parameter should be provided as a URL-encoded string containing a JSON object.
For example, if the filter JSON is `{"entityId":{"$eq":"location123"}}`, then the filter param after URL-encoding will be: `filter=%7B%22entityId%22%3A%7B%22%24eq%22%3A%22location123%22%7D%7D`
**Supported filters**
* **`id`**
* **`entityId`**
* **`publisherId`**
* **`authorType`**
* **`language`**
* **`createTime`**
* **`updateTime`**
* **`answerCount`**
* **`ownerAnswer`**
**Basic Filter Structure**
The filter object at its core consists of a *matcher*, a *field*, and an *argument*.
For example, in the following filter JSON:
```
{
"entityId":{
"$eq":"location123"
}
}
```
`$eq` is the *matcher*, or filtering operation (equals, in this example),
`entityId` is the *field* being filtered by, and
`location123` is *value* to be matched against.
**Combining Multiple Filters**
Multiple filters can be combined into one object using *combinators*. For example, the following filter JSON combines multiple filters using the combinator `$and`. `$or` is also supported.
```
{
"$and":[
{
"entityId":{
"$eq":"location123"
}
},
{
"authorType":{
"$in":[
"LOCAL_GUIDE",
"MERCHANT"
]
}
}
]
}
```
**Filter Negation**
Certain filter types may be negated. For example:
```
{
"$not": {
"entityId": {
"$eq": "location123"
}
}
}
```
This can also be written more simply with a `!` in the `$eq` parameter. The following filter would have the same effect:
```
{
"entityId":{
"!$eq":"location123"
}
}
```
**TEXT**
The `TEXT` filter type is supported for text fields. (e.g., **`entityId`**, **`authorType`**)