Skip to main content

Drafts

Drafts in Orgvue contain a list of modelled changes that represent your future organization

These changes are nodes, representing positions or people, that have been added, updated or removed from the base dataset

The following operations are possible via the Orgvue API

Export Draftโ€‹

Exporting a draft will produce a list of changes as item actions

See the Draft API Documentation for details

The item actions will be exported to an S3 location and the URL will be provided within the response message

If you have your own S3 location then this object may be defined within the request body and the export will be diverted to it instead

{
"layers": [
{
"draftId": "36A1E02D-DC20-61C5-A11F-DD85440C652C",
"layerKey": "default"
}
}

This list of actions could then be imported to a Dataset to apply the changes or imported back to the source HRIS system to make the changes there and allow re-syncing of the Dataset with the source HRIS

Apply Draft to Datasetโ€‹

Applying a Draft to a Dataset will update the dataset with all the item actions contained within the Draft layer

Importing the Draft does not clear the changes from the Draft, therefore a single Draft may be applied to multiple Datasets if required

You can apply a Draft by first exporting the changes to the result location PUT URL and then using the PUT https://{baseUrl}/api/v1/{tenantId}/datasets/{datasetId}/items/import to import the changes to a Dataset

The format for the import JSON payload is

{
"importLocation": {
"method": "GET",
"url": "https://example.com"
},
"resultLocation": {
"method": "PUT",
"url": "https://example.com"
},
"callback": {
"method": "GET",
"urlTemplate": "https://example.com?status={{jobStatus}}&traceId={{traceId}}&tenantId={{tenantId}}"
}
}

Clear Entire Draftโ€‹

The actions of Exporting or Applying a Draft does not clear or delete the Draft layer

This allows a single draft to be applied to several Datasets if required

Clearing the Draft will clear all the changes within it but will not delete the Draft, leaving it available for further changes to be saved to it

To clear the contents of a Draft use POST: https://{baseUrl}/api/v1/{tenantId}/drafts/clear

The format for the Clear Draft JSON payload is

{
"layers": [
{
"draftId": "36A1E02D-DC20-61C5-A11F-DD85440C652C",
"layerKey": "default"
}
]
}

Clear Specific Edits From a Draftโ€‹

Including a MongoDB Filter object within the JSON body of the clear draft request will enable specific actions to be cleared from the Draft.

Any actions not matching the filter will remain in the Draft

{
"layers": [
{
"draftId": "331413BF-591C-031E-BAC4-D1C39AA28958",
"layerKey": "default"
}
],
"filter": {
"location": {
"$in": ["UK", "USA"]
},
"approval_status": "Approved"
}
}