Compliance exports

Build a compliance export

Changed on

Queues the build of one zip (COMPLIANCE_EXPORT.md §2): manifest.json at the root and one folder per property holding mob_register.csv, husbandry.csv, paddock_register.csv, field_work.csv, tasks.csv, weather.csv (each only when it has rows) and photos/<record_id>_<n>.<ext> as original files. UTF-8 with BOM, CRLF, RFC 4180; ISO dates in Australia/Melbourne; an empty cell for anything the record does not hold; enumerations as API values; ; between multiple values; rows ordered property, asset name, date, product position. Derived dates are copied from the records' own derived fields; wool_safe_on is the one computed column and the manifest says so.

Answers at once with the export (status: queued); poll GET /compliance-exports/{id} for progress and status, then download file_url. A build that takes longer than 20 seconds also emails the requester a link when it is done. The zip is kept 30 days (expires_at); the row stays as the log of who exported what, when, with the manifest's SHA-256.

Read-only: nothing is written but the export row. One owner, the same rule as the preview (organization_id, blank for the caller's own account). A property id that owner does not own is a 422 and nothing is created. A property of that owner the caller cannot read is excluded and reported with its 403 detail; when every such property is refused the answer is a 403 carrying each detail and nothing is created. First-party web and mobile only.

post/compliance-exports

Request

  • Base URL: https://api.purplegrain.com/api/v1
  • URL: https://api.purplegrain.com/api/v1/compliance-exports
  • Auth: HTTP bearer

Request body

organization_idstring nullable

The organisation this export is for. Blank (omitted or null) is the caller's own account. The server stores it on the export. properties: all, and a missing properties, is every property of that one owner — never every organisation the caller belongs to, and never the personal account beside an organisation. An id that owner does not own is rejected.

fromstring date

First record date (the Melbourne day the work was done). Defaults to twelve months before to.

tostring date

Last record date. Defaults to today in Melbourne.

record_typesstring[]

Which kinds to export. Defaults to every kind. general is a completed task with no typed detail.

include_openboolean

Also export open tasks that already carry drafted details, each row marked status = open; the zip name ends -incl-open.

Response

Queued.

Example response

{
  "export": {
    "zip_name": "purplegrain-compliance-2026-10-20T0915-hillcrest.zip",
    "file_url": "/api/v1/compliance-exports/7f3c…/file?sig=eyJfcmFpbHMiOn…--4b1d…"
  }
}

Changes

    • warning

      added the new map_boundaries enum value to the /// response property for the response status (media type: application/json)

    • warning

      added the new map_boundaries enum value to the /// response property for the response status (media type: application/vnd.api+json)

    • warning

      added the new map_boundaries enum value to the /// response property for the response status (media type: application/json)

    • warning

      added the new map_boundaries enum value to the /// response property for the response status (media type: application/vnd.api+json)

    • warning

      added the new map_boundaries enum value to the // response property for the response status (media type: application/json)

    • warning

      added the new map_boundaries enum value to the // response property for the response status (media type: application/vnd.api+json)

    • warning

      added the new map_boundaries enum value to the // response property for the response status (media type: application/json)

    • warning

      added the new map_boundaries enum value to the // response property for the response status (media type: application/vnd.api+json)

    • warning

      added the new map_boundaries enum value to the //// response property for the response status (media type: application/json)

    • warning

      added the new map_boundaries enum value to the //// response property for the response status (media type: application/vnd.api+json)

    • warning

      added the new map_boundaries enum value to the //// response property for the response status (media type: application/json)

    • warning

      added the new map_boundaries enum value to the //// response property for the response status (media type: application/vnd.api+json)

    • warning

      added the new map_boundaries enum value to the /// response property for the response status (media type: application/json)

    • warning

      added the new map_boundaries enum value to the /// response property for the response status (media type: application/vnd.api+json)

    • warning

      added the new map_boundaries enum value to the /// response property for the response status (media type: application/json)

    • warning

      added the new map_boundaries enum value to the /// response property for the response status (media type: application/vnd.api+json)

    • warning

      added the new map_boundaries enum value to the /// response property for the response status (media type: application/json)

    • warning

      added the new map_boundaries enum value to the /// response property for the response status (media type: application/vnd.api+json)

    • warning

      added the new map_boundaries enum value to the /// response property for the response status (media type: application/json)

    • warning

      added the new map_boundaries enum value to the /// response property for the response status (media type: application/vnd.api+json)

    • warning

      added the new map_boundaries enum value to the // response property for the response status (media type: application/json)

    • warning

      added the new map_boundaries enum value to the // response property for the response status (media type: application/vnd.api+json)

    • warning

      added the new map_boundaries enum value to the // response property for the response status (media type: application/json)

    • warning

      added the new map_boundaries enum value to the // response property for the response status (media type: application/vnd.api+json)

    • info

      added the optional property to the response with the status (media type: application/json)

    • info

      added the optional property to the response with the status (media type: application/vnd.api+json)

    • info

      added the optional property to the response with the status (media type: application/json)

    • info

      added the optional property to the response with the status (media type: application/vnd.api+json)

    • info

      added the optional property // to the response with the status (media type: application/json)

    • info

      added the optional property // to the response with the status (media type: application/vnd.api+json)

    • info

      added the optional property // to the response with the status (media type: application/json)

    • info

      added the optional property // to the response with the status (media type: application/vnd.api+json)

    • info

      added the optional property to the response with the status (media type: application/json)

    • info

      added the optional property to the response with the status (media type: application/vnd.api+json)

    • info

      added the optional property to the response with the status (media type: application/json)

    • info

      added the optional property to the response with the status (media type: application/vnd.api+json)

    • info

      added the optional property to the response with the status (media type: application/json)

    • info

      added the optional property to the response with the status (media type: application/vnd.api+json)

    • info

      added the optional property to the response with the status (media type: application/json)

    • info

      added the optional property to the response with the status (media type: application/vnd.api+json)