SweetConnect LogoSweetConnect
ApiAsset

Create asset

Creates an asset (Location, Production Line, Process Cell, Machine, or Component)

Access restricted to roles:

  • admin
  • manufacturer-admin
  • manufacturer-user
  • producer-admin
POST
/v1/assets

Request Body

application/json

assetType*string

Type of the asset

Default"location"
name*string

Name of the location

description?string

Detailed description of the location

imageUrl?string

URL to an image representing the location

address*

Address details of the location

customAttributes?

Custom attributes for the location

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://my.sweetconnect.io/api/asset/v1/assets" \  -H "Content-Type: application/json" \  -d '{    "assetType": "location",    "name": "Hall 1",    "address": {      "city": "Somecity",      "country": "Somecountry"    }  }'
{
  "data": {
    "assetType": "location",
    "id": "0c1b9613-7d6f-40b7-bf29-3179ac401fc9",
    "name": "Sample Asset",
    "organizationId": "0c1b9613-7d6f-40b7-bf29-3179ac401fc9",
    "description": "This is a sample asset for demonstration purposes",
    "imageUrl": "https://example.com/asset.jpg",
    "createdAt": "2025-07-22T14:48:00.000Z",
    "updatedAt": "2025-07-22T15:10:00.000Z",
    "createdBy": "0c1b9613-7d6f-40b7-bf29-3179ac401fc9",
    "updatedBy": "0c1b9613-7d6f-40b7-bf29-3179ac401fc9",
    "active": true,
    "draft": false,
    "custom": false,
    "parentId": "0c1b9613-7d6f-40b7-bf29-3179ac401fc9",
    "position": 1,
    "customAttributes": [
      {
        "key": "color",
        "value": "blue"
      }
    ],
    "address": {
      "city": "Somecity",
      "country": "Somecountry",
      "address1": "Somestreet 101",
      "address2": "Some additional info",
      "postalcode": "01234",
      "state": "SomeState"
    }
  }
}
{
  "errors": [
    {
      "errorCode": "BadRequest",
      "message": "The request payload is invalid.",
      "extension": {}
    }
  ]
}
{
  "errors": [
    {
      "errorCode": "Unauthorized",
      "message": "Authentication is required to access this resource.",
      "extension": {}
    }
  ]
}
{
  "errors": [
    {
      "errorCode": "NoPermission",
      "message": "You do not have permission to access this resource.",
      "extension": {}
    }
  ]
}
{
  "errors": [
    {
      "errorCode": "InternalServerError",
      "message": "An unexpected internal server error occurred.",
      "extension": {}
    }
  ]
}