SweetConnect LogoSweetConnect
ApiAsset documents

Update document-asset assignments

Replaces all asset assignments for a document. Assets in the list will be assigned; assets not in the list will be unassigned. Empty array = no-op.

Access restricted to roles:

  • admin
  • manufacturer-admin
  • manufacturer-user
  • producer-admin
  • producer-user
PATCH
/v1/documents/assets/{fileId}
AuthorizationBearer <token>

In: header

Path Parameters

fileId*string

The unique identifier of the file

Request Body

application/json

assetIds*array<>

The new state of asset assignments for this document. Passing this list replaces all current assignments. Assets not in this list will be unassigned; assets in this list will be assigned.If the array is empty nothing will happend

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://test.sweetconnect.io/api/storage/v1/documents/assets/string" \  -H "Content-Type: application/json" \  -d '{    "assetIds": [      "550e8400-e29b-41d4-a716-446655440000",      "6ba7b810-9dad-11d1-80b4-00c04fd430c8"    ]  }'
{
  "data": {
    "assigned": 0,
    "unassigned": 0
  }
}
{
  "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": "NotFound",
      "message": "The requested resource was not found.",
      "extension": {}
    }
  ]
}
{
  "errors": [
    {
      "errorCode": "UnprocessableEntity",
      "message": "Operation not allowed for this entity type.",
      "extension": {
        "entityType": "Document"
      }
    }
  ]
}
{
  "errors": [
    {
      "errorCode": "InternalServerError",
      "message": "An unexpected internal server error occurred.",
      "extension": {}
    }
  ]
}