POST
/
api
/
v4
/
files
/
from-url
Upload file from URL.
curl --request POST \
  --url https://apix.us.amity.co/api/v4/files/from-url \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --data '{
  "fileUrl": "<string>",
  "preferredFilename": "<string>",
  "accessType": "public"
}'
[
  {
    "fileId": "<string>",
    "fileUrl": "<string>",
    "type": "file",
    "accessType": "public",
    "altText": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "attributes": {
      "name": "test.pdf",
      "extension": "pdf",
      "size": 2107842,
      "mimeType": "application/pdf",
      "metadata": {}
    }
  }
]

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Content-Type
string
required

Body

application/json
fileUrl
string
required

A file URL to upload

preferredFilename
string
Maximum length: 1024
accessType
enum<string>
default:public

File access type. network type requires authentication to download.

Available options:
public,
network

Response

File Upload Result

fileId
string

Root file key on cloud storage.

fileUrl
string

url to download the file

type
enum<string>

File type.

Available options:
image,
file,
video
Example:

"file"

accessType
enum<string>
default:public

File access type. network type requires authentication to download.

Available options:
public,
network
altText
string

Alternative text for the file.

createdAt
string<date-time>

The date/time when a file is uploaded.

updatedAt
string<date-time>

The date/time when a file is updated.

attributes
object