Skip to content

Get file metadata

GET/v5/files/{file_id}

Retrieve a single file’s metadata by id.

Returns the file record (id, filename, MIME type, size, tags, and related fields) but not the file’s bytes; use the content endpoint to download the bytes.

Path ParametersExpand Collapse
file_id: string
Header ParametersExpand Collapse
"x-project-id": optional string
ReturnsExpand Collapse
SGPFile object { id, created_at, created_by, 7 more }
id: string

The unique identifier of the entity.

created_at: string

The date and time when the entity was created in ISO format.

formatdate-time
created_by: Identity { id, type, object }

The identity that created the entity.

id: string
type: "user" or "service_account"
One of the following:
"user"
"service_account"
object: optional "identity"
filename: string
md5_checksum: string
mime_type: string
size: number
duration_seconds: optional number
object: optional "file"
tags: optional map[unknown]

Get file metadata

curl https://api.egp.scale.com/v5/files/$FILE_ID \
    -H "x-api-key: $SGP_API_KEY"
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": {
    "id": "id",
    "type": "user",
    "object": "identity"
  },
  "filename": "filename",
  "md5_checksum": "md5_checksum",
  "mime_type": "mime_type",
  "size": 0,
  "duration_seconds": 0,
  "object": "file",
  "tags": {
    "foo": "bar"
  }
}
Returns Examples
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": {
    "id": "id",
    "type": "user",
    "object": "identity"
  },
  "filename": "filename",
  "md5_checksum": "md5_checksum",
  "mime_type": "mime_type",
  "size": 0,
  "duration_seconds": 0,
  "object": "file",
  "tags": {
    "foo": "bar"
  }
}