Bulk Categories by Id
POST/categories/bulk/id
The bulk endpoints offer an efficient way of importing/updating large amounts of categories with just a single API call. When using the bulk id
endpoint, the categories are identified by Propeller category id
. If a category with such id
doesn't already exist, it will be created. If it does exist, the category will be updated.
Category Bulk endpoints support bulk change of category attributes for multiple categories as well. To learn more about Attributes, go here.
A single category's attributes can be modified as explained in Bulk resource attribute values by resource lookup key, but if it's needed to modify attributes for multiple categories, this endpoint should be used.
Fields
Name | Required |
---|---|
categories (array of category objects) | yes |
sourceId | yes |
source | yes |
language | yes |
names | yes |
descriptions | no |
shortDescriptions | no |
attributes Read more about attributes | no |
parent | yes |
For more details on attributes
field, read this.
Directives
Name | Description | Fields |
---|---|---|
skipIfNotEmpty | On update, skip updating fields of an existing category that are not empty | array of field names e.g. names, descriptions, etc. |
skipMoveOnUpdate | On update, skip moving an existing category in the parent category provided | empty array |
mergeTranslationsOnUpdate | On update, delete all translation for a category that are not provided in the payload | empty array |
Request
- application/json
Body
Array [
Array [
]
Array [
]
Array [
]
Array [
]
]
Array [
]
categories
object[]
descriptions
object[]
names
object[]
parent
object
shortDescription
object[]
shortDescriptions
object[]
directives
object[]
Responses
- 200
- 400
Bulk Categories by Id - 200
Response Headers
Alt-Svc
string
Via
string
alt-svc
string
content-length
string
date
string
return-format
string
server
string
x-request-id
string
- application/json
- Schema
- Example (from schema)
- Bulk Categories by Id - 200
Schema
Array [
]
data
object[]
{
"data": [
{
"action": "create",
"id": 1781,
"key": 1800,
"lookupKey": "id",
"success": true
},
{
"action": "create",
"id": 1783,
"key": 1850,
"lookupKey": "id",
"success": true
},
{
"action": "create",
"id": 1785,
"key": 1900,
"lookupKey": "id",
"success": true
}
],
"messages": [
"Completed"
],
"total": 3
}
{
"data": [
{
"action": "create",
"id": 1781,
"key": 1800,
"lookupKey": "id",
"success": true
},
{
"action": "create",
"id": 1783,
"key": 1850,
"lookupKey": "id",
"success": true
},
{
"action": "create",
"id": 1785,
"key": 1900,
"lookupKey": "id",
"success": true
}
],
"messages": [
"Completed"
],
"total": 3
}
Bulk Categories by Id - 400 (Invalid schema)
Response Headers
Alt-Svc
string
Via
string
alt-svc
string
content-length
string
date
string
return-format
string
server
string
x-request-id
string
- application/json
- Schema
- Example (from schema)
- Bulk Categories by Id - 400 (Invalid schema)
Schema
error
object
{
"error": {
"code": 10007,
"messages": [
"#/categories/2: extraneous key [shortDescription] is not permitted"
],
"moreInfo": "https://www.propel.us/docs/errors/10007",
"status": 400,
"type": "SchemaValidationException"
}
}
{
"error": {
"code": 10007,
"messages": [
"#/categories/2: extraneous key [shortDescription] is not permitted"
],
"moreInfo": "https://www.propel.us/docs/errors/10007",
"status": 400,
"type": "SchemaValidationException"
}
}