> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Push to Algolia

> Learn how to push records to Algolia using the Push to Algolia connector, including data transformation, API client integration, and batch indexing

export const Index = () => <Tooltip tip="An Algolia index is a searchable dataset that consists of records and configuration settings. These settings define how the records are searched and ranked.">
    index
  </Tooltip>;

export const Application = () => <Tooltip tip="An Algolia application is a self-contained environment with its own indices, configuration, and API keys. Applications don't share data or settings with each other.">
    application
  </Tooltip>;

Use the Push to Algolia connector to [transform your data](/doc/guides/sending-and-managing-data/send-and-update-your-data/how-to/transform-your-data-with-code) and
send it to Algolia using an [API client](/doc/libraries/sdk).

## Create a new Push to Algolia connector

1. Go to the Algolia dashboard and select your Algolia <Application />.
2. On the left sidebar, select <Icon icon="database" /> **Data sources**.
3. On the [**Connectors**](https://dashboard.algolia.com/connectors) page,
   select **Push to Algolia**, then click **Connect**.
4. Configure your [transformation](/doc/guides/sending-and-managing-data/send-and-update-your-data/how-to/transform-your-data-with-code): create a new one or reuse an existing one.
5. Configure your destination: create a new one or reuse an existing one.
6. Create the task to generate a `taskID`.

## Usage

Update your API client implementation to use either the `WithTransformation` helper methods of the Search API client
or the `pushTask` method of the Ingestion API client.

### Search API client `WithTransformation` helper methods

#### Set up the transformation region

Before calling any `WithTransformation` method,
configure the transformation region on the search client.
Replace `us` with `eu` if your Algolia application uses the Europe analytics region.
You can check your analytics region in the [**Infrastructure > Analytics**](https://dashboard.algolia.com/account/infrastructure/analytics) section of the Algolia dashboard.

<CodeGroup>
  ```cs C# theme={"system"}
  var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"));
  client.SetTransformationRegion("us");
  ```

  ```go Go theme={"system"}
  import (
    "github.com/algolia/algoliasearch-client-go/v4/algolia/ingestion"
    "github.com/algolia/algoliasearch-client-go/v4/algolia/search"
    "github.com/algolia/algoliasearch-client-go/v4/algolia/transport"
  )

  config := search.SearchConfiguration{
    Configuration: transport.Configuration{
      AppID:  "ALGOLIA_APPLICATION_ID",
      ApiKey: "ALGOLIA_API_KEY",
    },
  }
  config.SetTransformationRegion(ingestion.US)

  client, err := search.NewClientWithConfig(config)
  ```

  ```java Java theme={"system"}
  SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY");
  client.setTransformationRegion("us");
  ```

  ```js JavaScript theme={"system"}
  const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY', {
    transformation: { region: 'us' },
  });
  ```

  ```php PHP theme={"system"}
  use Algolia\AlgoliaSearch\Api\SearchClient;
  use Algolia\AlgoliaSearch\Configuration\SearchConfig;

  $config = SearchConfig::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY');
  $config->setTransformationRegion('us');
  $client = SearchClient::createWithConfig(config: $config);
  ```

  ```python Python theme={"system"}
  from algoliasearch.search.config import SearchConfig
  from algoliasearch.search.client import SearchClientSync

  config = SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
  config.set_transformation_region("us")
  client = SearchClientSync(config=config)
  ```
</CodeGroup>

For more information, see [Configuration forwarding to the ingestion transporter](/doc/libraries/sdk/customize#configuration-forwarding-to-the-ingestion-transporter).

The `WithTransformation` helper methods are available for C#, Go, Java, JavaScript, PHP, and Python.
For other languages, use the [`pushTask`](#ingestion-api-pushtask-method) method with a standalone [Ingestion API client](/doc/libraries/sdk/methods/ingestion) instead.

To run the code examples on this page, [install the latest API client](/doc/libraries/sdk/install).

<Note>
  These helper methods of the Search API replace the standard API clients methods
  (`saveObjects`, `partialUpdateObjects`, `replaceAllObjects`)
  but use the [`push`](/doc/rest-api/ingestion/push) method of the Ingestion API.
  They're subject to the [connector limits](/doc/guides/scaling/algolia-service-limits#connectors-limits).
</Note>

Use the helper methods if:

* You already have an existing implementation using an API client.
* You only have created one Push to Algolia connector for the <Index /> you're targeting.

The [Collections](/doc/guides/solutions/ecommerce/browse/tutorials/collections) feature
creates its own (internal) Push connector.
That means you can use the `WithTransformation` helper methods
if you're using collections *and* created an additional Push to Algolia connector.

* <Icon icon="check" color="green" /> **Supported:**

  * 1 Push to Algolia connector **and** [Collections](/doc/guides/solutions/ecommerce/browse/tutorials/collections)

* <Icon icon="x" color="red" /> **Not supported:**

  * Multiple Push to Algolia connectors

If you have more than one Push to Algolia connector,
use the [`pushTask`](#ingestion-api-pushtask-method) method instead.

#### Save records with transformation

Replace `saveObjects` with [`saveObjectsWithTransformation`](/doc/libraries/sdk/methods/search/save-objects-with-transformation).

<CodeGroup>
  ```cs C# theme={"system"}
  var response = await client.SaveObjectsWithTransformationAsync(
    "INDEX_NAME",
    new List<Object>
    {
      new Dictionary<string, string> { { "objectID", "1" }, { "name", "Adam" } },
      new Dictionary<string, string> { { "objectID", "2" }, { "name", "Benoit" } },
    },
    true
  );
  ```

  ```dart Dart theme={"system"}
  final response = await client.saveObjectsWithTransformation(
    indexName: "INDEX_NAME",
    objects: [
      {
        'objectID': "1",
        'name': "Adam",
      },
      {
        'objectID': "2",
        'name': "Benoit",
      },
    ],
    waitForTasks: true,
  );
  ```

  ```go Go theme={"system"}
  response, err := client.SaveObjectsWithTransformation(
    "INDEX_NAME",
    []map[string]any{{"objectID": "1", "name": "Adam"}, {"objectID": "2", "name": "Benoit"}}, search.WithWaitForTasks(true))
  if err != nil {
    // handle the eventual error
    panic(err)
  }
  ```

  ```java Java theme={"system"}
  List response = client.saveObjectsWithTransformation(
    "INDEX_NAME",
    Arrays.asList(
      new HashMap() {
        {
          put("objectID", "1");
          put("name", "Adam");
        }
      },
      new HashMap() {
        {
          put("objectID", "2");
          put("name", "Benoit");
        }
      }
    ),
    true
  );
  ```

  ```js JavaScript theme={"system"}
  const response = await client.saveObjectsWithTransformation({
    indexName: 'cts_e2e_saveObjectsWithTransformation_javascript',
    objects: [
      { objectID: '1', name: 'Adam' },
      { objectID: '2', name: 'Benoit' },
    ],
    waitForTasks: true,
  });
  ```

  ```kotlin Kotlin theme={"system"}
  var response =
    client.saveObjectsWithTransformation(
      indexName = "INDEX_NAME",
      objects =
        listOf(
          buildJsonObject {
            put("objectID", JsonPrimitive("1"))
            put("name", JsonPrimitive("Adam"))
          },
          buildJsonObject {
            put("objectID", JsonPrimitive("2"))
            put("name", JsonPrimitive("Benoit"))
          },
        ),
      waitForTasks = true,
    )
  ```

  ```php PHP theme={"system"}
  $response = $client->saveObjectsWithTransformation(
      'INDEX_NAME',
      [
          ['objectID' => '1',
              'name' => 'Adam',
          ],

          ['objectID' => '2',
              'name' => 'Benoit',
          ],
      ],
      true,
  );
  ```

  ```python Python theme={"system"}
  response = client.save_objects_with_transformation(
      index_name="INDEX_NAME",
      objects=[
          {
              "objectID": "1",
              "name": "Adam",
          },
          {
              "objectID": "2",
              "name": "Benoit",
          },
      ],
      wait_for_tasks=True,
  )
  ```

  ```ruby Ruby theme={"system"}
  response = client.save_objects_with_transformation(
    "INDEX_NAME",
    [{objectID: "1", name: "Adam"}, {objectID: "2", name: "Benoit"}],
    true
  )
  ```

  ```scala Scala theme={"system"}
  val response = Await.result(
    client.saveObjectsWithTransformation(
      indexName = "INDEX_NAME",
      objects = Seq(
        JObject(List(JField("objectID", JString("1")), JField("name", JString("Adam")))),
        JObject(List(JField("objectID", JString("2")), JField("name", JString("Benoit"))))
      ),
      waitForTasks = true
    ),
    Duration(100, "sec")
  )
  ```

  ```swift Swift theme={"system"}
  let response = try await client.saveObjectsWithTransformation(
      indexName: "INDEX_NAME",
      objects: [["objectID": "1", "name": "Adam"], ["objectID": "2", "name": "Benoit"]],
      waitForTasks: true
  )
  ```
</CodeGroup>

#### Add or update attributes of multiple records with transformation

Replace `partialUpdateObjects` with [`partialUpdateObjectsWithTransformation`](/doc/libraries/sdk/methods/search/partial-update-objects-with-transformation).

<CodeGroup>
  ```cs C# theme={"system"}
  var response = await client.PartialUpdateObjectsWithTransformationAsync(
    "INDEX_NAME",
    new List<Object>
    {
      new Dictionary<string, string> { { "objectID", "1" }, { "name", "Adam" } },
      new Dictionary<string, string> { { "objectID", "2" }, { "name", "Benoit" } },
    },
    true,
    true
  );
  ```

  ```dart Dart theme={"system"}
  final response = await client.partialUpdateObjectsWithTransformation(
    indexName: "INDEX_NAME",
    objects: [
      {
        'objectID': "1",
        'name': "Adam",
      },
      {
        'objectID': "2",
        'name': "Benoit",
      },
    ],
    createIfNotExists: true,
    waitForTasks: true,
  );
  ```

  ```go Go theme={"system"}
  response, err := client.PartialUpdateObjectsWithTransformation(
    "INDEX_NAME",
    []map[string]any{
      {"objectID": "1", "name": "Adam"},
      {"objectID": "2", "name": "Benoit"},
    },
    search.WithCreateIfNotExists(true),
    search.WithWaitForTasks(true),
  )
  if err != nil {
    // handle the eventual error
    panic(err)
  }
  ```

  ```java Java theme={"system"}
  List response = client.partialUpdateObjectsWithTransformation(
    "INDEX_NAME",
    Arrays.asList(
      new HashMap() {
        {
          put("objectID", "1");
          put("name", "Adam");
        }
      },
      new HashMap() {
        {
          put("objectID", "2");
          put("name", "Benoit");
        }
      }
    ),
    true,
    true
  );
  ```

  ```js JavaScript theme={"system"}
  const response = await client.partialUpdateObjectsWithTransformation({
    indexName: 'cts_e2e_partialUpdateObjectsWithTransformation_javascript',
    objects: [
      { objectID: '1', name: 'Adam' },
      { objectID: '2', name: 'Benoit' },
    ],
    createIfNotExists: true,
    waitForTasks: true,
  });
  ```

  ```kotlin Kotlin theme={"system"}
  var response =
    client.partialUpdateObjectsWithTransformation(
      indexName = "INDEX_NAME",
      objects =
        listOf(
          buildJsonObject {
            put("objectID", JsonPrimitive("1"))
            put("name", JsonPrimitive("Adam"))
          },
          buildJsonObject {
            put("objectID", JsonPrimitive("2"))
            put("name", JsonPrimitive("Benoit"))
          },
        ),
      createIfNotExists = true,
      waitForTasks = true,
    )
  ```

  ```php PHP theme={"system"}
  $response = $client->partialUpdateObjectsWithTransformation(
      'INDEX_NAME',
      [
          ['objectID' => '1',
              'name' => 'Adam',
          ],

          ['objectID' => '2',
              'name' => 'Benoit',
          ],
      ],
      true,
      true,
  );
  ```

  ```python Python theme={"system"}
  response = client.partial_update_objects_with_transformation(
      index_name="INDEX_NAME",
      objects=[
          {
              "objectID": "1",
              "name": "Adam",
          },
          {
              "objectID": "2",
              "name": "Benoit",
          },
      ],
      create_if_not_exists=True,
      wait_for_tasks=True,
  )
  ```

  ```ruby Ruby theme={"system"}
  response = client.partial_update_objects_with_transformation(
    "INDEX_NAME",
    [{objectID: "1", name: "Adam"}, {objectID: "2", name: "Benoit"}],
    true,
    true
  )
  ```

  ```scala Scala theme={"system"}
  val response = Await.result(
    client.partialUpdateObjectsWithTransformation(
      indexName = "INDEX_NAME",
      objects = Seq(
        JObject(List(JField("objectID", JString("1")), JField("name", JString("Adam")))),
        JObject(List(JField("objectID", JString("2")), JField("name", JString("Benoit"))))
      ),
      createIfNotExists = true,
      waitForTasks = true
    ),
    Duration(100, "sec")
  )
  ```

  ```swift Swift theme={"system"}
  let response = try await client.partialUpdateObjectsWithTransformation(
      indexName: "INDEX_NAME",
      objects: [["objectID": "1", "name": "Adam"], ["objectID": "2", "name": "Benoit"]],
      createIfNotExists: true,
      waitForTasks: true
  )
  ```
</CodeGroup>

#### Replace all records with transformation

Replace `replaceAllObjects` with [`replaceAllObjectsWithTransformation`](/doc/libraries/sdk/methods/search/replace-all-objects-with-transformation).

<CodeGroup>
  ```cs C# theme={"system"}
  var response = await client.ReplaceAllObjectsWithTransformationAsync(
    "INDEX_NAME",
    new List<Object>
    {
      new Dictionary<string, string> { { "objectID", "1" }, { "name", "Adam" } },
      new Dictionary<string, string> { { "objectID", "2" }, { "name", "Benoit" } },
      new Dictionary<string, string> { { "objectID", "3" }, { "name", "Cyril" } },
      new Dictionary<string, string> { { "objectID", "4" }, { "name", "David" } },
      new Dictionary<string, string> { { "objectID", "5" }, { "name", "Eva" } },
      new Dictionary<string, string> { { "objectID", "6" }, { "name", "Fiona" } },
      new Dictionary<string, string> { { "objectID", "7" }, { "name", "Gael" } },
      new Dictionary<string, string> { { "objectID", "8" }, { "name", "Hugo" } },
      new Dictionary<string, string> { { "objectID", "9" }, { "name", "Igor" } },
      new Dictionary<string, string> { { "objectID", "10" }, { "name", "Julia" } },
    },
    3
  );
  ```

  ```dart Dart theme={"system"}
  final response = await client.replaceAllObjectsWithTransformation(
    indexName: "INDEX_NAME",
    objects: [
      {
        'objectID': "1",
        'name': "Adam",
      },
      {
        'objectID': "2",
        'name': "Benoit",
      },
      {
        'objectID': "3",
        'name': "Cyril",
      },
      {
        'objectID': "4",
        'name': "David",
      },
      {
        'objectID': "5",
        'name': "Eva",
      },
      {
        'objectID': "6",
        'name': "Fiona",
      },
      {
        'objectID': "7",
        'name': "Gael",
      },
      {
        'objectID': "8",
        'name': "Hugo",
      },
      {
        'objectID': "9",
        'name': "Igor",
      },
      {
        'objectID': "10",
        'name': "Julia",
      },
    ],
    batchSize: 3,
  );
  ```

  ```go Go theme={"system"}
  response, err := client.ReplaceAllObjectsWithTransformation(
    "INDEX_NAME",
    []map[string]any{
      {"objectID": "1", "name": "Adam"},
      {"objectID": "2", "name": "Benoit"},
      {"objectID": "3", "name": "Cyril"},
      {"objectID": "4", "name": "David"},
      {"objectID": "5", "name": "Eva"},
      {"objectID": "6", "name": "Fiona"},
      {"objectID": "7", "name": "Gael"},
      {"objectID": "8", "name": "Hugo"},
      {"objectID": "9", "name": "Igor"},
      {"objectID": "10", "name": "Julia"},
    },
    search.WithBatchSize(3),
  )
  if err != nil {
    // handle the eventual error
    panic(err)
  }
  ```

  ```java Java theme={"system"}
  ReplaceAllObjectsWithTransformationResponse response = client.replaceAllObjectsWithTransformation(
    "INDEX_NAME",
    Arrays.asList(
      new HashMap() {
        {
          put("objectID", "1");
          put("name", "Adam");
        }
      },
      new HashMap() {
        {
          put("objectID", "2");
          put("name", "Benoit");
        }
      },
      new HashMap() {
        {
          put("objectID", "3");
          put("name", "Cyril");
        }
      },
      new HashMap() {
        {
          put("objectID", "4");
          put("name", "David");
        }
      },
      new HashMap() {
        {
          put("objectID", "5");
          put("name", "Eva");
        }
      },
      new HashMap() {
        {
          put("objectID", "6");
          put("name", "Fiona");
        }
      },
      new HashMap() {
        {
          put("objectID", "7");
          put("name", "Gael");
        }
      },
      new HashMap() {
        {
          put("objectID", "8");
          put("name", "Hugo");
        }
      },
      new HashMap() {
        {
          put("objectID", "9");
          put("name", "Igor");
        }
      },
      new HashMap() {
        {
          put("objectID", "10");
          put("name", "Julia");
        }
      }
    ),
    3
  );
  ```

  ```js JavaScript theme={"system"}
  const response = await client.replaceAllObjectsWithTransformation({
    indexName: 'cts_e2e_replace_all_objects_with_transformation_javascript',
    objects: [
      { objectID: '1', name: 'Adam' },
      { objectID: '2', name: 'Benoit' },
      { objectID: '3', name: 'Cyril' },
      { objectID: '4', name: 'David' },
      { objectID: '5', name: 'Eva' },
      { objectID: '6', name: 'Fiona' },
      { objectID: '7', name: 'Gael' },
      { objectID: '8', name: 'Hugo' },
      { objectID: '9', name: 'Igor' },
      { objectID: '10', name: 'Julia' },
    ],
    batchSize: 3,
  });
  ```

  ```kotlin Kotlin theme={"system"}
  var response =
    client.replaceAllObjectsWithTransformation(
      indexName = "INDEX_NAME",
      objects =
        listOf(
          buildJsonObject {
            put("objectID", JsonPrimitive("1"))
            put("name", JsonPrimitive("Adam"))
          },
          buildJsonObject {
            put("objectID", JsonPrimitive("2"))
            put("name", JsonPrimitive("Benoit"))
          },
          buildJsonObject {
            put("objectID", JsonPrimitive("3"))
            put("name", JsonPrimitive("Cyril"))
          },
          buildJsonObject {
            put("objectID", JsonPrimitive("4"))
            put("name", JsonPrimitive("David"))
          },
          buildJsonObject {
            put("objectID", JsonPrimitive("5"))
            put("name", JsonPrimitive("Eva"))
          },
          buildJsonObject {
            put("objectID", JsonPrimitive("6"))
            put("name", JsonPrimitive("Fiona"))
          },
          buildJsonObject {
            put("objectID", JsonPrimitive("7"))
            put("name", JsonPrimitive("Gael"))
          },
          buildJsonObject {
            put("objectID", JsonPrimitive("8"))
            put("name", JsonPrimitive("Hugo"))
          },
          buildJsonObject {
            put("objectID", JsonPrimitive("9"))
            put("name", JsonPrimitive("Igor"))
          },
          buildJsonObject {
            put("objectID", JsonPrimitive("10"))
            put("name", JsonPrimitive("Julia"))
          },
        ),
      batchSize = 3,
    )
  ```

  ```php PHP theme={"system"}
  $response = $client->replaceAllObjectsWithTransformation(
      'INDEX_NAME',
      [
          ['objectID' => '1',
              'name' => 'Adam',
          ],

          ['objectID' => '2',
              'name' => 'Benoit',
          ],

          ['objectID' => '3',
              'name' => 'Cyril',
          ],

          ['objectID' => '4',
              'name' => 'David',
          ],

          ['objectID' => '5',
              'name' => 'Eva',
          ],

          ['objectID' => '6',
              'name' => 'Fiona',
          ],

          ['objectID' => '7',
              'name' => 'Gael',
          ],

          ['objectID' => '8',
              'name' => 'Hugo',
          ],

          ['objectID' => '9',
              'name' => 'Igor',
          ],

          ['objectID' => '10',
              'name' => 'Julia',
          ],
      ],
      3,
  );
  ```

  ```python Python theme={"system"}
  response = client.replace_all_objects_with_transformation(
      index_name="INDEX_NAME",
      objects=[
          {
              "objectID": "1",
              "name": "Adam",
          },
          {
              "objectID": "2",
              "name": "Benoit",
          },
          {
              "objectID": "3",
              "name": "Cyril",
          },
          {
              "objectID": "4",
              "name": "David",
          },
          {
              "objectID": "5",
              "name": "Eva",
          },
          {
              "objectID": "6",
              "name": "Fiona",
          },
          {
              "objectID": "7",
              "name": "Gael",
          },
          {
              "objectID": "8",
              "name": "Hugo",
          },
          {
              "objectID": "9",
              "name": "Igor",
          },
          {
              "objectID": "10",
              "name": "Julia",
          },
      ],
      batch_size=3,
  )
  ```

  ```ruby Ruby theme={"system"}
  response = client.replace_all_objects_with_transformation(
    "INDEX_NAME",
    [
      {objectID: "1", name: "Adam"},
      {objectID: "2", name: "Benoit"},
      {objectID: "3", name: "Cyril"},
      {objectID: "4", name: "David"},
      {objectID: "5", name: "Eva"},
      {objectID: "6", name: "Fiona"},
      {objectID: "7", name: "Gael"},
      {objectID: "8", name: "Hugo"},
      {objectID: "9", name: "Igor"},
      {objectID: "10", name: "Julia"}
    ],
    3
  )
  ```

  ```scala Scala theme={"system"}
  val response = Await.result(
    client.replaceAllObjectsWithTransformation(
      indexName = "INDEX_NAME",
      objects = Seq(
        JObject(List(JField("objectID", JString("1")), JField("name", JString("Adam")))),
        JObject(List(JField("objectID", JString("2")), JField("name", JString("Benoit")))),
        JObject(List(JField("objectID", JString("3")), JField("name", JString("Cyril")))),
        JObject(List(JField("objectID", JString("4")), JField("name", JString("David")))),
        JObject(List(JField("objectID", JString("5")), JField("name", JString("Eva")))),
        JObject(List(JField("objectID", JString("6")), JField("name", JString("Fiona")))),
        JObject(List(JField("objectID", JString("7")), JField("name", JString("Gael")))),
        JObject(List(JField("objectID", JString("8")), JField("name", JString("Hugo")))),
        JObject(List(JField("objectID", JString("9")), JField("name", JString("Igor")))),
        JObject(List(JField("objectID", JString("10")), JField("name", JString("Julia"))))
      ),
      batchSize = 3
    ),
    Duration(100, "sec")
  )
  ```

  ```swift Swift theme={"system"}
  let response = try await client.replaceAllObjectsWithTransformation(
      indexName: "INDEX_NAME",
      objects: [
          ["objectID": "1", "name": "Adam"],
          ["objectID": "2", "name": "Benoit"],
          ["objectID": "3", "name": "Cyril"],
          ["objectID": "4", "name": "David"],
          ["objectID": "5", "name": "Eva"],
          ["objectID": "6", "name": "Fiona"],
          ["objectID": "7", "name": "Gael"],
          ["objectID": "8", "name": "Hugo"],
          ["objectID": "9", "name": "Igor"],
          ["objectID": "10", "name": "Julia"],
      ],
      batchSize: 3
  )
  ```
</CodeGroup>

### Ingestion API `pushTask` method

Use the `pushTask` method of the Ingestion API client if

* You have multiple destinations linked to the index you're targeting.
* You have multiple Push to Algolia connectors,
  or a Push to Algolia connector and [Collections](/doc/guides/solutions/ecommerce/browse/tutorials/collections).

<CodeGroup>
  ```cs C# theme={"system"}
  var response = await client.PushTaskAsync(
    "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
    new PushTaskPayload
    {
      Action = Enum.Parse<Action>("AddObject"),
      Records = new List<PushTaskRecords>
      {
        new PushTaskRecords
        {
          ObjectID = "o",
          AdditionalProperties = new Dictionary<string, object>
          {
            { "key", "bar" },
            { "foo", "1" },
          },
        },
        new PushTaskRecords
        {
          ObjectID = "k",
          AdditionalProperties = new Dictionary<string, object>
          {
            { "key", "baz" },
            { "foo", "2" },
          },
        },
      },
    }
  );
  ```

  ```dart Dart theme={"system"}
  final response = await client.pushTask(
    taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
    pushTaskPayload: PushTaskPayload(
      action: Action.fromJson("addObject"),
      records: [
        PushTaskRecords(
          objectID: "o",
          additionalProperties: {
            'key': "bar",
            'foo': "1",
          },
        ),
        PushTaskRecords(
          objectID: "k",
          additionalProperties: {
            'key': "baz",
            'foo': "2",
          },
        ),
      ],
    ),
  );
  ```

  ```go Go theme={"system"}
  response, err := client.PushTask(client.NewApiPushTaskRequest(
    "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
    ingestion.NewEmptyPushTaskPayload().SetAction(ingestion.Action("addObject")).SetRecords(
      []ingestion.PushTaskRecords{
        *ingestion.NewEmptyPushTaskRecords().SetAdditionalProperty("key", "bar").SetAdditionalProperty("foo", "1").SetObjectID("o"),
        *ingestion.NewEmptyPushTaskRecords().SetAdditionalProperty("key", "baz").SetAdditionalProperty("foo", "2").SetObjectID("k"),
      }),
  ))
  if err != nil {
    // handle the eventual error
    panic(err)
  }
  ```

  ```java Java theme={"system"}
  WatchResponse response = client.pushTask(
    "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
    new PushTaskPayload()
      .setAction(Action.ADD_OBJECT)
      .setRecords(
        Arrays.asList(
          new PushTaskRecords().setAdditionalProperty("key", "bar").setAdditionalProperty("foo", "1").setObjectID("o"),
          new PushTaskRecords().setAdditionalProperty("key", "baz").setAdditionalProperty("foo", "2").setObjectID("k")
        )
      )
  );
  ```

  ```js JavaScript theme={"system"}
  const response = await client.pushTask({
    taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',
    pushTaskPayload: {
      action: 'addObject',
      records: [
        { key: 'bar', foo: '1', objectID: 'o' },
        { key: 'baz', foo: '2', objectID: 'k' },
      ],
    },
  });
  ```

  ```kotlin Kotlin theme={"system"}
  var response =
    client.pushTask(
      taskID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
      pushTaskPayload =
        PushTaskPayload(
          action = Action.entries.first { it.value == "addObject" },
          records =
            listOf(
              PushTaskRecords(
                objectID = "o",
                additionalProperties =
                  mapOf("key" to JsonPrimitive("bar"), "foo" to JsonPrimitive("1")),
              ),
              PushTaskRecords(
                objectID = "k",
                additionalProperties =
                  mapOf("key" to JsonPrimitive("baz"), "foo" to JsonPrimitive("2")),
              ),
            ),
        ),
    )
  ```

  ```php PHP theme={"system"}
  $response = $client->pushTask(
      '6c02aeb1-775e-418e-870b-1faccd4b2c0f',
      ['action' => 'addObject',
          'records' => [
              ['key' => 'bar',
                  'foo' => '1',
                  'objectID' => 'o',
              ],

              ['key' => 'baz',
                  'foo' => '2',
                  'objectID' => 'k',
              ],
          ],
      ],
  );
  ```

  ```python Python theme={"system"}
  response = client.push_task(
      task_id="6c02aeb1-775e-418e-870b-1faccd4b2c0f",
      push_task_payload={
          "action": "addObject",
          "records": [
              {
                  "key": "bar",
                  "foo": "1",
                  "objectID": "o",
              },
              {
                  "key": "baz",
                  "foo": "2",
                  "objectID": "k",
              },
          ],
      },
  )
  ```

  ```ruby Ruby theme={"system"}
  response = client.push_task(
    "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
    Algolia::Ingestion::PushTaskPayload.new(
      action: "addObject",
      records: [
        Algolia::Ingestion::PushTaskRecords.new(key: "bar", foo: "1", algolia_object_id: "o"),
        Algolia::Ingestion::PushTaskRecords.new(key: "baz", foo: "2", algolia_object_id: "k")
      ]
    )
  )
  ```

  ```scala Scala theme={"system"}
  val response = Await.result(
    client.pushTask(
      taskID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
      pushTaskPayload = PushTaskPayload(
        action = Action.withName("addObject"),
        records = Seq(
          PushTaskRecords(
            objectID = "o",
            additionalProperties = Some(List(JField("key", JString("bar")), JField("foo", JString("1"))))
          ),
          PushTaskRecords(
            objectID = "k",
            additionalProperties = Some(List(JField("key", JString("baz")), JField("foo", JString("2"))))
          )
        )
      )
    ),
    Duration(100, "sec")
  )
  ```

  ```swift Swift theme={"system"}
  let response = try await client.pushTask(
      taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
      pushTaskPayload: PushTaskPayload(
          action: IngestionAction.addObject,
          records: [
              PushTaskRecords(from: [
                  "objectID": AnyCodable("o"),
                  "key": AnyCodable("bar"),
                  "foo": AnyCodable("1"),
              ]),
              PushTaskRecords(from: [
                  "objectID": AnyCodable("k"),
                  "key": AnyCodable("baz"),
                  "foo": AnyCodable("2"),
              ]),
          ]
      )
  )
  ```
</CodeGroup>

## Performance considerations

If you don't need [an Algolia-managed transformation](/doc/guides/sending-and-managing-data/send-and-update-your-data/how-to/transform-your-data-with-code),
[send records in batches](/doc/guides/sending-and-managing-data/send-and-update-your-data/how-to/sending-records-in-batches)
using the regular API client methods to avoid processing overhead.

## Supported indexing actions

The Push to Algolia connector supports all [`action`](/doc/rest-api/search/batch) types for batch indexing operations.
For `deleteObject`, `delete`, and `clear` actions,
it skips the transformation and uses [traditional indexing instead](/doc/guides/sending-and-managing-data/send-and-update-your-data/how-to/sending-records-in-batches).

## Connector Debugger

To check and debug `pushTask` operations:

* Check incoming events in the [Connector Debugger](https://dashboard.algolia.com/connectors/debugger) on the Algolia dashboard.
  The `eventID` returned by a successful `pushTask` API call shows the status of the indexing operation.
* To get real-time feedback, add the [`watch`](/doc/rest-api/ingestion/push-task) parameter to the `pushTask` API call.
  The response body reports errors and successes.

## Limitations

This connector is subject to the following limitations:

* [Connectors limits](/doc/guides/scaling/algolia-service-limits/#connectors-limits)
* [Transformation limits](/doc/guides/scaling/algolia-service-limits/#data-transformation-and-fetch-limits)
