remagicaDocs home
API referenceLibrary

Share a file

PUT
/asset-shares

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.

Authorization

apiKey
headerx-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.

Request Body

application/json
  1. body
contentType?string
Lengthlength <= 200
kind*string
Value in"image""video""audio"
mediaKey*string

The 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.

Length1 <= length <= 1024
model?string
Lengthlength <= 200
prompt?string
Lengthlength <= 20000
role*string

restricted (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?boolean
Defaulttrue
title?string
Lengthlength <= 200
Default""

Response Body

The share.

application/json
  1. response
path*string
role*string

restricted (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*boolean
token*string
Example Request
curl -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"}