Tarsheed
  1. Device
Tarsheed
  • Auth
    • Create Account
      POST
    • Verifiy Email
      POST
    • Login
      POST
    • Resend Verfication Code
      POST
    • Forget Password Request
      POST
    • Forget password Verify Code
      POST
    • Reset Password
      PATCH
    • Login With Google
      POST
    • Login With Facebook
      POST
  • Users
    • Get all users
      GET
    • Get specific user
      GET
    • Delete user account
      DELETE
    • Update user data
      PUT
    • Change user password
      PUT
    • Get Recomendation
      GET
    • Get Avarage Cost For Spesfic User
      GET
    • Get The Power Saving Modes Settings
      GET
    • Update the Usage of the power saving mode
      PATCH
  • Reports
    • GetUserReport
      GET
  • Room
    • Create New Room
      POST
    • Update Room
      PATCH
    • Delete Room
      DELETE
    • Get Room Details
      GET
    • Get all Rooms for spesfic user
      GET
  • Device
    • Create New Device
      POST
    • Update Device
      PATCH
    • Delete Device
      DELETE
    • Get All Devices id For IOT System
      GET
    • Toggle Device Status
      PATCH
  • category
    • get all categories
  • Sensor
    • Create New Sensor
    • Update Sensor
    • Delete Sensor
    • Get All Sensor For Spesfic user
  • Automation
    • Add New Automation
    • Get all Automation for Spesfic User
    • Delete Spesfic Automation
    • Update Spesfic Automation
    • Apply Automation Manually
  1. Device

Create New Device

Developing
POST
device/create
DeviceUser
Cretae new Device for spesfic user in spesfic room

Request

Header Params
Authorization
string 
required
Example:
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3OWU4M2Y0OGUxMThjNDA3OWIyNTFjMyIsImVtYWlsIjoiYWxpaXNtYWlsaDA4QGdtYWlsLmNvbSIsInJvbGUiOiJjdXN0b21lciIsImlhdCI6MTc0MTI0MjUwMiwiZXhwIjoxNzQzODM0NTAyfQ.ABNTRtJ6iJn1AJpPKcUrr1SOW2aYXRjRkn0Vv1YURoI
Body Params application/json
name
string 
required
device name
description
string 
optional
Device description and it optional
pinNumber
string 
required
pin number for device in IOT System
roomId
string 
required
room id that user need to create this device in
categoryId
string 
required
category for device it is id that you select it from the categories
sensorId
string 
required
priority
number 
required
user must select number from three 1 or 2 or 3
Example
{
    "name": "string",
    "description": "string",
    "pinNumber": "string",
    "roomId": "string",
    "categoryId": "string",
    "sensorId": "string",
    "priority": 0
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'device/create' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3OWU4M2Y0OGUxMThjNDA3OWIyNTFjMyIsImVtYWlsIjoiYWxpaXNtYWlsaDA4QGdtYWlsLmNvbSIsInJvbGUiOiJjdXN0b21lciIsImlhdCI6MTc0MTI0MjUwMiwiZXhwIjoxNzQzODM0NTAyfQ.ABNTRtJ6iJn1AJpPKcUrr1SOW2aYXRjRkn0Vv1YURoI' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "string",
    "description": "string",
    "pinNumber": "string",
    "roomId": "string",
    "categoryId": "string",
    "sensorId": "string",
    "priority": 0
}'

Responses

🟢200Success
application/json
Body
object {0}
Example
{
    "message": "Device Created Successfully",
    "deviceSaved": {
        "name": "TV",
        "description": "main TV in the house",
        "categoryId": "67cd8ab3eff1c5c8a7793c51",
        "status": "OFF",
        "pinNumber": 2,
        "roomId": "67d7ade73adb097a01018dd0",
        "_id": "67d8ef36ae78368e1f172220",
        "createdAt": "2025-03-18T03:57:42.384Z",
        "updatedAt": "2025-03-18T03:57:42.384Z",
        "__v": 0
    }
}
Previous
Get all Rooms for spesfic user
Next
Update Device
Built with