I see an older thread on the forum about potential improvements to the API to allow file uploads, but I'm not sure that ever happened. Has anyone ever uploaded files in CiviCRM using the API?

I see in the API Explorer that there is a File > Create with a parameter for File Contents but I'm not sure if you feed in the MIME contents, a URL, or...?

File via API

  • fantastic, that is good to know. does anyone know if we can provide an externalized attachment storage, example s3 buckets or firebase storage ? That is easier to scale than having it on the server running civi. Apr 6, 2019 at 14:32
  • I think that warrants a question of its own. Also I don't know the answer. :) Jun 11, 2019 at 19:50

1 Answer 1


Yes, it did happen and it's called the "attachment" api. You can look up the docs for it in the api explorer:

enter image description here

  • Thanks! And I confess my ignorance - does webform-civicrm use this so file uploads don't rely on the form submission not being deleted anymore? May 30, 2016 at 14:47
  • 2
    It does for almost everything. The one exception is the "contact image_url" because Civi does not store an actual file in that field, just the url. So that currently is still only stored in the webform submission.
    – Coleman
    May 31, 2016 at 3:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.