# Using the API

## :electric\_plug: Charge Point Sensors API

### 🏗️ Creating a Charge Point Sensor

To create a new charge point sensor, send a **`POST`** request to:

```http request
POST /api/v1/charge-point-sensors
```

#### 📥 **Request Body (JSON):**

```json
{
  "chargePointId": 1,
  "type": "occupancy",
  "externalId": "externalid-1234",
  "partnerExternalId": "yourinternalid-1234",
  "value": "true",
  "valueUpdatedAt": "2025-09-10T20:23:44Z"
}
```

#### 📤 **Response (201 Created):**

```json
{
  "id": 166,
  "type": "occupancy",
  "operatorId": 1,
  "chargePointId": 1,
  "externalId": "externalid-1234",
  "partnerExternalId": "yourinternalid-1234",
  "value": "true",
  "valueUpdatedAt": null,
  "createdAt": "2025-02-17T14:34:23Z",
  "updatedAt": "2025-02-17T14:34:52Z",
  "deletedAt": null
}
```

***

### 🔄 Updating a Charge Point Sensor

To update an existing charge point sensor, send a **`PATCH`** request to:

```http request
PATCH /api/v1/charge-point-sensors/{sensor_id}
```

#### 📥 **Request Body (JSON):**

```json
{
    "value": "false",
    "valueUpdatedAt": "2025-09-14T20:23:45Z"
}
```

#### 📤 **Response (200 OK):**

```json
{
  "id": 166,
  "type": "occupancy",
  "operatorId": 1,
  "chargePointId": 1,
  "externalId": "externalid-1234",
  "partnerExternalId": "yourinternalid-1234",
  "value": "false",
  "valueUpdatedAt": "2025-09-14T20:23:45Z",
  "createdAt": "2025-02-17T14:34:23Z",
  "updatedAt": "2025-02-17T14:34:52Z",
  "deletedAt": null
}
```

***

### 🗑️ Deleting a Charge Point Sensor

To remove a charge point sensor, send a **`DELETE`** request to:

```http request
DELETE /api/v1/charge-point-sensors/{sensor_id}
```

#### 📤 **Response (204 No Content):**

✅ No response body, indicating successful deletion.
