Ingesting Data with the Ingest API

In this tutorial, you’ll learn how to add your first document to SearchStax Site Search using the Ingest API. This method is best when you want direct control of what content gets indexed. You’ll send a small JSON payload and confirm that it appears in your search app.

By the end, you’ll be able to:

  • Locate the correct API endpoint and authentication token
  • Submit a JSON document using the Ingest API
  • Confirm that your document is indexed in Site Search

Note: This guide covers the basics for onboarding. For batch ingestion, field mapping, and advanced options, see the full Ingest API documentation.

Prerequisites

Before you start, you’ll need:

  • A SearchStax Site Search account
  • A Search App created and ready for data ingestion
  • A basic understanding of REST APIs

Find Your Endpoint and Token

  1. In Site Search, open your Search App.
  2. Go to Site Search > App Settings > Data Management > Ingest API.
  3. Copy the Update Endpoint URL. It looks like https://searchcloud-//update.
  4. Copy your Read & Write token.

Make sure you have both values ready in a secure location. You’ll use them in the request.

SearchStax Site Search All APIs screen showing the Select Endpoint URL and the Read & Write token.

Send Your First Document

You can use curl or any HTTP client.

The example below uses curl to post a simple JSON object.

curl -X POST '?commit=true' \
  -H 'Authorization: Token ' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "add": {
      "doc": {
        "id": "doc-1",
        "title": "Hello world",
        "description": "This is my first indexed document via the update handler."
      }
    }
  }'

Replace:

  • with your app’s Update Endpoint URL
  • with your Read & Write token

Check that you get an HTTP 200 response. Then verify the document appears using Preview in the next step.

Verify with Search Preview

  1. In the top navigation bar, click Preview.
  2. Run a broad search such as *, or search for a term you ingested (for example, Hello world).

Confirm documents from your site appear in Preview results. See Previewing your first search in SearchStax for more information.

Note: Append ?commit=true to your update URL if you don’t see results immediately. Commits make updates visible to search faster. Even with ?commit=true, however, updates may lag due to cache and replication, so you may need to wait a while before results appear in Preview. You can also reload your App's schema to see results faster.

Additional Considerations

  • You can ingest multiple documents at once by sending an array of JSON objects. See the full Ingest API documentation for batch examples.
  • Each update request must be ≤ 2048 kb. Split large batches into multiple requests.
  • Some apps use basic authentication instead of token auth. If your Ingest API screen shows Basic Auth, use the Basic examples in the full documentation.

What’s Next

Continue ingesting the rest of your content using the Ingest API. Refer to the full documentation for more information about ingesting multiple documents, ingesting different XML and CSV documents, and more.

As you ingest data, preview your search in SearchStax to confirm that data ingestion was successful.

Articles in this section