Question Details

No question body available.

Tags

javascript collections sdk clone algolia

Answers (1)

April 17, 2026 Score: 2 Rep: 3,099 Quality: Low Completeness: 80%

Here's how I managed to implement automatic clone by "spying" their API from the inspector while trying the operations in the Mechandising Studio.

Premise: authentication is the same you use to interact with index, with Algolia app id and API key passed as headers.

  1. Read List (Discovery)

    • Endpoint: GET https://experiences.algolia.com/1/collections?indexName={sourceIndexName}&offset=0&limit=50.

    • This returns basic metadata

  2. Read Detail

    • Endpoint: GET https://experiences.algolia.com/1/collections/{collectionid}.

    • Retrieves the full object, specifically the records array (for manual pins) and the conditions object (for dynamic rules).

  3. Write/Clone (Target Index)

    • Endpoint: POST https://experiences.algolia.com/1/collections.

    • Payload Mapping:

      • add: Map the records array from Step 2.

      • conditions: Map the conditions object from Step 2.

      • name / description: Copy these strings from Step 2.

    • Example

      {
        "name": "Some collection",
        "indexName": "targetIndexName",
        "description": "Description (optional)",
        "add": [
          "objectID1",
          "objectID_2"
        ],
        "remove": [],
        "conditions": {
          "rules": [
            {
              "attribute": "brand",
              "operator": "is",
              "value": "Apple"
            }
          ]
        }
      }
      

Hope this helps!