Planner
Assign a resource to a service
Puts a person or a vehicle on a service.
planner:writeResult
generated from the schema
The target is EXACTLY one: the pair orderId + orderServiceId, or a task, or an internal service. The resource, also exactly one. conflictCount says how many commitments of the resource overlap with this assignment: the assignment is made anyway, and you decide what to do with the number. It responds 400 validation_error, with errors[]. on the field, when staffId, vehicleId or the target (orderServiceId, taskId, internalServiceId) does not exist or belongs to another account, when the target does not accept that type of resource (a task only accepts staff; a service, the resource types its requirements declare) and when the task does not block availability; 409 conflict when the resource is already assigned to that target or is unavailable in that period. Nothing is written in any of those cases.
Arguments
Order the service is attached to.
Service line within that order. Goes with orderId.
Schedule task to assign the resource to.
Internal assignment to cover.
Staff member being assigned.
Vehicle being assigned.
Role they are assigned with. E.g.: "Conductor".
Idempotency key chosen by the client (a UUID is recommended). Repeating the same key with the same arguments within 24 h returns the stored response without executing again; with different arguments it responds 422. It is the safe way to retry after a network failure.
Limits: min length 1, max length 255
Result
On success the result carries structuredContent with data and meta. These are the attributes of data.
Show the attributes of data
Operation result.
Commitments of the resource that overlap with this assignment.
An error is a result with isError: true and the problem in content[0].; there is no structuredContent. See Errors.
The same operation by REST
This tool runs POST /api/v1/planner/assignments.
Related pages
Link to this section: Related pagesPlanner
Assign a resource to a service
Puts a person or a vehicle on a service.
Guides
Safe writes
An assistant that can write can also write the wrong thing. Decide which tools need a person, retry without duplicating, and know what a write sets in motion.
Guides
Errors
A tool error is a result with
isError: trueand the problem in the first text block. Branch on itscode.
Was this page helpful?