SweetConnect LogoSweetConnect
ApiUser pictures

Update user profile picture

Replaces the authenticated user's profile picture with a new image. If a picture already exists, it will be overwritten. Accepts files up to 2MB. Allowed formats: image/jpeg, image/png.

Access restricted to roles:

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

In: header

Path Parameters

userId*string

The unique identifier of the user you want to modify

Request Body

multipart/form-data

The image 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/profile/user/123e4567-e89b-12d3-a456-426614174000"
{
  "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"
  }
}
{
  "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": {}
    }
  ]
}