POST
/
v4
/
beta
/
files
import SGPClient from 'sgp';

const client = new SGPClient({
  apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const file = await client.beta.files.create({ file: fs.createReadStream('path/to/file') });

  console.log(file.id);
}

main();
{
  "size": 123,
  "md5_checksum": "<string>",
  "filename": "<string>",
  "mime_type": "<string>",
  "tags": {},
  "id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "created_by_user_id": "<string>",
  "object": "file"
}

Authorizations

x-api-key
string
header
required

Body

multipart/form-data
file
file
required

Response

200
application/json
Successful Response
size
integer
required
md5_checksum
string
required
filename
string
required
mime_type
string
required
id
string
required
created_at
string
required
created_by_user_id
string
required
tags
object
object
enum<string>
default:
file
Available options:
file