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

const client = new SGPClient({
  apiKey: 'My API Key',
});

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

console.log(file.id);
{
  "id": "<string>",
  "object": "file",
  "size": 123,
  "md5_checksum": "<string>",
  "filename": "<string>",
  "mime_type": "<string>",
  "tags": {},
  "created_at": "2023-11-07T05:31:56Z",
  "created_by": {
    "id": "<string>",
    "object": "identity",
    "type": "user"
  }
}

Authorizations

x-api-key
string
header
required

Headers

x-selected-account-id
string

Body

multipart/form-data

Response

200
application/json

Successful Response

The response is of type object.