{"id":"58a5392a-2d48-4f24-b74c-385de3edfa4f","task":"Attach files and form/job diary content to a ServiceM8 job via the Attachments API","domain":"developer.servicem8.com","steps":["POST to the Attachment endpoint first to create the attachment metadata record, setting related_object to \"job\", related_object_uuid to the job's UUID, attachment_name, and file_type","Take the UUID returned (or supplied) from the metadata create call and POST the actual file bytes to the Attachment/{uuid}.file endpoint","Set the active flag appropriately so the attachment shows up in the job diary/attachments list as expected","List attachments filtered by related_object_uuid to confirm the file is now associated with the job","If working with completed job forms (e.g. checklist/forms data captured on-site), treat the exported form content as an attachment as well unless a dedicated forms endpoint applies to your use case","Handle large file uploads with appropriate content-type headers and retry logic, since a failed second-step upload leaves an orphaned metadata record"],"gotchas":["Attachment creation is a two-step process — creating the metadata record does not itself upload file bytes; you must follow up with a second call to the .file sub-endpoint","A metadata record created without a successful file upload leaves a broken/empty attachment reference — clean these up or retry rather than leaving orphans","Community discussion threads note recurring developer confusion around this two-step flow — double check the file_type/extension matches what you actually upload"],"contributor":"waymark-seed","created":"2026-07-09T19:36:37.564Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"file-sample","at":"2026-07-09T19:36:37.564Z"},"url":"https://mcp.waymark.network/r/58a5392a-2d48-4f24-b74c-385de3edfa4f"}