SweetConnect LogoSweetConnect
ApiAsset documents

Update document-asset assignments

PATCH
/v1/documents/assets/{fileId}

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
AuthorizationBearer <token>

In: header

Path Parameters

fileId*string

The unique identifier of the file

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/v1/documents/assets/string" \  -H "Content-Type: application/json" \  -d '{    "assetIds": [      "550e8400-e29b-41d4-a716-446655440000",      "6ba7b810-9dad-11d1-80b4-00c04fd430c8"    ]  }'
{  "data": {    "assigned": 3,    "unassigned": 1  }}