# Spawn Create Categories Job

Create a catalog category bulk create job to create a batch of catalog categories.

Accepts up to 100 catalog categories per request. The maximum allowed payload size is 5MB.
The maximum number of jobs in progress at one time is 500.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m`

**Scopes:**
`catalogs:write`

# OpenAPI definition

```json
{
  "openapi": "3.0.2",
  "info": {
    "title": "Catalogs API",
    "version": "2024-02-15",
    "description": "The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details.",
    "contact": {
      "name": "Klaviyo Developer Experience Team",
      "email": "developers@klaviyo.com",
      "url": "https://developers.klaviyo.com"
    },
    "termsOfService": "https://www.klaviyo.com/legal/api-terms",
    "license": {
      "name": "License",
      "url": "https://www.klaviyo.com/legal"
    }
  },
  "servers": [
    {
      "url": "https://a.klaviyo.com",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/catalog-category-bulk-create-jobs/": {
      "post": {
        "operationId": "spawn_create_categories_job",
        "summary": "Spawn Create Categories Job",
        "description": "Create a catalog category bulk create job to create a batch of catalog categories.\n\nAccepts up to 100 catalog categories per request. The maximum allowed payload size is 5MB.\nThe maximum number of jobs in progress at one time is 500.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m`\n\n**Scopes:**\n`catalogs:write`",
        "parameters": [
          {
            "name": "revision",
            "in": "header",
            "description": "API endpoint revision (format: YYYY-MM-DD[.suffix])",
            "required": true,
            "schema": {
              "type": "string",
              "default": "2024-02-15"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CatalogCategoryCreateJobCreateQuery"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostCatalogCategoryCreateJobResponse"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/ClientError"
          },
          "5XX": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "tags": [
          "Categories"
        ],
        "x-klaviyo-pre-release": "None",
        "x-klaviyo-ratelimit": {
          "burst": "75/s",
          "steady": "700/m"
        },
        "x-klaviyo-scopes": [
          "catalogs:write"
        ],
        "x-klaviyo-subtag": "Categories"
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorSource": {
        "type": "object",
        "properties": {
          "pointer": {
            "description": "A pointer to the source of the error in the request payload.",
            "type": "string",
            "example": "/data",
            "default": "/data"
          }
        }
      },
      "APIJobErrorPayload": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Unique identifier for the error.",
            "type": "string",
            "example": "e4eebb08-b055-4a6f-bb13-c8cb69c9eb94",
            "default": "e4eebb08-b055-4a6f-bb13-c8cb69c9eb94"
          },
          "code": {
            "description": "A code for classifying the error type.",
            "type": "string",
            "example": "invalid",
            "default": "invalid"
          },
          "title": {
            "description": "A high-level message about the error.",
            "type": "string",
            "example": "Invalid input",
            "default": "Invalid input"
          },
          "detail": {
            "description": "Specific details about the error.",
            "type": "string",
            "example": "The payload provided in the request is invalid.",
            "default": "The payload provided in the request is invalid."
          },
          "source": {
            "description": "Additional information on the source of the error.",
            "$ref": "#/components/schemas/ErrorSource"
          }
        },
        "required": [
          "id",
          "code",
          "title",
          "detail",
          "source"
        ]
      },
      "CatalogCategoryCreateQueryResourceObject": {
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/CatalogCategoryEnum"
          },
          "attributes": {
            "type": "object",
            "properties": {
              "external_id": {
                "description": "The ID of the catalog category in an external system.",
                "type": "string",
                "example": "SAMPLE-DATA-CATEGORY-APPAREL",
                "default": "SAMPLE-DATA-CATEGORY-APPAREL"
              },
              "name": {
                "description": "The name of the catalog category.",
                "type": "string",
                "example": "Sample Data Category Apparel",
                "default": "Sample Data Category Apparel"
              },
              "integration_type": {
                "description": "The integration type. Currently only \"$custom\" is supported.",
                "type": "string",
                "example": "$custom",
                "default": "$custom",
                "enum": [
                  "$custom"
                ]
              },
              "catalog_type": {
                "description": "The type of catalog. Currently only \"$default\" is supported.",
                "type": "string",
                "example": "$default",
                "default": "$default"
              }
            },
            "required": [
              "external_id",
              "name"
            ]
          },
          "relationships": {
            "type": "object",
            "properties": {
              "items": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "type",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "$ref": "#/components/schemas/CatalogItemEnum"
                        },
                        "id": {
                          "description": "A list of catalog item IDs that are in the given category.",
                          "type": "string",
                          "example": "$custom:::$default:::SAMPLE-DATA-ITEM-1",
                          "default": "$custom:::$default:::SAMPLE-DATA-ITEM-1"
                        }
                      }
                    }
                  }
                },
                "required": [
                  "data"
                ]
              }
            }
          }
        },
        "required": [
          "type",
          "attributes"
        ]
      },
      "CatalogCategoryCreateJobCreateQueryResourceObject": {
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/CatalogCategoryBulkCreateJobEnum"
          },
          "attributes": {
            "type": "object",
            "properties": {
              "categories": {
                "description": "Array of catalog categories to create.",
                "type": "object",
                "properties": {
                  "data": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/CatalogCategoryCreateQueryResourceObject"
                    }
                  }
                },
                "required": [
                  "data"
                ]
              }
            },
            "required": [
              "categories"
            ]
          }
        },
        "required": [
          "type",
          "attributes"
        ]
      },
      "CatalogCategoryCreateJobCreateQuery": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/CatalogCategoryCreateJobCreateQueryResourceObject"
          }
        },
        "required": [
          "data"
        ]
      },
      "PostCatalogCategoryCreateJobResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "type": {
                "$ref": "#/components/schemas/CatalogCategoryBulkCreateJobEnum"
              },
              "id": {
                "description": "Unique identifier for retrieving the job. Generated by Klaviyo.",
                "type": "string"
              },
              "attributes": {
                "type": "object",
                "properties": {
                  "status": {
                    "description": "Status of the asynchronous job.",
                    "type": "string",
                    "example": "processing",
                    "default": "processing",
                    "enum": [
                      "cancelled",
                      "complete",
                      "processing",
                      "queued"
                    ]
                  },
                  "created_at": {
                    "description": "The date and time the job was created in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.mmmmmm).",
                    "type": "string",
                    "format": "date-time",
                    "example": "2022-11-08T00:00:00+00:00",
                    "default": "2022-11-08T00:00:00+00:00"
                  },
                  "total_count": {
                    "description": "The total number of operations to be processed by the job. See `completed_count` for the job's current progress.",
                    "type": "integer",
                    "example": 10,
                    "default": 10
                  },
                  "completed_count": {
                    "description": "The total number of operations that have been completed by the job.",
                    "type": "integer",
                    "example": 9,
                    "default": 9
                  },
                  "failed_count": {
                    "description": "The total number of operations that have failed as part of the job.",
                    "type": "integer",
                    "example": 1,
                    "default": 1
                  },
                  "completed_at": {
                    "description": "Date and time the job was completed in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.mmmmmm).",
                    "type": "string",
                    "format": "date-time",
                    "example": "2022-11-08T00:00:00+00:00",
                    "default": "2022-11-08T00:00:00+00:00"
                  },
                  "errors": {
                    "description": "Array of errors encountered during the processing of the job.",
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/APIJobErrorPayload"
                    }
                  },
                  "expires_at": {
                    "description": "Date and time the job expires in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.mmmmmm).",
                    "type": "string",
                    "format": "date-time",
                    "example": "2022-11-08T00:00:00+00:00",
                    "default": "2022-11-08T00:00:00+00:00"
                  }
                },
                "required": [
                  "status",
                  "created_at",
                  "total_count"
                ]
              },
              "relationships": {
                "type": "object",
                "properties": {
                  "categories": {
                    "type": "object",
                    "properties": {
                      "data": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "type",
                            "id"
                          ],
                          "properties": {
                            "type": {
                              "$ref": "#/components/schemas/CatalogCategoryEnum"
                            },
                            "id": {
                              "description": "IDs of the created catalog categories.",
                              "type": "string",
                              "example": "$custom:::$default:::SAMPLE-DATA-CATEGORY-APPAREL",
                              "default": "$custom:::$default:::SAMPLE-DATA-CATEGORY-APPAREL"
                            }
                          }
                        }
                      },
                      "links": {
                        "$ref": "#/components/schemas/RelationshipLinks"
                      }
                    },
                    "required": [
                      "data"
                    ]
                  }
                }
              },
              "links": {
                "$ref": "#/components/schemas/ObjectLinks"
              }
            },
            "required": [
              "type",
              "id",
              "attributes",
              "links"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "RelationshipLinks": {
        "type": "object",
        "properties": {
          "self": {
            "type": "string",
            "format": "uri"
          },
          "related": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "self",
          "related"
        ]
      },
      "ObjectLinks": {
        "type": "object",
        "properties": {
          "self": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "self"
        ]
      },
      "CatalogItemEnum": {
        "type": "string",
        "enum": [
          "catalog-item"
        ]
      },
      "CatalogCategoryEnum": {
        "type": "string",
        "enum": [
          "catalog-category"
        ]
      },
      "CatalogCategoryBulkCreateJobEnum": {
        "type": "string",
        "enum": [
          "catalog-category-bulk-create-job"
        ]
      }
    },
    "responses": {
      "ClientError": {
        "description": "Client Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "errors": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "code",
                      "title",
                      "detail"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "code": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "detail": {
                        "type": "string"
                      },
                      "source": {
                        "type": "object",
                        "properties": {
                          "pointer": {
                            "type": "string"
                          },
                          "parameter": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "required": [
                "errors"
              ]
            }
          }
        }
      },
      "ServerError": {
        "description": "Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "errors": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "code",
                      "title",
                      "detail"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "code": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "detail": {
                        "type": "string"
                      },
                      "source": {
                        "type": "object",
                        "properties": {
                          "pointer": {
                            "type": "string"
                          },
                          "parameter": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "required": [
                "errors"
              ]
            }
          }
        }
      }
    },
    "securitySchemes": {
      "Klaviyo-API-Key": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Private key authentication for /api/ endpoints is performed by setting the `Authorization` header to `Klaviyo-API-Key your-private-api-key`<br>For more information please visit https://developers.klaviyo.com/en/v2024-02-15/reference/api-overview#authentication",
        "x-default": "Klaviyo-API-Key your-private-api-key"
      }
    }
  },
  "tags": [
    {
      "name": "Categories"
    }
  ],
  "security": [
    {
      "Klaviyo-API-Key": []
    }
  ],
  "x-readme": {
    "explorer-enabled": false,
    "proxy-enabled": true,
    "samples-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 101,
      "1": 206,
      "2": 44,
      "3": 197,
      "4": 12,
      "5": 117,
      "6": 185,
      "7": 0,
      "8": 29,
      "9": 0,
      "10": 187,
      "11": 18
    }
  }
}
```