Raw
1 get:
2 operationId: GetCollectionsId
3 summary: Get a Collection
4 description: >-
5 Retrieve a collection by its ID. You can expand the collection's relations
6 or select the fields that should be returned using the query parameters.
7 x-authenticated: true
8 parameters:
9 - name: id
10 in: path
11 description: The collection's ID.
12 required: true
13 schema:
14 type: string
15 - name: fields
16 in: query
17 description: >-
18 Comma-separated fields that should be included in the returned data. if
19 a field is prefixed with `+` it will be added to the default fields,
20 using `-` will remove it from the default fields. without prefix it will
21 replace the entire default fields.
22 required: false
23 schema:
24 type: string
25 title: fields
26 description: >-
27 Comma-separated fields that should be included in the returned data.
28 if a field is prefixed with `+` it will be added to the default
29 fields, using `-` will remove it from the default fields. without
30 prefix it will replace the entire default fields.
31 externalDocs:
32 url: '#select-fields-and-relations'
33 security:
34 - api_token: []
35 - cookie_auth: []
36 - jwt_token: []
37 x-codeSamples:
38 - lang: JavaScript
39 label: JS SDK
40 source:
41 $ref: ../code_samples/JavaScript/admin_collections_{id}/get.js
42 - lang: Shell
43 label: cURL
44 source:
45 $ref: ../code_samples/Shell/admin_collections_{id}/get.sh
46 tags:
47 - Collections
48 responses:
49 '200':
50 description: OK
51 content:
52 application/json:
53 schema:
54 $ref: ../components/schemas/AdminCollectionResponse.yaml
55 '400':
56 $ref: ../components/responses/400_error.yaml
57 '401':
58 $ref: ../components/responses/unauthorized.yaml
59 '404':
60 $ref: ../components/responses/not_found_error.yaml
61 '409':
62 $ref: ../components/responses/invalid_state_error.yaml
63 '422':
64 $ref: ../components/responses/invalid_request_error.yaml
65 '500':
66 $ref: ../components/responses/500_error.yaml
67 post:
68 operationId: PostCollectionsId
69 summary: Update a Collection
70 description: Update a collection's details.
71 x-authenticated: true
72 parameters:
73 - name: id
74 in: path
75 description: The collection's ID.
76 required: true
77 schema:
78 type: string
79 - name: fields
80 in: query
81 description: >-
82 Comma-separated fields that should be included in the returned data. if
83 a field is prefixed with `+` it will be added to the default fields,
84 using `-` will remove it from the default fields. without prefix it will
85 replace the entire default fields.
86 required: false
87 schema:
88 type: string
89 title: fields
90 description: >-
91 Comma-separated fields that should be included in the returned data.
92 if a field is prefixed with `+` it will be added to the default
93 fields, using `-` will remove it from the default fields. without
94 prefix it will replace the entire default fields.
95 externalDocs:
96 url: '#select-fields-and-relations'
97 security:
98 - api_token: []
99 - cookie_auth: []
100 - jwt_token: []
101 requestBody:
102 content:
103 application/json:
104 schema:
105 allOf:
106 - type: object
107 description: The details to update in a collection.
108 properties:
109 title:
110 type: string
111 title: title
112 description: The collection's title.
113 handle:
114 type: string
115 title: handle
116 description: The collection's handle.
117 metadata:
118 type: object
119 description: The collection's metadata.
120 - type: object
121 description: The details to update in a collection.
122 properties:
123 additional_data:
124 type: object
125 description: >-
126 Pass additional custom data to the API route. This data is
127 passed to the underlying workflow under the
128 `additional_data` parameter.
129 description: The details to update in a collection.
130 x-codeSamples:
131 - lang: JavaScript
132 label: JS SDK
133 source:
134 $ref: ../code_samples/JavaScript/admin_collections_{id}/post.js
135 - lang: Shell
136 label: cURL
137 source:
138 $ref: ../code_samples/Shell/admin_collections_{id}/post.sh
139 tags:
140 - Collections
141 responses:
142 '200':
143 description: OK
144 content:
145 application/json:
146 schema:
147 $ref: ../components/schemas/AdminCollectionResponse.yaml
148 '400':
149 $ref: ../components/responses/400_error.yaml
150 '401':
151 $ref: ../components/responses/unauthorized.yaml
152 '404':
153 $ref: ../components/responses/not_found_error.yaml
154 '409':
155 $ref: ../components/responses/invalid_state_error.yaml
156 '422':
157 $ref: ../components/responses/invalid_request_error.yaml
158 '500':
159 $ref: ../components/responses/500_error.yaml
160 x-workflow: updateCollectionsWorkflow
161 x-events:
162 - name: product-collection.updated
163 payload: |-
164 ```ts
165 {
166 id, // The ID of the product collection
167 }
168 ```
169 description: Emitted when product collections are updated.
170 deprecated: false
171 delete:
172 operationId: DeleteCollectionsId
173 summary: Delete a Collection
174 description: Delete a product collection.
175 x-authenticated: true
176 parameters:
177 - name: id
178 in: path
179 description: The collection's ID.
180 required: true
181 schema:
182 type: string
183 security:
184 - api_token: []
185 - cookie_auth: []
186 - jwt_token: []
187 x-codeSamples:
188 - lang: JavaScript
189 label: JS SDK
190 source:
191 $ref: ../code_samples/JavaScript/admin_collections_{id}/delete.js
192 - lang: Shell
193 label: cURL
194 source:
195 $ref: ../code_samples/Shell/admin_collections_{id}/delete.sh
196 tags:
197 - Collections
198 responses:
199 '200':
200 description: OK
201 content:
202 application/json:
203 schema:
204 $ref: ../components/schemas/AdminCollectionDeleteResponse.yaml
205 '400':
206 $ref: ../components/responses/400_error.yaml
207 '401':
208 $ref: ../components/responses/unauthorized.yaml
209 '404':
210 $ref: ../components/responses/not_found_error.yaml
211 '409':
212 $ref: ../components/responses/invalid_state_error.yaml
213 '422':
214 $ref: ../components/responses/invalid_request_error.yaml
215 '500':
216 $ref: ../components/responses/500_error.yaml
217 x-workflow: deleteCollectionsWorkflow
218 x-events:
219 - name: product-collection.deleted
220 payload: |-
221 ```ts
222 {
223 id, // The ID of the product collection
224 }
225 ```
226 description: Emitted when product collections are deleted.
227 deprecated: false