Skip to main content
POST
/
files
/
upload
Upload File
curl --request POST \
  --url https://api.g2cplatform.com/v2/files/upload \
  --header 'Content-Type: multipart/form-data' \
  --header 'X-API-Key: <api-key>' \
  --form file='@example-file' \
  --form 'metadata=<string>'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "filename": "<string>",
  "size": 123,
  "mimeType": "<string>",
  "url": "<string>",
  "createdAt": "2023-11-07T05:31:56Z"
}

Authorizations

X-API-Key
string
header
required

API key for authenticating requests. Include in X-API-Key header.

Body

multipart/form-data
file
file
required

The file to upload

metadata
string

Optional JSON string with metadata about the file

Response

File uploaded successfully

id
string<uuid>

Unique identifier for the uploaded file

filename
string

Name of the uploaded file

size
integer

Size of the file in bytes

mimeType
string

MIME type of the file

url
string<uri>

URL to access the file

createdAt
string<date-time>

Timestamp when the file was uploaded