search mobile facets autocomplete spellcheck crawler rankings weights synonyms analytics engage api customize documentation install setup technology content domains user history info home business cart chart contact email activate analyticsalt analytics autocomplete cart contact content crawling custom documentation domains email engage faceted history info install mobile person querybuilder search setup spellcheck synonyms weights engage_search_term engage_related_content engage_next_results engage_personalized_results engage_recent_results success add arrow-down arrow-left arrow-right arrow-up caret-down caret-left caret-right caret-up check close content conversions-small conversions details edit grid help small-info error live magento minus move photo pin plus preview refresh search settings small-home stat subtract text trash unpin wordpress x alert case_deflection advanced-permissions keyword-detection predictive-ai sso

Engines

Engine objects allow you to index documents and perform various search functions. The API allows you to create, delete, get, and list your engines.

Retrieve an engine

Retrieves an engine by name.

GET /api/as/v1/engines/{ENGINE_NAME}

Returns

A dictionary containing a name property. Returns an error if the API key does not have read permissions for the requested engine or if the engine does not exist.

Example
curl -X GET 'https://host-7s23ap.api.swiftype.com/api/as/v1/engines/rent-a-car' \
-H 'Authorization: Bearer api-3958sdlfjadsf'
Example Response
{
    "name": "rent-a-car"
}

List Engines

Retrieves engines that the API key has access to.

GET /api/as/v1/engines

Arguments

page
optional
Dictionary containing current and size, where current is the current page number and size is the page size. The maximum for size is 25, and be will truncated if a larger size is requested. The default is the first page of engines with pagination at 25.

Returns

A paginated list of dictionaries containing a name property for each engine the API key has read access to.

Example
curl -X GET 'https://host-7s23ap.api.swiftype.com/api/as/v1/engines' \
-H 'Authorization: Bearer api-3958sdlfjadsf' \
-d '{
        "page": {
            "current": "1",
            "size": "20"
        }
    }'
Example Response
{
    "meta": {
        "page": {
            "current": 1,
            "total_pages": 1,
            "total_results": 1,
            "size": 20
        }
    },
    "results": [
        {
          "name": "rent-a-car"
        }
    ]
}

Create an Engine

Creates a new engine object.

POST /api/as/v1/engines

Arguments

name
required
Name of the engine. Can only contain lowercase letters, numbers, and hyphens.

Returns

A dictionary with a name property. Returns an error if the API key does not have the permissions to create an engine, the engine already exists, or the engine name is invalid.

Example
curl -X POST 'https://host-7s23ap.api.swiftype.com/api/as/v1/engines' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-3958sdlfjadsf' \
-d '{
      "name": "rent-a-car"
    }'
Example Response
{
    "name": "rent-a-car"
}

Delete an Engine

Delete an engine by name.

DELETE /api/as/v1/engines/{ENGINE_NAME}

Returns

A dictionary with a deleted property denoting whether the engine was successfully deleted. Returns an error if the API key does not have write permissions for the requested engine.

Example
curl -X DELETE 'https://host-7s23ap.api.swiftype.com/api/as/v1/engines/rent-a-car' \
-H 'Authorization: Bearer api-3958sdlfjadsf'
Example Response
{
    "deleted": true
}