Upload Photo

Upload a photo file to associate with a record using multipart/form-data with photo[access_key] and photo[file]. Let your HTTP client set the multipart Content-Type header and boundary. Supported formats are JPEG, PNG, GIF, TIFF, WebP, HEIC, and HEIF. The server detects the type from the actual file bytes rather than the filename, extension, or declared MIME type, and stores the detected content type. Unsupported content is rejected with a file validation error. A verified image with a valid new access key can create a photo. Uploading to an existing photo's access key requires update permission for that photo; an access key alone is not authorization. Both successful creation and authorized updates return 201 with photo metadata. Image processing occurs asynchronously.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Uploading or updating a photo

Send a multipart/form-data request with photo[access_key], a UUID identifying the photo. A valid new access key creates a photo and requires photo[file]. Updating an existing photo requires update permission for that photo; knowing its access key alone does not grant permission.

For an authorized update, include photo[file] to replace the image, or omit it to retain the existing file. An existing photo without a file, such as a placeholder, still requires a file.

jQuery Web Form Example

<form>
  <input type="file" name="photo" id="photo" /><br /><br />
  <input type="button" id="upload" value="upload" />
</form>
$(document).ready(function(){
  /**
  * Generates a GUID string.
  * @returns {String} The generated GUID.
  * @example af8a8416-6e18-a307-bd9c-f2c947bbb3aa
  * @author Slavik Meltser ([email protected]).
  * @link http://slavik.meltser.info/?p=142
  **/
  function guid() {
    function _p8(s) {
      var p = (Math.random().toString(16)+"000000000").substr(2,8);
      return s ? "-" + p.substr(0,4) + "-" + p.substr(4,4) : p ;
    }
    return _p8() + _p8(true) + _p8(true) + _p8();
  }

  $("#upload").click(function(){
    var formData = new FormData();
    formData.append("photo[access_key]", guid());
    formData.append("photo[file]", $("#photo")[0].files[0]);
    $.ajax({
      type: "POST",
      url: "https://api.fulcrumapp.com/api/v2/photos.json",
      data: formData,
      cache: false,
      contentType: false,
      processData: false,
      dataType: "json",
      headers: {
        "X-ApiToken": "my-api-key"
      },
      success: function (data) {
        // do something!
        console.log(data);
      }
    });
  });
});
Body Params
uuid
required

A client-generated UUID identifying the photo. A valid new access key creates a photo. Reusing an existing photo's access key requires update permission for that photo; knowing its access key alone does not grant permission.

file

The image file bytes. Required when creating a new photo; an existing photo can retain its current file if this field is omitted. Supported formats are JPEG, PNG, GIF, TIFF, WebP, HEIC, and HEIF. The server detects the image type from the actual bytes, not the filename, extension, or declared multipart MIME type, and stores the detected content type. Non-image or unsupported content is rejected even if declared as an image.

Responses

Language
Credentials
Header
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json