## Create a number range (tenant:settings:write)

`POST /api/masterdata/sequences`

Module: Master data · operationId: `createSequence` · Tag: Settings · Auth: access token (`Authorization: Bearer <accessToken>`)

Creates a named address range `ADDRESS:NAME` (capitals, digits, `_`, `-`; up to 24 characters after the colon) that address statuses can name (`sequenceType` of `address-statuses`). A range that exists answers `409`; a `currentValue` below the highest number already issued with that prefix answers `400` on `currentValue`.

### Request body

`application/json` (required)

- `minDigits` (integer, required): Minimum number of digits (zero-padded) (max 18)
- `sequenceType` (string, required): Named address range ADDRESS:NAME (max length 32)
- `currentValue` (integer (int64)): Last assigned value
- `label` (string): Name of the range (max length 128)
- `prefix` (string): No whitespace (max length 16)

Example:

```json
{
  "currentValue": 0,
  "label": "Privatkunden",
  "minDigits": 5,
  "prefix": "P",
  "sequenceType": "ADDRESS:PRIVAT"
}
```

### Responses

- **201** Created (`application/json`)
- **400** Malformed body or query parameter (`application/json`)
- **401** Missing, invalid or expired token (empty body)
- **403** The token lacks the permission or carries no tenant (`application/json`)
- **409** Stale version or conflict with existing data (`application/json`)

Fields of the 201 answer:

- `currentValue` (integer (int64), required): Last assigned value
- `highestIssued` (integer (int64), required): Highest number with this prefix already in use (0 when none); the counter cannot be set below it
- `minDigits` (integer, required): Minimum number of digits (zero-padded)
- `nextNumber` (string, required): The next number that would be assigned
- `prefix` (string, required): Prefix of the numbers
- `sequenceType` (string, required): ADDRESS, PRODUCT, MANDATE or a named address range ADDRESS:NAME
- `updatedAt` (string (date-time), required): Time of the last change
- `label` (string): Name of a named range

Example 201 answer:

```json
{
  "currentValue": 70011,
  "highestIssued": 70011,
  "label": "Lieferantennummern",
  "minDigits": 5,
  "nextNumber": "70012",
  "prefix": "",
  "sequenceType": "ADDRESS:LIEFERANT",
  "updatedAt": "2026-09-02T14:30:00Z"
}
```

### Example request

```bash
curl -X POST 'https://api.mbcom.cloud/api/masterdata/sequences' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  --data '{"currentValue":0,"label":"Privatkunden","minDigits":5,"prefix":"P","sequenceType":"ADDRESS:PRIVAT"}'
```
