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

Curations

You are the curator! It is as if the documents in your engine are your 'artifacts'. You are in control of how they are enjoyed. When users perform search queries you can configure a curation so that they discover what you would most like them to discover. Or, what you would not like them to discover.

There are two curation parameters and one mechanic to assign them:

  • Promoted: If you would like specific documents to appear in a prominent way, promote them. You can promote multiple documents per query, the array order representing the order in which they will appear.
  • Hidden: If you would not like specific documents to appear, hide them. You can hide multiple documents per query, the array order being unimportant because... they are hidden.

When you craft a curation you must include one or more queries within an array. That array of potential queries, along with the documents that fit the promoted and hidden parameters, form a curation.

In this way, users who query for banana, bananana, bonana and nanner will receive the same promoted items and not receive the same hidden items. This set, this grouping, is considered a curation with its own unique identifier.

The id of a curation is serialized via BSON. The id of a document is serialized via BSON as well, but you can supply your own id value. A response might look something like this:

{
  "id": "cur-a5b6c7",
  "queries": [
    "banana", "bananana", "bonana", "nanner"
  ],
  "promoted": [
    "doc-123", "doc-a2b3c4", "doc-456"
  ],
  "hidden": [
    "doc-a9b87c", "doc-789", "doc-a7b6c5"
  ]
}
Each query may only belong to one curation.

Authentication

For authentication, the Credentials end-point requires your unique Host Identifier, the name of your Engine and a Private API Key. The key begins with private- and was created for you upon account creation. You can find it, along with your Host Identifier, within the Credentials menu.

They fit into your requests like so:

curl -X GET 'https://[HOST_IDENTIFIER].api.swiftype.com/api/as/v1/engines/[ENGINE]/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer [PRIVATE_API_KEY]'

Request / Response Examples

Below you will find examples for the following operations:

List Curations

List All Curations

You can query the end-point to generate an array of all active curations. Each objet includes: curation id, queries, promoted and hidden. The output supports pagination, defaulting to 25 items at a time.

GET /api/as/v1/credentials
page
optional
Can provide...
current for current page
total_pages for the net number of pages
total_results for the overall number of results
size for the amount of results per page.
Expects integers within all fields.
Example - A GET request for all curations.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 3,
      "size": 25
    }
  },
  "results": [
    {
      "id": "cur-a1b2c3",
      "queries": [
        "banana", "bananana", "bonana", "nanner"
      ],
      "promoted": [
        "doc-a1b2c3", "doc-234", "doc-a3b4c5"
      ],
      "hidden": [
        "doc-a9b8c7", "doc-a8b7c6", "doc-abc"
      ]
    },
    {
      "id": "cur-a2b3c4",
      "queries": [
        "cherry", "cherri", "sherry"
      ],
      "promoted": [
        "doc-a1b1c1", "doc-a2b2c2"
      ],
      "hidden": []
    },
    {
      "id": "cur-a3b4c5",
      "queries": [
        "grape"
      ],
      "promoted": [],
      "hidden": [
        "doc-a3b3c3"
      ]
    }
  ]
}

Example - A GET request for all curations.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Java example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 3,
      "size": 25
    }
  },
  "results": [
    {
      "id": "cur-a1b2c3",
      "queries": [
        "banana", "bananana", "bonana", "nanner"
      ],
      "promoted": [
        "doc-a1b2c3", "doc-234", "doc-a3b4c5"
      ],
      "hidden": [
        "doc-a9b8c7", "doc-a8b7c6", "doc-abc"
      ]
    },
    {
      "id": "cur-a2b3c4",
      "queries": [
        "cherry", "cherri", "sherry"
      ],
      "promoted": [
        "doc-a1b1c1", "doc-a2b2c2"
      ],
      "hidden": []
    },
    {
      "id": "cur-a3b4c5",
      "queries": [
        "grape"
      ],
      "promoted": [],
      "hidden": [
        "doc-a3b3c3"
      ]
    }
  ]
}

Example - A GET request for all curations.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Node example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 3,
      "size": 25
    }
  },
  "results": [
    {
      "id": "cur-a1b2c3",
      "queries": [
        "banana", "bananana", "bonana", "nanner"
      ],
      "promoted": [
        "doc-a1b2c3", "doc-234", "doc-a3b4c5"
      ],
      "hidden": [
        "doc-a9b8c7", "doc-a8b7c6", "doc-abc"
      ]
    },
    {
      "id": "cur-a2b3c4",
      "queries": [
        "cherry", "cherri", "sherry"
      ],
      "promoted": [
        "doc-a1b1c1", "doc-a2b2c2"
      ],
      "hidden": []
    },
    {
      "id": "cur-a3b4c5",
      "queries": [
        "grape"
      ],
      "promoted": [],
      "hidden": [
        "doc-a3b3c3"
      ]
    }
  ]
}

Example - A GET request for all curations.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Ruby example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 3,
      "size": 25
    }
  },
  "results": [
    {
      "id": "cur-a1b2c3",
      "queries": [
        "banana", "bananana", "bonana", "nanner"
      ],
      "promoted": [
        "doc-a1b2c3", "doc-234", "doc-a3b4c5"
      ],
      "hidden": [
        "doc-a9b8c7", "doc-a8b7c6", "doc-abc"
      ]
    },
    {
      "id": "cur-a2b3c4",
      "queries": [
        "cherry", "cherri", "sherry"
      ],
      "promoted": [
        "doc-a1b1c1", "doc-a2b2c2"
      ],
      "hidden": []
    },
    {
      "id": "cur-a3b4c5",
      "queries": [
        "grape"
      ],
      "promoted": [],
      "hidden": [
        "doc-a3b3c3"
      ]
    }
  ]
}

Example - A GET request for all curations.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Python example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 3,
      "size": 25
    }
  },
  "results": [
    {
      "id": "cur-a1b2c3",
      "queries": [
        "banana", "bananana", "bonana", "nanner"
      ],
      "promoted": [
        "doc-a1b2c3", "doc-234", "doc-a3b4c5"
      ],
      "hidden": [
        "doc-a9b8c7", "doc-a8b7c6", "doc-abc"
      ]
    },
    {
      "id": "cur-a2b3c4",
      "queries": [
        "cherry", "cherri", "sherry"
      ],
      "promoted": [
        "doc-a1b1c1", "doc-a2b2c2"
      ],
      "hidden": []
    },
    {
      "id": "cur-a3b4c5",
      "queries": [
        "grape"
      ],
      "promoted": [],
      "hidden": [
        "doc-a3b3c3"
      ]
    }
  ]
}

Example - A GET request for all curations.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Javascript example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 3,
      "size": 25
    }
  },
  "results": [
    {
      "id": "cur-a1b2c3",
      "queries": [
        "banana", "bananana", "bonana", "nanner"
      ],
      "promoted": [
        "doc-a1b2c3", "doc-234", "doc-a3b4c5"
      ],
      "hidden": [
        "doc-a9b8c7", "doc-a8b7c6", "doc-abc"
      ]
    },
    {
      "id": "cur-a2b3c4",
      "queries": [
        "cherry", "cherri", "sherry"
      ],
      "promoted": [
        "doc-a1b1c1", "doc-a2b2c2"
      ],
      "hidden": []
    },
    {
      "id": "cur-a3b4c5",
      "queries": [
        "grape"
      ],
      "promoted": [],
      "hidden": [
        "doc-a3b3c3"
      ]
    }
  ]
}

List One Curation

You can specify the id of a curation in order to find information about that specific curation.

GET /api/as/v1/engines/[ENGINE]/curations/[CURATION_ID]
Example - A GET request for the curation with id 123.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations/a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "id": "cur-a1b2c3",
      "queries": [
        "banana", "bananana", "bonana", "nanner"
      ],
      "promoted": [
        "doc-a1b2c3", "doc-a2b3c4", "doc-a3b4c5"
      ],
      "hidden": [
        "doc-a9b8c7", "doc-a8b7c6", "doc-a7b6c5"
      ]
    }
  ]
}

Example - A GET request for the curation with id 123.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations/a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Java example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "id": "cur-a1b2c3",
      "queries": [
        "banana", "bananana", "bonana", "nanner"
      ],
      "promoted": [
        "doc-a1b2c3", "doc-a2b3c4", "doc-a3b4c5"
      ],
      "hidden": [
        "doc-a9b8c7", "doc-a8b7c6", "doc-a7b6c5"
      ]
    }
  ]
}

Example - A GET request for the curation with id 123.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations/a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Node example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "id": "cur-a1b2c3",
      "queries": [
        "banana", "bananana", "bonana", "nanner"
      ],
      "promoted": [
        "doc-a1b2c3", "doc-a2b3c4", "doc-a3b4c5"
      ],
      "hidden": [
        "doc-a9b8c7", "doc-a8b7c6", "doc-a7b6c5"
      ]
    }
  ]
}

Example - A GET request for the curation with id 123.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations/a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Ruby example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "id": "cur-a1b2c3",
      "queries": [
        "banana", "bananana", "bonana", "nanner"
      ],
      "promoted": [
        "doc-a1b2c3", "doc-a2b3c4", "doc-a3b4c5"
      ],
      "hidden": [
        "doc-a9b8c7", "doc-a8b7c6", "doc-a7b6c5"
      ]
    }
  ]
}

Example - A GET request for the curation with id 123.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations/a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Python example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "id": "cur-a1b2c3",
      "queries": [
        "banana", "bananana", "bonana", "nanner"
      ],
      "promoted": [
        "doc-a1b2c3", "doc-a2b3c4", "doc-a3b4c5"
      ],
      "hidden": [
        "doc-a9b8c7", "doc-a8b7c6", "doc-a7b6c5"
      ]
    }
  ]
}

Example - A GET request for the curation with id 123.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations/a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Javascript example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "id": "cur-a1b2c3",
      "queries": [
        "banana", "bananana", "bonana", "nanner"
      ],
      "promoted": [
        "doc-a1b2c3", "doc-a2b3c4", "doc-a3b4c5"
      ],
      "hidden": [
        "doc-a9b8c7", "doc-a8b7c6", "doc-a7b6c5"
      ]
    }
  ]
}

Create New Curation

POST /api/as/v1/engines/[ENGINE]/curations
queries
required
You can provide one or many query strings within an array. A query may only belong to one curation.
promoted
optional
Supply an array with the documents that you would like to promote. The array order determines precedence: 0, 1, 2... . You must provide a value for either promoted or hidden, or include both.
hidden
optional
Supply an array with the documents that you would like to hide. You must provide a value for either promoted or hidden, or include both.
Example - A POST request to create a new curation.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "queries": [
    "banana", "bananana", "bonana", "nanner"
  ],
  "promoted": [
    "doc-123", "doc-234", "doc-345"
  ],
  "hidden": [
    "doc-987", "doc-a8b7c6", "doc-765"
  ]
}'
Example Response
{
  "id": "cur-a1b2c3"
}

Example - A POST request to create a new curation.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "queries": [
    "banana", "bananana", "bonana", "nanner"
  ],
  "promoted": [
    "doc-123", "doc-234", "doc-345"
  ],
  "hidden": [
    "doc-987", "doc-a8b7c6", "doc-765"
  ]
}'
Example Response
No Java example available, showing cURL
{
  "id": "cur-a1b2c3"
}

Example - A POST request to create a new curation.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "queries": [
    "banana", "bananana", "bonana", "nanner"
  ],
  "promoted": [
    "doc-123", "doc-234", "doc-345"
  ],
  "hidden": [
    "doc-987", "doc-a8b7c6", "doc-765"
  ]
}'
Example Response
No Node example available, showing cURL
{
  "id": "cur-a1b2c3"
}

Example - A POST request to create a new curation.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "queries": [
    "banana", "bananana", "bonana", "nanner"
  ],
  "promoted": [
    "doc-123", "doc-234", "doc-345"
  ],
  "hidden": [
    "doc-987", "doc-a8b7c6", "doc-765"
  ]
}'
Example Response
No Ruby example available, showing cURL
{
  "id": "cur-a1b2c3"
}

Example - A POST request to create a new curation.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "queries": [
    "banana", "bananana", "bonana", "nanner"
  ],
  "promoted": [
    "doc-123", "doc-234", "doc-345"
  ],
  "hidden": [
    "doc-987", "doc-a8b7c6", "doc-765"
  ]
}'
Example Response
No Python example available, showing cURL
{
  "id": "cur-a1b2c3"
}

Example - A POST request to create a new curation.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "queries": [
    "banana", "bananana", "bonana", "nanner"
  ],
  "promoted": [
    "doc-123", "doc-234", "doc-345"
  ],
  "hidden": [
    "doc-987", "doc-a8b7c6", "doc-765"
  ]
}'
Example Response
No Javascript example available, showing cURL
{
  "id": "cur-a1b2c3"
}

Update Curation

PUT /api/as/v1/engines/[ENGINE]/curations
queries
required
You can provide one or many query strings within an array.
promoted
optional
Supply an array with the documents that you would like to promote. The array order determines precedence: 0, 1, 2... Use a blank array, or omit the argument, to clear all prior promotions. You must provide a value for either promoted or hidden, or include both.
hidden
optional
Supply an array with the documents that you would like to hide. Use a blank array, or omit the argument, to clear all prior hidden items. You must provide a value for either promoted or hidden, or include both.
Example - A PUT request to update curation 123 to change promoted documents and to cease hiding two documents.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "queries": [
    "banana", "bananza", "bananas", "bonana"
  ],
  "promoted": [
    "doc-a1b2c3", "doc-a3b3c4", "doc-445"
  ],
  "hidden": [
    "doc-a9b8c7"
  ]
}'
Example Response
{
  "id": "cur-a1b2c3"
}

Example - A PUT request to update curation 123 to change promoted documents and to cease hiding two documents.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "queries": [
    "banana", "bananza", "bananas", "bonana"
  ],
  "promoted": [
    "doc-a1b2c3", "doc-a3b3c4", "doc-445"
  ],
  "hidden": [
    "doc-a9b8c7"
  ]
}'
Example Response
No Java example available, showing cURL
{
  "id": "cur-a1b2c3"
}

Example - A PUT request to update curation 123 to change promoted documents and to cease hiding two documents.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "queries": [
    "banana", "bananza", "bananas", "bonana"
  ],
  "promoted": [
    "doc-a1b2c3", "doc-a3b3c4", "doc-445"
  ],
  "hidden": [
    "doc-a9b8c7"
  ]
}'
Example Response
No Node example available, showing cURL
{
  "id": "cur-a1b2c3"
}

Example - A PUT request to update curation 123 to change promoted documents and to cease hiding two documents.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "queries": [
    "banana", "bananza", "bananas", "bonana"
  ],
  "promoted": [
    "doc-a1b2c3", "doc-a3b3c4", "doc-445"
  ],
  "hidden": [
    "doc-a9b8c7"
  ]
}'
Example Response
No Ruby example available, showing cURL
{
  "id": "cur-a1b2c3"
}

Example - A PUT request to update curation 123 to change promoted documents and to cease hiding two documents.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "queries": [
    "banana", "bananza", "bananas", "bonana"
  ],
  "promoted": [
    "doc-a1b2c3", "doc-a3b3c4", "doc-445"
  ],
  "hidden": [
    "doc-a9b8c7"
  ]
}'
Example Response
No Python example available, showing cURL
{
  "id": "cur-a1b2c3"
}

Example - A PUT request to update curation 123 to change promoted documents and to cease hiding two documents.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "queries": [
    "banana", "bananza", "bananas", "bonana"
  ],
  "promoted": [
    "doc-a1b2c3", "doc-a3b3c4", "doc-445"
  ],
  "hidden": [
    "doc-a9b8c7"
  ]
}'
Example Response
No Javascript example available, showing cURL
{
  "id": "cur-a1b2c3"
}

Delete Curation

DELETE /api/as/v1/credentials/[CURATION_ID]
Example - A DELETE request to destroy the curation with id 123.
curl -X DELETE 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
{
  "deleted": true
}

Example - A DELETE request to destroy the curation with id 123.
No Java example available, showing cURL
curl -X DELETE 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Java example available, showing cURL
{
  "deleted": true
}

Example - A DELETE request to destroy the curation with id 123.
No Node example available, showing cURL
curl -X DELETE 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Node example available, showing cURL
{
  "deleted": true
}

Example - A DELETE request to destroy the curation with id 123.
No Ruby example available, showing cURL
curl -X DELETE 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Ruby example available, showing cURL
{
  "deleted": true
}

Example - A DELETE request to destroy the curation with id 123.
No Python example available, showing cURL
curl -X DELETE 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Python example available, showing cURL
{
  "deleted": true
}

Example - A DELETE request to destroy the curation with id 123.
No Javascript example available, showing cURL
curl -X DELETE 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Javascript example available, showing cURL
{
  "deleted": true
}

Errors!

Request parameters can be quite particular. Did you get an error? Perhaps it is one of these?

Error MessageMethodSolution
“queries must be supplied"POST/PUTQueries are a required field. Make sure you have included at least one.
“queries must be a non empty array of strings”POST/PUTEven if you are supplying one query, you will need to encapsulate it within an array.
“query already exists under another curation: ‘cur-a1b2c3’, ‘bananas’"POST/PUTEach query can belong to one curation.
“promoted must be a non empty array of strings”POST/PUTEven if you are supplying one document, you will need to encapsulate it within an array. Must be a string.
“hidden must be a non empty array of strings”POST/PUTEven if you are supplying one document, you will need to encapsulate it within an array. Must be a string.
“promoted contains invalid document ids: [‘doc-1’, ‘doc-2’]”POST/PUTThe document that you included in the array could not be found, or the string was malformed in some way.
“hidden contains invalid document ids: [‘doc-1’, ‘doc-2’]”POST/PUTThe document that you included in the array could not be found, or the string was malformed in some way.
“curation must include either promoted or hidden”POST/PUTA curation without at least one promotion or one hidden item is not a curation at all! Please include one.
“curation does not exist for id: cur-a1b2c3”DELETEThe request was received, and the API wanted to delete something, but was unable to locate the curation by the id you provided.

What's Next?

Your Curations can become mighty tools in improving the relevance, and thus the overall experience, of search queries. Business goals, too, as you can get your visitors where you would like them to be. If you want to take a deep look into how users are interacting with your engines, the Analytics and Clickthrough end-points are worth exploring. Another useful technique to deploy are Synonyms.


Stuck? Looking for help? Contact Support!