Skip to main content
Required ACL: addObject
  • If the record doesn’t have an object ID, a new record with an auto-generated object ID is added to your index.
  • If a record with the specified object ID exists, the existing record is replaced.
  • If a record with the specified object ID doesn’t exist, a new record is added to your index.
  • If you add a record to an index that doesn’t exist yet, a new index is created.
To update some attributes of a record, use the partial operation. To add, update, or replace multiple records, use the batch operation. This operation is subject to indexing rate limits.

Usage

// Initialize the client
var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"));

// Call the API
var response = await client.SaveObjectAsync(
  "<YOUR_INDEX_NAME>",
  new Dictionary<string, string>
  {
    { "name", "Black T-shirt" },
    { "color", "#000000||black" },
    { "availableIn", "https://source.unsplash.com/100x100/?paris||Paris" },
    { "objectID", "myID" },
  }
);
// >LOG

See the full API reference

For more details about input parameters and response fields.
I