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

Want to start with the core concepts? Give the Curations guide a read.


Curations hide or promote result content.

Each query may only belong to one curation.

Authentication

For authentication, the Curations endpoint requires...

  1. A Host Identifier: [HOST_IDENTIFIER]
  2. The name of your Engine: [ENGINE]
  3. A Private API Key: [PRIVATE_API_KEY]
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]'

List Curations

List All Curations

Return an array of all active curations.

GET /api/as/v1/curations
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.
Defaults to 25 per page.
Example - A GET request for all curations.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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/national-parks-demo/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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/national-parks-demo/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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/national-parks-demo/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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/national-parks-demo/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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/national-parks-demo/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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 All Curations with Pagination

Example - A GET request for all curations, paginated. Returns the 2nd page of results, with 20 results per page.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "page": {
    "size": 20,
    "current": 2
  }
}'
Example Response
{
  "meta": {
    "page": {
      "current": 2,
      "total_pages": 2,
      "total_results": 30,
      "size": 20
    }
  },
  "results": [
    ## Truncated!
  ]
}

Example - A GET request for all curations, paginated. Returns the 2nd page of results, with 20 results per page.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "page": {
    "size": 20,
    "current": 2
  }
}'
Example Response
No Java example available, showing cURL
{
  "meta": {
    "page": {
      "current": 2,
      "total_pages": 2,
      "total_results": 30,
      "size": 20
    }
  },
  "results": [
    ## Truncated!
  ]
}

Example - A GET request for all curations, paginated. Returns the 2nd page of results, with 20 results per page.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "page": {
    "size": 20,
    "current": 2
  }
}'
Example Response
No Node example available, showing cURL
{
  "meta": {
    "page": {
      "current": 2,
      "total_pages": 2,
      "total_results": 30,
      "size": 20
    }
  },
  "results": [
    ## Truncated!
  ]
}

Example - A GET request for all curations, paginated. Returns the 2nd page of results, with 20 results per page.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "page": {
    "size": 20,
    "current": 2
  }
}'
Example Response
No Ruby example available, showing cURL
{
  "meta": {
    "page": {
      "current": 2,
      "total_pages": 2,
      "total_results": 30,
      "size": 20
    }
  },
  "results": [
    ## Truncated!
  ]
}

Example - A GET request for all curations, paginated. Returns the 2nd page of results, with 20 results per page.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "page": {
    "size": 20,
    "current": 2
  }
}'
Example Response
No Python example available, showing cURL
{
  "meta": {
    "page": {
      "current": 2,
      "total_pages": 2,
      "total_results": 30,
      "size": 20
    }
  },
  "results": [
    ## Truncated!
  ]
}

Example - A GET request for all curations, paginated. Returns the 2nd page of results, with 20 results per page.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "page": {
    "size": 20,
    "current": 2
  }
}'
Example Response
No Javascript example available, showing cURL
{
  "meta": {
    "page": {
      "current": 2,
      "total_pages": 2,
      "total_results": 30,
      "size": 20
    }
  },
  "results": [
    ## Truncated!
  ]
}

List a Single 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/national-parks-demo/curations/a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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/national-parks-demo/curations/a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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/national-parks-demo/curations/a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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/national-parks-demo/curations/a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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/national-parks-demo/curations/a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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/national-parks-demo/curations/a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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 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 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 POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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 POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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 POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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 POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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 POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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 POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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 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 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 PUT 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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 PUT 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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 PUT 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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 PUT 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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 PUT 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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 PUT 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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/curations/[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/national-parks-demo/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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/national-parks-demo/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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/national-parks-demo/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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/national-parks-demo/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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/national-parks-demo/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-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/national-parks-demo/curations/cur-a1b2c3' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Javascript example available, showing cURL
{
  "deleted": true
}

Curations and Sorting

You may expect a curation to always be in its curated position, regardless of sort. But that's not always the case.

It's helpful to understand cases where a curation will and will not have priority when using sorting.

Curations are applied when there is...

  1. No sort field(s).
  2. A sort against the _score field.

Curations are not applied when there is...

  1. A sort against a custom field.
  2. A multi sort against _score, followed by a custom field.

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 given 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 endpoints are worth exploring. Another useful technique to deploy are Synonyms.


Stuck? Looking for help? Contact support or check out the App Search community forum!