---
title: "Create a configuration"
description: "Use POST /configs to add a project configuration. The current public operation is Config.register."
canonical: https://docs.ordering.co/api-reference/guides/create-config/
---

# Create a configuration

> **API operation:** [Open the endpoint in the API reference](https://docs.ordering.co/api-reference/#tag/configs/POST/configs)

Use `POST /configs` to add a project configuration. The current public operation is `Config.register`.

The operation contract requires a unique `key`. It supports configuration types `1` through `5`; `value`, `options`, and `image` requirements depend on the selected type. See the API Reference request schema for the complete field contract.

The behavior is operation-specific:

- `value` is required unless `type` is `5`.
- `options` is required for types `2`, `3`, and `4` and is validated as structured JSON.
- `image` is required for type `5`; successful image handling stores its result as the configuration value.
- Creating a configuration is restricted to the server or administrator roles represented by the current middleware.

Do not place credentials, provider secrets, or customer data in examples. Protected configuration values can be masked in API responses.

## Legacy SDK example

```javascript
const response = await ordering.configs().save(data)
```

Confirm the SDK package and version before using this helper. The operation guide specifies `POST /configs`, including request fields, authentication, responses, and errors.

## OpenAPI reference

**Operation:** `POST /configs`

**Request body fields**

| Name      | Type    | Required |
| --------- | ------- | -------- |
| `image`   | any     | No       |
| `key`     | any     | Yes      |
| `options` | string  | No       |
| `type`    | integer | No       |
| `value`   | any     | No       |

**Responses**

| Code | Description                           |
| ---- | ------------------------------------- |
| 200  | OK (Envelope)                         |
| 400  | Bad Request (ErrorResponse)           |
| 401  | Unauthorized                          |
| 404  | Not Found                             |
| 429  | Too Many Requests (ErrorResponse)     |
| 500  | Internal Server Error (ErrorResponse) |
| 503  | Service Unavailable (ErrorResponse)   |

[Open this operation in the API reference](https://docs.ordering.co/api-reference/#tag/configs/POST/configs)
