DocsAPIFiles

Upload file from URL

Downloads the file at url and attaches it to a company, fund, funding round, investment, valuation or proceed. The URL has to serve the file itself: a link that answers with a web page is rejected, and nothing is stored for it. entity_id is always the id of the record named by entity_type – for companies that means the company_id, not a portfolio_company_id. Uploading a file that is already attached to the same record returns the existing file with a 200 instead of storing a second copy.

POST
/files/upload-from-url
Body

Example: https://example.com/reports/q3-board-deck.pdf

Example: companies

Example: 42

Example: Q3 Board Deck.pdf

Example: ["board material"]

Request Body

application/jsonOptional
urlRequiredstring

Direct link to the file. It must return the file itself – links to a web page or a preview are rejected.

Format: "uri"
entity_typeRequiredstring

Type of record to attach the file to

Value in: "companies" | "funds" | "funding_rounds" | "investments" | "valuations" | "proceeds" | "portfolio_fund_events"
entity_idRequiredstring

ID of the record to attach the file to, of the type given in entity_type. For companies this is the company_id – the company is shared across funds, so a portfolio_company_id is not accepted here and will not be found.

Pattern: "^\\d+$"
namestring

File name to store it under. Defaults to the name the source server gives, or the last segment of the URL.

Minimum length: 1
tagsarray<string>

Tags to attach. Fundra tags the file automatically as well, so this is only needed to force a particular tag.

headersobject

Optional headers object needed to retrieve the file from the URL

Credentials

Bearer
curl -X POST "https://api.fundra.com/v1/files/upload-from-url" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/reports/q3-board-deck.pdf",
    "entity_type": "companies",
    "entity_id": "42",
    "name": "Q3 Board Deck.pdf",
    "tags": [
      "board material"
    ],
    "headers": {
      "property1": "string",
      "property2": "string"
    }
  }'

The same file is already attached to this record; the existing file is returned

{
  "data": {
    "id": "V1StGXR8Z5jd",
    "name": "Q3 Board Deck.pdf",
    "type": "application/pdf",
    "extension": "pdf",
    "size": 102400,
    "hash": "9f86d081884c7d659a2feaa0c55ad015",
    "tags": [
      "board material"
    ],
    "entity_type": "companies",
    "entity_id": "42",
    "resource_uuid": "Ax7Bc9De",
    "parent_resource_type": "companies",
    "parent_resource_uuid": "Ax7Bc9De",
    "created_at": "2024-01-15T10:35:00Z"
  }
}