---
openapi: 3.0.3
info:
  title: Braze REST API – Create catalog fields
  description: 'Use this endpoint to create multiple fields in your catalog.

    '
  version: 1.0.0
  contact:
    name: Braze Support
    url: https://www.braze.com/docs/braze_support/
  license:
    name: Braze Documentation
    url: https://www.braze.com/docs/api/home/
servers:
  - url: https://rest.iad-01.braze.com
    description: US-01
  - url: https://rest.iad-02.braze.com
    description: US-02
  - url: https://rest.iad-03.braze.com
    description: US-03
  - url: https://rest.iad-04.braze.com
    description: US-04
  - url: https://rest.iad-05.braze.com
    description: US-05
  - url: https://rest.iad-06.braze.com
    description: US-06
  - url: https://rest.iad-07.braze.com
    description: US-07
  - url: https://rest.iad-08.braze.com
    description: US-08
  - url: https://rest.us-10.braze.com
    description: US-10
  - url: https://rest.fra-01.braze.eu
    description: EU-01
  - url: https://rest.fra-02.braze.eu
    description: EU-02
  - url: https://rest.au-01.braze.com
    description: AU-01
  - url: https://rest.id-01.braze.com
    description: ID-01
  - url: https://rest.jp-01.braze.com
    description: JP-01
  - url: https://rest.kr-01.braze.com
    description: KR-01
security:
  - BearerAuth: []
paths:
  "/catalogs/{catalog_name}/fields":
    post:
      summary: Create catalog fields
      description: |
        > Use this endpoint to create multiple fields in your catalog.

        ## Prerequisites

        To use this endpoint, you'll need an [API key]({{site.baseurl}}/api/basics#rest-api-key/) with the `catalogs.create_fields` permission.

        ## Rate limit

        This endpoint has a shared rate limit of 50 requests per minute between all asynchronous catalog fields and selections endpoints, as documented in [API rate limits]({{site.baseurl}}/api/api_limits/).

        ## Path parameters

        The following table lists the path parameters for this endpoint.

        | Parameter      | Required | Data Type | Description          |
        | -------------- | -------- | --------- | -------------------- |
        | `catalog_name` | Required | String    | Name of the catalog. |

        ## Request parameters

        The following table lists the request parameters for this endpoint.

        | Parameter | Required | Data Type | Description                                                                                                  |
        | --------- | -------- | --------- | ------------------------------------------------------------------------------------------------------------ |
        | `fields`  | Required | Array     | An array that contains field objects. The fields objects should contain the name and type of the new fields. |

        ## Example request

        ```
        curl --location --request POST 'https://rest.iad-03.braze.com/catalogs/restaurants/fields' \
        --header 'Content-Type: application/json' \
        --header 'Authorization: Bearer YOUR-REST-API-KEY' \
        --data-raw '{
          "fields": [
            {
              "name": "Name",
              "type": "string"
            },
            {
              "name": "Ratings",
              "type": "number"
            },
            {
              "name": "Loyalty_Program",
              "type": "boolean"
            },
            {
              "name": "Created_At",
              "type": "time"
            },
            {
              "name": "Location",
              "type": "geo"
            },
            {
              "name": "Preferences",
              "type": "object"
            },
            {
              "name": "Top_Dishes",
              "type": "array"
            }
          ]
        }'
        ```

        **Note:**
        You must provide geolocation field values as a `[longitude, latitude]` array—for example, `[-73.988103, 40.779109]`. Latitude must be between -90 and 90; longitude must be between -180 and 180.

        ## Response

        There are three status code responses for this endpoint: `202`, `400`, and `404`.


        ### Example success response

        The status code `202` could return the following response body.

        ```json
        {
          "message": "success"
        }
        ```


        ### Example error response

        The status code `400` could return the following response body. Refer to [Troubleshooting](#troubleshooting) for more information about errors you may encounter.

        ```json
        {
          "errors": [
            {
              "id": "catalog-not-found",
              "message": "Could not find catalog",
              "parameters": [
                "catalog_name"
              ],
              "parameter_values": [
                "restaurants"
              ]
            }
          ],
          "message": "Invalid Request"
        }
        ```

        ## Troubleshooting

        The following table lists possible returned errors and their associated troubleshooting steps.

        | Error                                | Troubleshooting                                                                                        |
        |--------------------------------------|--------------------------------------------------------------------------------------------------------|
        | `arbitrary-error`                    | An arbitrary error occurred. Please try again or contact [Support]({{site.baseurl}}/support_contact/). |
        | `catalog-not-found`                  | Check that the catalog name is valid.                                                                  |
        | `company-size-limit-already-reached` | The catalog storage size limit is reached.                                                             |
        | `request-includes-too-many-fields`   | Each request can support up to 50 new fields.                                                          |
        | `catalog-exceeds-fields-limit`       | Catalog cannot have more than 500 fields.                                                              |

        ## Response status codes

        The following table lists the responses for this endpoint, the error message you may receive, and how to resolve it.

        | Status code | Meaning | Error message | How to resolve |
        | --- | --- | --- | --- |
        | `202 Accepted` | The request was accepted for asynchronous processing. The fields are added to the catalog. | `success` | No action needed. |
        | `400 Bad Request` | The `fields` value isn't a valid array. | `The fields array is invalid` | Pass `fields` as an array of field objects. |
        | `400 Bad Request` | The request includes more than 50 fields. | `Request has too many fields. The maximum is 50.` | Send 50 or fewer fields per request. |
        | `400 Bad Request` | One or more field names exceed the maximum length. | `Some field name are longer than the maximum length` | Shorten the field names. |
        | `400 Bad Request` | A field `name` or `type` is invalid. | `Field 'name' or 'type' is invalid.` | Use a valid field `name` and a supported `type`. |
        | `400 Bad Request` | A field with this name already exists on the catalog. | `Field <name> already exists on the catalog.` | Use a field name that doesn't already exist. |
        | `404 Not Found` | No catalog matches the `catalog_name`. | `Could not find catalog` | Pass a valid `catalog_name`. Find it with the [List catalogs endpoint]({{site.baseurl}}/api/endpoints/catalogs/catalog_management/synchronous/get_list_catalogs/). |
        | `401 Unauthorized` | The REST API key is missing, malformed, or sent to the wrong REST endpoint. | `Invalid API key` | Send the key as `Authorization: Bearer YOUR_REST_API_KEY` to the correct [REST endpoint]({{site.baseurl}}/api/basics/#endpoints). For more causes, see [Errors and responses]({{site.baseurl}}/api/errors/#fatal-errors). |
        | `403 Access Denied` | The REST API key doesn't have the required permission. | `Access Denied` | Use a REST API key that has the `catalogs.create_fields` permission. |
        | `429 Rate Limited` | You exceeded the rate limit for this endpoint. | `Over rate limit` | Slow your request rate and retry with exponential backoff. See [API rate limits]({{site.baseurl}}/api/api_limits/). |
        | `5XX Internal Server Error` | An unexpected error occurred on the Braze server. | `Internal Server Error` | Retry with exponential backoff. If the error persists, contact [Support]({{site.baseurl}}/braze_support/). |

      operationId: post_catalogs_catalog_name_fields_post_create_catalog_fields
      tags:
        - Catalogs
      responses:
        '202':
          description: The request was accepted for asynchronous processing. The fields are added to the catalog.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCatalogFieldsResponse'
        '400':
          description: |-
            Bad Request. Causes include:

            - `The fields array is invalid` — The `fields` value isn't a valid array.
            - `Request has too many fields. The maximum is 50.` — The request includes more than 50 fields.
            - `Some field name are longer than the maximum length` — One or more field names exceed the maximum length.
            - `Field 'name' or 'type' is invalid.` — A field `name` or `type` is invalid.
            - `Field <name> already exists on the catalog.` — A field with this name already exists on the catalog.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: No catalog matches the `catalog_name`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: The REST API key is missing, malformed, or sent to the wrong REST endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: The REST API key doesn't have the required permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: You exceeded the rate limit for this endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '5XX':
          description: An unexpected error occurred on the Braze server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - fields
              properties:
                fields:
                  type: array
                  items:
                    type: object
                  description: An array that contains field objects. The fields objects should contain the name and type of the new fields.
      parameters:
        - name: catalog_name
          in: path
          required: true
          description: Path parameter `catalog_name`.
          schema:
            type: string
components:
  schemas:
    CreateCatalogFieldsResponse:
      type: object
      properties:
        message:
          type: string
    ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              message:
                type: string
              parameters:
                type: array
                items:
                  type: string
              parameter_values:
                type: array
                items:
                  type: string
        message:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: REST API key
