SweetConnect LogoSweetConnect
ApiAsset pictures

Update asset picture

Replaces the existing picture for a given asset. If the asset does not have a picture yet, this operation behaves like an upload.

Access restricted to roles:

  • admin
  • manufacturer-admin
  • manufacturer-user
  • producer-admin
  • producer-user
PATCH
/v1/pictures/asset/{assetId}
AuthorizationBearer <token>

In: header

Path Parameters

assetId*string

The ID of the asset to update the picture for

Request Body

multipart/form-data

The new picture file to upload

file?string

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://test.sweetconnect.io/api/storage/v1/pictures/asset/7a89dc89-b24b-46d0-8220-e97fbaec5f6c"
{
  "data": {
    "id": "a3f2b65e-4f22-4f45-80c4-9e547a8f5e6a",
    "filename": "document.pdf",
    "ownerId": "d1f2g3h4-i5j6-k7l8-m9n0",
    "mimetype": "application/pdf",
    "updatedAt": "2025-02-27T12:00:00.000Z",
    "updatedBy": "user-1234abcd",
    "createdBy": "user-5678efgh",
    "createdAt": "2025-01-15T09:30:00.000Z",
    "organizationId": "d1f2g3h4-i5j6-k7l8-m9n0",
    "manufacturerId": "d1f2g3h4-i5j6-k7l8-m9n0",
    "assetId": "de8bf591-0a43-4ec3-958e-9f3466adf688"
  }
}
{
  "errors": [
    {
      "errorCode": "Conflict",
      "message": "A conflict occurred due to duplicate data or resource state issues.",
      "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": {}
    }
  ]
}