Step 1: Create an Entity

To create an Entity, you will need to make a POST request to the following URL:

https://api.yextapis.com/v2/accounts/me/entities?entityType=ENTITY_TYPE&api_key=API_KEY&v=YYYYMMDD

and send the Entity object as a payload. The value for the entityType query parameter should be the ID of the Entity Type (e.g. location, healthcareProfessional, ce_instructor). You can find the ID for a specific entity type by navigating to Content > Configuration > Entity Types in your account and viewing the details for a given Entity Type. The ID is listed under the Entity Type’s Settings tab.

When creating an Entity, you must always provide values for the required fields for the Entity Type. Required fields vary by Entity Type and can be viewed for a specific Entity Type by navigating to Content > Configuration > Entity Types in your account and clicking “View Details” for a given Entity Type. The required fields are denoted under the Entity Type’s Fields tab.

Let’s try it out. Here’s how you create an entity of type location:

https://api.yextapis.com/v2/accounts/me/entities?entityType=location&api_key=API_KEY&v=YYYYMMDD

Response Body:

{
   "meta":{
      "id":"yourTestLocation"
   },
   "name":"Your Test Location",
   "address":{
      "line1":"205 Main St",
      "line2":"Suite 451",
      "city":"New York",
      "region":"NY",
      "postalCode":"10001",
      "countryCode":"US"
   },
   "mainPhone":"2125555765"
}

You should see a success message and the data of the entity returned in the response. Note that id is not required during creation and is auto-generated if omitted, but if you wish to set your own id it can be provided in the meta sub-field of the entity body. Entity ids must be unique for each Entity within an account. An attempt to create an entity with the same id as an existing one will result in an error.
Similarly, folderId can be provided in the meta subfield as well.

Response Body:

{
   "meta":{
      "uuid":"5718e8f2-93e8-44c0-8876-e4d51c317c46",
      "errors":[
      ]
   },
   "response":{
      "address":{
         "line1":"205 Main St",
         "line2":"Suite 451",
         "city":"New York",
         "region":"NY",
         "postalCode":"10001",
         "countryCode":"US"
      },
      "name":"Your Test Location",
      "mainPhone":"+12125555765",
      "meta":{
         "accountId":"1384669",
         "uid":"WoLjwq",
         "id":"yourTestLocation",
         "timestamp":"2019-06-25T17:15:52",
         "folderId":"0",
         "language":"en",
         "countryCode":"US",
         "entityType":"location"
      }
   }
}
Feedback