Writing is currently supported for the
employee, time_report, salary_transaction,
competence, employee_competence and file_transfer domains.- To write data, the role being used must have the
createand/orupdatepermissions for the domain you are writing to. - Following RESTful conventions,
POSTcreates new resources,PUTupdates existing resources, andPATCHpartially updates existing resources. - Although
PATCHdoes not touch unspecified dated properties, it still replaces all entries of the targeted dated properties with the values provided in the request body. To keep existing historical values for a given dated property, include them in the request body. This behavior may change in the future given enough demand. - If there are incoming domain mappings for the domain you are writing to, avoid updating any properties that are mapped in those integrations. Otherwise it becomes ambiguous which integration is responsible for the data.
- If there is a configured
twineintegration with outgoing domain mappings for that domain, a replication job is created by default to push the changes to the configured integration.- For
employee, suppress replication by adding a condition in the target integration. - For
time_report, control replication per request throughjob_optionson create and update (or the equivalent query parameters on delete) — for example, setqueue_jobtofalseto skip it, or scope it withdomain_mapping_id,schedule_in, anddate_range. See the Time Report endpoints for details.
- For
Uploading files
Files are written differently from the other domains, because the thing being written is not a record but a document.- Send the file base64 encoded in
content_base64. The decoded file may be at most 5 MB. - Name the destination with
system_integration_id. The file travels through a file transfer domain mapping that has Twine on the source side, so one must exist for that destination. - Delivery is asynchronous. The response returns immediately with
statuspending; poll the file transfer until it becomesdelivered, then readremote_idfor the destination system’s identifier for the document. - Unlike the other write endpoints,
schedule_indefaults to0rather than60, since callers are normally waiting on that identifier. - Twine does not retain the file. The record of the transfer and the destination’s identifier are kept indefinitely; the file itself is removed shortly after delivery.