1 post:
2 operationId: PostSearchIndexesIdReindex
3 summary: Reindex a Search Index
4 description: >-
5 Rebuild a search index's documents using the `seed` function of its index
6 definition. The rebuild runs in the background, so the response is returned
7 immediately with the ID of the triggered job. Use the List Search Indexes
8 API route to check the index's `status` and know when the rebuild is done.
9 externalDocs:
10 description: Learn about reindexing and index migrations
11 url: >-
12 https://docs.medusajs.com/resources/infrastructure-modules/search/reindexing
13 x-authenticated: true
14 parameters:
15 - name: id
16 in: path
17 description: The search index's name, such as `product`.
18 required: true
19 schema:
20 type: string
21 security:
22 - api_token: []
23 - cookie_auth: []
24 - jwt_token: []
25 requestBody:
26 content:
27 application/json:
28 schema:
29 $ref: ../components/schemas/AdminReindexSearchIndex.yaml
30 x-codeSamples:
31 - lang: JavaScript
32 label: JS SDK
33 source:
34 $ref: ../code_samples/JavaScript/admin_search-indexes_{id}_reindex/post.js
35 - lang: Shell
36 label: cURL
37 source:
38 $ref: ../code_samples/Shell/admin_search-indexes_{id}_reindex/post.sh
39 tags:
40 - Search Indexes
41 responses:
42 '202':
43 description: OK
44 content:
45 application/json:
46 schema:
47 $ref: ../components/schemas/AdminSearchIndexReindexResponse.yaml
48 '400':
49 $ref: ../components/responses/400_error.yaml
50 '401':
51 $ref: ../components/responses/unauthorized.yaml
52 '404':
53 $ref: ../components/responses/not_found_error.yaml
54 '409':
55 $ref: ../components/responses/invalid_state_error.yaml
56 '422':
57 $ref: ../components/responses/invalid_request_error.yaml
58 '500':
59 $ref: ../components/responses/500_error.yaml
60 x-workflow: reindexSearchIndexesWorkflow
61 x-events: []