Skip to content
SibiSibi Developers
Esc
↑↓navigate↵open⌘Jpreview
On this page

Attach Site Visit Photos

Upload photos of the property and attach them to a project phase site visit

Photos taken before anyone from Sibi’s network visits the property — typically by whoever assessed the job on site — belong on the phase’s site visit, where the assigned pro and Sibi staff can review them against the job. In many cases they are detailed enough that the pro does not need a visit of their own.

They are attached to the project phase, not delivered as a message: the pro reads them on the job in Sibi, and they are not included in the assignment notification the pro receives when they are dispatched. If a pro needs the photos in hand before they respond to the assignment, attach them before the project names a laborOrganizationId — see Create Project.

Attaching a photo is a three-step flow, repeated per file:

  1. Call POST /phases/{projectPhaseId}/site-visit-images with the file’s contentType. It returns an imageKey and a short-lived, pre-signed url plus a set of fields.
  2. Upload the file with a multipart/form-data POST to url, sending the returned fields (verbatim) followed by the file part. Do not send your bearer token on this request — the policy is already signed.
  3. Call PUT /phases/{projectPhaseId}/site-visit-images with the imageKeys you collected. You can batch every key from step 2 into a single call.

Each file must be no larger than 15 MiB — the signed policy enforces this server-side, so you don’t declare a size. Up to 50 keys per attach call.

Endpoints:

  • POST https://api.sibipro.com/projects/v1/phases/{projectPhaseId}/site-visit-images — request an upload URL
  • PUT https://api.sibipro.com/projects/v1/phases/{projectPhaseId}/site-visit-images — attach uploaded photos

Authentication: Bearer token with the write:phase-images scope (Authorization: Bearer {accessToken})

Path parameters

projectPhaseId

string — Required. ID of the project phase the photos belong to (returned from Create Project or project webhooks).

Step 1 — request an upload URL

Request body

{
  "contentType": "image/jpeg"
}

contentType

"image/jpeg" | "image/png" | "image/heic" | "image/webp" | "application/pdf" — Required. MIME type of the file you intend to upload. The multipart POST must send a matching Content-Type field (it’s included in the returned fields).

Response 200

{
  "imageKey": "site-visit/phase_xyz/V1StGXR8_Z5jdHi6B-myT.jpg",
  "url": "https://...",
  "fields": {
    "key": "site-visit/phase_xyz/V1StGXR8_Z5jdHi6B-myT.jpg",
    "Content-Type": "image/jpeg",
    "bucket": "...",
    "X-Amz-Algorithm": "AWS4-HMAC-SHA256",
    "X-Amz-Credential": "...",
    "X-Amz-Date": "...",
    "Policy": "...",
    "X-Amz-Signature": "..."
  }
}

imageKey

string — Opaque key for the upload. Pass this in imageKeys at step 3. A key is tied to the phase it was minted for and cannot be attached to any other phase, or to a comment.

url

string — Pre-signed URL to POST the upload to as multipart/form-data, within one hour. The upload is unauthenticated — the signature travels in fields.

fields

object — Form fields carrying the signed upload policy. Include every field, verbatim, in the multipart body before the file part. The policy caps the upload at 15 MiB and pins the content type; tampering with any field rejects the upload.

Step 2 — upload the file

curl -X POST "{url}" \
  -F key="{fields.key}" \
  -F Content-Type="{fields.Content-Type}" \
  -F bucket="{fields.bucket}" \
  -F X-Amz-Algorithm="{fields.X-Amz-Algorithm}" \
  -F X-Amz-Credential="{fields.X-Amz-Credential}" \
  -F X-Amz-Date="{fields.X-Amz-Date}" \
  -F Policy="{fields.Policy}" \
  -F X-Amz-Signature="{fields.X-Amz-Signature}" \
  -F file=@front-of-house.jpg

Send the fields exactly as returned, then the file part last. A successful upload returns 204 with an empty body. Only attach an imageKey after its upload has succeeded — the attach call verifies that every key references a real upload and rejects the whole request if one does not.

Step 3 — attach the photos

Request body

{
  "imageKeys": [
    "site-visit/phase_xyz/V1StGXR8_Z5jdHi6B-myT.jpg",
    "site-visit/phase_xyz/8mK2pQr4Ls9vXbN3-tYw.jpg"
  ]
}

imageKeys

string[] — Required. Between 1 and 50 keys from step 1, each already uploaded. Every key must have been minted for this projectPhaseId.

Response 200

{
  "projectPhaseId": "phase_xyz",
  "imageKeys": [
    "site-visit/phase_xyz/V1StGXR8_Z5jdHi6B-myT.jpg",
    "site-visit/phase_xyz/8mK2pQr4Ls9vXbN3-tYw.jpg"
  ],
  "images": ["https://...", "https://..."]
}

imageKeys

string[] — Every site-visit photo on the phase after the attach, not only the keys you sent. Attaching appends: keys already present are not duplicated, and nothing is removed.

images

string[] — Pre-signed download URLs, in the same order as imageKeys, each valid for 1 hour. They are re-signed on every response, so store imageKeys, not these URLs.

Attaching is safe to retry — sending a key that is already on the site visit changes nothing.

Error responses

HTTP code When
400 VALIDATION_ERROR Missing or unsupported contentType; empty imageKeys; more than 50 keys
400 BAD_INPUT A key was minted for a different phase or a different purpose, or was never uploaded
401 UNAUTHORIZED Missing or invalid bearer token
403 INSUFFICIENT_SCOPE The token does not carry write:phase-images
403 FORBIDDEN Caller lacks permission to add site-visit photos to this project phase, including a projectPhaseId that does not exist. The upload-URL request also returns this for a cancelled phase
404 NOT_FOUND The phase has been cancelled (attach only)
500 INTERNAL_ERROR Unexpected server error
503 AUTH_UNAVAILABLE The authentication service is temporarily unavailable. Retry shortly

Was this page helpful?