API referenceLibrary
Share a file
PUT
Needs a key withlibrary:share
Turns a file's share link on (view or comment) or off (restricted), and sets what its public page shows. The link (/a/<token>) stays the same each time it's turned on.
Requires scope library:share.
apiKeyheader
x-api-key<token>An API key of your workspace (rmg_…), created in the web app. It acts for that workspace, not for a person, and keeps working when its creator leaves.
application/json- body
contentType?stringLength
length <= 200kind*stringValue in
"image""video""audio"mediaKey*stringThe file's storage key (an upload's, a generation's or a workflow output's). A node's result and the asset filed from it share one thread.
Length
1 <= length <= 1024model?stringLength
length <= 200prompt?stringLength
length <= 20000role*stringrestricted (the link is off), view (anyone with it sees the file) or comment (and, signed in, comments on it).
Value in
"restricted""view""comment"showPrompt?booleanDefault
truetitle?stringLength
length <= 200Default
""The share.
application/json- response
path*stringrole*stringrestricted (the link is off), view (anyone with it sees the file) or comment (and, signed in, comments on it).
Value in
"restricted""view""comment"showPrompt*booleantoken*stringcurl -X PUT 'https://api.remagica.com/api/v1/asset-shares' \ -H 'Content-Type: application/json' \ -d '{ "kind": "image", "mediaKey": "generations/org_1/2c9a7f10/image-0.png", "role": "restricted"}'Example Response
{ "path": "string", "role": "restricted", "showPrompt": true, "token": "string"}