File

saveFileV2

Saves a permanent file entity. Updates an existing file entity when _id is passed.

Saves metadata to file entity and stores a version when s3ref or source_url is passed.

post/v2/files

Query parameters

strictboolean

When passed true, the response will contain only fields that match the schema, with non-matching fields included in __additional

Request body

OR
OR

Example request

{
  "_id": "ef7d985c-2385-44f4-9c71-ae06a52264f8",
  "relations": [
    {
      "entity_id": "ef7d985c-2385-44f4-9c71-ae06a52264f8",
      "_schema": "contact"
    }
  ],
  "_tags": [
    "tag1",
    "tag2"
  ],
  "_purpose": [
    "8d396871-95a0-4c9d-bb4d-9eda9c35776c",
    "da7cdf9a-01be-40c9-a29c-9a8f9f0de6f8"
  ],
  "filename": "document.pdf",
  "mime_type": "application/pdf",
  "size_bytes": 1234,
  "readable_size": "1.2 MB",
  "public_url": "https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf",
  "custom_download_url": "https://some-api-url.com/download?file_id=123",
  "s3ref": {
    "bucket": "epilot-prod-user-content",
    "key": "123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
  }
}

Response

Created File Entity

_titlestring required
_schema'file' required
_orgstring required
_idstring required
_tagsstring[]
_purposestring[]
filenamestring required
type'document' | 'document_template' | 'text' | 'image' | 'video' | 'audio' | 'spreadsheet' | 'presentation' | 'font' | 'archive' | 'application' | 'unknown' required
mime_typestring

MIME type of the file

size_bytesinteger

File size in bytes

readable_sizestring

Human readable file size

access_control'private' | 'public-read' required
public_urlstring url

Direct URL for file (public only if file access control is public-read)

custom_download_urlstring uri

Custom external download url used for the file

source_urlstring

Source URL for the file. Included if the entity was created from source_url, or when ?source_url=true

_updated_atstring date-time
_created_atstring date-time
__additionalobject nullable

Additional fields that are not part of the schema

Example response

{
  "_title": "document.pdf",
  "_org": "123",
  "_id": "ef7d985c-2385-44f4-9c71-ae06a52264f8",
  "_tags": [
    "tag1",
    "tag2"
  ],
  "_purpose": [
    "8d396871-95a0-4c9d-bb4d-9eda9c35776c",
    "da7cdf9a-01be-40c9-a29c-9a8f9f0de6f8"
  ],
  "filename": "document.pdf",
  "mime_type": "application/pdf",
  "size_bytes": 1234,
  "readable_size": "1.2 MB",
  "public_url": "https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf",
  "custom_download_url": "https://some-api-url.com/download?file_id=123",
  "source_url": "https://productengineer-content.s3.eu-west-1.amazonaws.com/product-engineer-checklist.pdf",
  "s3ref": {
    "bucket": "epilot-prod-user-content",
    "key": "123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
  },
  "versions": [
    {
      "s3ref": {
        "bucket": "epilot-prod-user-content",
        "key": "123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
      },
      "filename": "document.pdf",
      "size_bytes": 1234,
      "readable_size": "1.2 MB",
      "mime_type": "image/jpeg"
    }
  ],
  "_acl": {
    "view": [
      "org:456"
    ],
    "edit": [
      "org:456"
    ],
    "delete": [
      "org:456"
    ]
  },
  "_owners": [
    {
      "org_id": "123",
      "user_id": "123"
    }
  ]
}

Changes