For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Files

Create Files

post

Adds files by URL to a deal, contact or company. The files are saved at once with your URL as src and importStatus pending, and copied to PaintScout's storage in the background. Read the record again later to see each file's final src and importStatus. The request fails with a 400 if it has more than 10 files, or if a URL is not https or resolves to a private address.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
docIdstringRequired

The document ID to attach files to

docTypestring · enumRequired

The document type (deal, contact, or company)

Possible values:
Body
Responses
200

Array of created files

application/json
idstringOptional

The unique ID of the File

titlestring · nullableOptional

The title of the File

srcstring · nullableOptional

The URL of the File. For a file added by URL, this is the URL you gave until the background copy finishes (importStatus pending) or fails (failed), and the PaintScout copy once it is stored.

typestring · nullableOptional

The MIME type of the File (e.g. image/jpeg, application/pdf)

formatstring · nullableOptional

The file format/extension (e.g. jpg, pdf, png)

visibilitystring · enum · nullableOptional

The visibility of the File

Possible values:
importStatusstring · enum · nullableOptional

Where the background copy of a file added by URL stands. pending: not finished, src is your URL. stored: src is the PaintScout copy. failed: the file was refused or could not be fetched, src stays your URL and importError says why.

Possible values:
importErrorstring · nullableOptional

Why the background copy failed, as a fixed sentence (for example, the file type is not supported, the file is too large, or the copy could not be started). Set only when importStatus is failed.

post/files
POST /v2/files?docId=text&docType=deal HTTP/1.1
Host: openapi.paintscout.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 95

{
  "files": [
    {
      "url": "https://example.com/photo.jpg",
      "title": "Site Photo",
      "visibility": "visible"
    }
  ]
}
[
  {
    "id": "abcd1234-abcd-1234-abcd-abcd1234abcd",
    "title": "Site Photo",
    "src": "https://example.com/files/photo.jpg",
    "type": "image/jpeg",
    "format": "jpeg",
    "visibility": "visible",
    "importStatus": "pending",
    "timestamp": {
      "created": 1672531200,
      "updated": 1672617600
    }
  }
]

Last updated

Was this helpful?