How to plan resourcing through the API
Use these steps when an integration or a planning tool reads Drum’s resourcing schedule and changes people’s weekly allocations or project dates. Every change is previewed first, then applied as one unit, so you can show the effect before anything is saved.
Before you start
You need:
- An API token for a Drum user whose role has
api_read, andapi_createandapi_updateto save changes (api_deleteto remove an allocation, or to undo a list that added one) - “View global resourcing” to read the whole schedule, or resourcing access to the project you plan
- The resourcing edit right on each project you change
The examples use $DRUM_API_TOKEN for the token. All requests go to https://app.getdrum.com/api/v1/.
1. Read the schedule
Read the weeks you are planning. Narrow it to a team, a role, some people or a project.
curl -H "Authorization: Bearer $DRUM_API_TOKEN" \
"https://app.getdrum.com/api/v1/resource_schedule?start_week=2026-11-02&end_week=2026-11-23&team_ids=4"
For each person you get per-week arrays of capacity_minutes, unavailable_minutes, load_minutes and free_minutes, in the order of weeks. Negative free minutes mean the person is over-allocated that week. Keep the id and plan_revision of each allocation you will change.
People come in pages of up to 50 (limit, offset). Read the next page while has_more is true.
To list only people who are over capacity, add only_over_allocated=true. To see the load without some projects, add exclude_project_ids=55,61.
2. Find the ids for new allocations
A new allocation needs a deliverable or a task, and a person, a role or both:
- Deliverable and task ids:
GET /api/v1/projects/:idlists the project’s deliverables and tasks. - Member ids:
GET /api/v1/members, or themembersof the schedule. - Role ids: the
rolesof each person in the schedule, or the resource types.
3. Preview the changes
Send the whole list to /resourcing_changes/preview. This example moves an allocation two weeks later and adds a new one.
curl -X POST "https://app.getdrum.com/api/v1/resourcing_changes/preview" \
-H "Authorization: Bearer $DRUM_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"changes": [
{"type": "shift", "allocation_id": 901, "expected_plan_revision": 4, "weeks": 2},
{"type": "create", "deliverable_id": 210, "member_id": 14, "start_week": "2026-11-02",
"num_weeks": 4, "total_minutes": 3600, "distribution": "front_loaded"}
]}'
Nothing is saved. Check the response:
okistruewhen every change would succeed. Otherwise each failed row initemshas anerrorwith itscodeandfield. Fix them all and preview again.can_applyisfalsewhen a change failed, or when the token lacks a permission the list needs (missing_capabilities).summaryis one line to show a person, andtotalshas the counts behind it.- Keep
preview_idandpreview_token. The token is given only once.
4. Read the impact
The first answer has only the first page of changes. Read the other collections by preview_id, for example the weeks of each person whose planned time changes:
curl -H "Authorization: Bearer $DRUM_API_TOKEN" \
"https://app.getdrum.com/api/v1/resourcing_changes/previews/$PREVIEW_ID?collection=member_weeks&limit=100"
Each row has the capacity, minutes before and after, free minutes after, and whether the person is over capacity. budgets shows the deliverable and task budgets the list draws on, dates the dates that move, and warnings what a person should know. Read the next page with cursor set to next_cursor, until it is null.
Show the summary, the warnings and the impact to the person who asked for the change before you go on. A stored preview expires after 30 minutes.
5. Apply the changes
Send the same list, with the preview_token and a new idempotency_key, to /resourcing_changes/apply.
curl -X POST "https://app.getdrum.com/api/v1/resourcing_changes/apply" \
-H "Authorization: Bearer $DRUM_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6f1c2a9e-0d4b-4f7e-9a51-3c8e2b7d1f40" \
-d '{"preview_token": "...", "changes": [ ...the same list... ]}'
Every change is saved, or none. On success:
- Store the new
plan_revisionof each allocation fromchanges[]for your next change. - Store
change_set_idif you may need to undo the list.
If the response is lost, send the same request again with the same key. You get the first receipt with "replayed": true, and nothing is saved twice.
6. Handle a refusal
An apply that fails answers the error of the first failed change, with change_index. Nothing was saved.
code |
What to do |
|---|---|
409 preview_stale |
A record changed after the preview. Preview again, show the new result, and apply with the new token |
409 preview_mismatch |
The changes are not the previewed ones. Send the previewed list, or preview this one |
409 preview_expired |
The preview is more than 30 minutes old, or a new week began. Preview again |
409 stale_state |
Someone changed the record since you read it. Read it again, check it, and resend with the new revision (current_plan_revision for an allocation) |
409 allocation_exists |
The person already has an allocation on that deliverable or task. Send an update to allocation_id instead of a create |
409 boundary_resolution_required |
A tied allocation would leave its deliverable’s dates. Resend the change with "boundary": "extend" to move the dates, or "detach" to untie it |
409 resourcing_busy |
Another save held the same rows. Retry after a moment |
409 idempotency_key_reused |
The key was used for another list. Use a new key for each list |
422 over_budget |
The change goes past the budget’s cap. Lower the minutes (budget.remaining_minutes is what fits), or have a user with “allow over budget resourcing” on the project make it |
422 past_week, 422 date_in_past |
A change writes a week before this week, or moves a date before today |
403 permission_missing |
The token’s user lacks the API permission of a change (capability) |
403 resourcing_edit_not_permitted |
The token’s user cannot edit the project’s resourcing |
7. Move dates
The same endpoints move deliverable, task and milestone dates, and push a project. Read the record’s updated_at from GET /api/v1/projects/:id and send it as expected_updated_at.
{"changes": [
{"type": "set_deliverable_dates", "deliverable_id": 210, "expected_updated_at": "2026-10-01T02:03:04.123456Z",
"end_date": "2026-11-27", "move": {"task_dates": true, "milestones": true}},
{"type": "push_project", "project_id": 61, "from_date": "2026-11-02", "weeks": 3}
]}
Tied allocations always move with their deliverable’s or project’s dates. move adds the other allocations (other_allocations), the deliverable’s task dates (task_dates) and the milestones (milestones). The preview’s dates collection lists every date that moves.
8. Remove an allocation
Send a delete change in a list, so the removal is previewed with the rest and can be undone:
{"changes": [{"type": "delete", "allocation_id": 9002, "expected_plan_revision": 1}]}
Or delete it on its own:
curl -X DELETE -H "Authorization: Bearer $DRUM_API_TOKEN" \
"https://app.getdrum.com/api/v1/allocations/9002"
Either way, if the allocation has past weeks, they stay as history and only its current and future weeks go. An allocation removed with DELETE cannot be restored.
To clear one week but keep the allocation, send a set_week with minutes 0. The last week cannot be cleared this way.
9. Undo a list
Preview and apply a list with one undo change and the change_set_id of the list to undo:
{"changes": [{"type": "undo", "change_set_id": 7001}]}
The author of the list, or an account admin, can undo it within 30 days. An undo is refused when a record changed since (undo_stale) or when it would change a past week or date (undo_past_boundary). Allocations the list deleted come back with new ids: the receipt maps old ids to new.
Moving from /allocation_changes
/api/v1/allocation_changes/preview and /apply are deprecated and stay for one release. To move:
- Send the same changes to
/api/v1/resourcing_changes/previewand/apply. - Add an
idempotency_keyto each apply, and the preview’spreview_token. - Read the impact from the preview pages instead of
impact.