Skip to content

API Reference / Deals

POST /deals/{deal_id}/attachments

Create attachment and assign it to an existing deal

Before creating an attachment, the file should be uploaded to S3. Make a request to `attachments/s3_form` for a pre-authorized upload form. Following successful upload to S3, files can be attached via this endpoint.

Maintained by the OnePageCRM engineering team

Path parameters

Name Type Description
deal_id req string Deal ID

Request body

  • reference_idstringbson-id

    ID of the deal associated with the attachment

  • reference_typestringrequired

    Type of resource is associated with the attachment

    enum: deal Β· note Β· call Β· meeting

  • contact_idstringbson-id

    ID of the contact, to whom the note belongs

  • namestring

    Name of the attachment file

  • keystringrequired

    The same key used in the `attachments/s3_form`, composed as `{contact_id}/{timestamp}/{filename}`

  • sizeintegerint32

    Size of the attachment file (in bytes)

  • link_typestring

    Type of external link (for external `storage_provider`s)

    enum: dropbox Β· google_drive Β· evernote

  • external_urlstring

    URL for the file (for use with external `storage_provider`s)

Responses

201 Created
  • statusintegerint32

    Response code

  • messagestring

    Response message

  • timestampintegerunix-timestamp

    Response time

  • dataobject
    object fields β†’
    • attachmentobject

      Additional files associated with Deals, Notes, Calls or Meetings. They can be uploaded and stored in S3, or stored in external providers i.e. Google Drive, Dropbox, Evernote.

      object fields β†’
      • idstringbson-id

        ID of the attachment

      • filenamestringrequired

        Name of the attachment file

      • custom_filenamestring

        Custom name of the attachment file

      • pinnedboolean

        Show if the attachment is pinned to its owner contact

      • pinned_atstring

        Shows pinned at timestamp. Is null if pinned == false

      • sizeintegerint32required

        Size of the attachment file (in bytes)

      • storage_providerstring

        Name of the storage provider (where the attachment file is stored)

        enum: amazon Β· google_drive Β· dropbox Β· evernote

      • urlstring

        External URL of the attachment file

      • url_expires_atstringdate-time

        The time the attachment URL expires

      • thumbnailobject

        An image preview of the attachment file (if one exists)

        object fields β†’
        • urlstring

          External URL of the attachment's thumbnail

Standard error responses: 400 Β· 401 Β· 403 Β· 404 Β· 409 Β· 500 β€” shared across the API. See Errors.

Related guides