# Create nominal speeds (https://docs.pulsarml.com/v1/api-reference/nominal-speeds/post-nominal-speeds)

Set the expected rate for one or many machine/SKU pairs. The body is a JSON **array**.

`nominalSpeed` must be greater than zero, and `machine` and `sku` each accept an `id` or a
`name`. `countingFactor` defaults to `1` and converts sensor pulses into the SKU's unit —
set it to `12` where one pulse means a case of twelve.

## `POST /v1/nominal-speeds`

Base URLs:
- `https://draco.prod.pulsarml.com` — Production
- `https://draco.dev.pulsarml.com` — Development (sandbox)

Authentication: send your API key in the `x-api-key` header.

### Request body (`application/json`, required)

Type: array of object

- `nominalSpeed` (number, required, > 0, e.g. `60`) — The nominal speed of the machine
- `countingFactor` (number, optional, default `1`, > 0, e.g. `60`) — The counting factor of the machine
- `machine` (object, required)
  - `id` (integer, optional, nullable, > 0, e.g. `1`) — The id of the machine
  - `name` (string, optional, nullable, e.g. `"Machine 1"`) — The name of the machine
- `sku` (object, required)
  - `id` (string, optional, nullable, e.g. `"9ce2c6b4-a1f4-4bf2-b5c8-10436d1018cc"`) — The id of the sku
  - `name` (string, optional, nullable, e.g. `"sku 1"`) — The name of the sku

### Responses

#### 200 — The nominal speeds that were created

Type: array of object

- `id` (string, required, e.g. `"36f7b519-d93e-4ec8-8245-7f4b8c123456"`) — The unique identifier for the nominal speed.
- `machine` (object, required) — The machine associated with the nominal speed.
  - `id` (integer, required, e.g. `1`) — The unique identifier for the machine.
  - `name` (string, required, e.g. `"machine 1"`) — The name of the machine.
- `sku` (object, required) — The sku associated with the nominal speed.
  - `id` (string, required, e.g. `"f1c3a9e9-1cef-4d1d-a6d7-e18607cbfa55"`) — The unique identifier for the sku.
  - `name` (string, required, e.g. `"sku 1"`) — The name of the sku.
  - `description` (string, required, e.g. `"sku 1 description"`) — The description of the sku.
  - `unit` (string, required, e.g. `"sku 1 unit"`) — The unit of the sku.
- `nominalSpeed` (number, required, e.g. `100`) — The nominal speed of the machine.
- `countingFactor` (number, required, e.g. `1`) — The counting factor of the sensor associated with the machine and sku.
- `createdAt` (string (date-time), required, e.g. `"2024-01-01T00:00:00.000Z"`) — The timestamp when the nominal speed was created.
- `updatedAt` (string (date-time), required, e.g. `"2024-01-01T00:00:00.000Z"`) — The timestamp when the nominal speed was last updated.
- `deletedAt` (string (date-time), optional, nullable, e.g. `"2024-01-02T00:00:00.000Z"`) — The timestamp when the nominal speed was deleted, if applicable.

#### 422 — Validation Error

Type: object (`HTTPValidationError`)

- `detail` (array of object, optional)
  - `loc` (array of string | integer, required)
  - `msg` (string, required)
  - `type` (string, required)

### Example request

```bash
curl -X POST 'https://draco.prod.pulsarml.com/v1/nominal-speeds' \
  -H 'x-api-key: <YOUR_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '[
    {
      "nominalSpeed": 60,
      "countingFactor": 60,
      "machine": {
        "id": 1,
        "name": "Machine 1"
      },
      "sku": {
        "id": "9ce2c6b4-a1f4-4bf2-b5c8-10436d1018cc",
        "name": "sku 1"
      }
    }
  ]'
```