> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.itspropel.com/llms.txt.
> For full documentation content, see https://docs.itspropel.com/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itspropel.com/_mcp/server.

# Assign Team

POST https://dispatch/assign-team
Content-Type: multipart/form-data

Atomically dispatch all active members of a team to a work order. Creates one work_order_team_dispatch row plus per-member work_order_assignment rows in a single transaction.

Body fields:
- work_order_id (required, UUID): work order to dispatch the team to.
- team_id (required, UUID): workforce team (not soft-deleted, tenant-scoped).
- scheduled_start_time (optional, ISO-8601): assignment scheduled start.
- scheduled_end_time (optional, ISO-8601, after scheduled_start_time): assignment scheduled end.
- assignment_notes (optional, string max 2000): notes copied to each assignment row.

Validation 422 codes: TEAM_EMPTY, TEAM_DISPATCH_EXISTS, LOCATION_MISMATCH (when tenant team_dispatch_location_mode='strict'), TEAM_UNDERSTAFFED (when team_dispatch_understaffed_mode='block'), TEAM_LEAD_MISSING (when team_dispatch_lead_missing_mode='block'), MEMBER_OVERLAPPING_ASSIGNMENT.

Idempotent: re-dispatching the same team to a work order that already has the same active team-dispatch returns the existing row with 200.

Fires: TeamDispatched (always); TeamDispatchUnderstaffed / TeamDispatchLeadMissing if applicable.

Reference: https://docs.itspropel.com/propel-biz/24-dispatcher/team-dispatch/assign-team

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: PropelBiz
  version: 1.0.0
paths:
  /dispatch/assign-team:
    post:
      operationId: assign-team
      summary: Assign Team
      description: >-
        Atomically dispatch all active members of a team to a work order.
        Creates one work_order_team_dispatch row plus per-member
        work_order_assignment rows in a single transaction.


        Body fields:

        - work_order_id (required, UUID): work order to dispatch the team to.

        - team_id (required, UUID): workforce team (not soft-deleted,
        tenant-scoped).

        - scheduled_start_time (optional, ISO-8601): assignment scheduled start.

        - scheduled_end_time (optional, ISO-8601, after scheduled_start_time):
        assignment scheduled end.

        - assignment_notes (optional, string max 2000): notes copied to each
        assignment row.


        Validation 422 codes: TEAM_EMPTY, TEAM_DISPATCH_EXISTS,
        LOCATION_MISMATCH (when tenant team_dispatch_location_mode='strict'),
        TEAM_UNDERSTAFFED (when team_dispatch_understaffed_mode='block'),
        TEAM_LEAD_MISSING (when team_dispatch_lead_missing_mode='block'),
        MEMBER_OVERLAPPING_ASSIGNMENT.


        Idempotent: re-dispatching the same team to a work order that already
        has the same active team-dispatch returns the existing row with 200.


        Fires: TeamDispatched (always); TeamDispatchUnderstaffed /
        TeamDispatchLeadMissing if applicable.
      tags:
        - subpackage_24Dispatcher.subpackage_24Dispatcher/teamDispatch
      parameters:
        - name: '{{tenant_key_name}}'
          in: header
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/24 Dispatcher_Team Dispatch_Assign
                  Team_Response_200
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                team_id:
                  type: string
                  description: >-
                    Required: UUID of the workforce team (not soft-deleted,
                    tenant-scoped).
                work_order_id:
                  type: string
                  description: 'Required: UUID of the work order to dispatch the team to.'
                assignment_notes:
                  type: string
                  description: >-
                    Optional: notes copied to each per-member assignment row
                    (max 2000 chars).
                scheduled_end_time:
                  type: string
                  description: >-
                    Optional: ISO-8601 assignment scheduled end (must be after
                    scheduled_start_time).
                scheduled_start_time:
                  type: string
                  description: 'Optional: ISO-8601 assignment scheduled start.'
              required:
                - team_id
                - work_order_id
                - assignment_notes
                - scheduled_end_time
                - scheduled_start_time
servers:
  - url: https:/
components:
  schemas:
    24 Dispatcher_Team Dispatch_Assign Team_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: 24 Dispatcher_Team Dispatch_Assign Team_Response_200

```

## SDK Code Examples

```python
import requests

url = "https://https/dispatch/assign-team"

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"team_id\"\r\n\r\n3fa85f64-5717-4562-b3fc-2c963f66afa6\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"work_order_id\"\r\n\r\n7c9e6679-7425-40de-944b-e07fc1f90ae7\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"assignment_notes\"\r\n\r\nEnsure all safety protocols are followed during the assignment.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scheduled_end_time\"\r\n\r\n2024-07-01T17:00:00Z\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scheduled_start_time\"\r\n\r\n2024-07-01T09:00:00Z\r\n-----011000010111000001101001--\r\n"
headers = {
    "{{tenant_key_name}}": "{{tenant_key_value1}}|{{tenant_key_value2}}",
    "Content-Type": "multipart/form-data; boundary=---011000010111000001101001"
}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://https/dispatch/assign-team';
const form = new FormData();
form.append('team_id', '3fa85f64-5717-4562-b3fc-2c963f66afa6');
form.append('work_order_id', '7c9e6679-7425-40de-944b-e07fc1f90ae7');
form.append('assignment_notes', 'Ensure all safety protocols are followed during the assignment.');
form.append('scheduled_end_time', '2024-07-01T17:00:00Z');
form.append('scheduled_start_time', '2024-07-01T09:00:00Z');

const options = {
  method: 'POST',
  headers: {'{{tenant_key_name}}': '{{tenant_key_value1}}|{{tenant_key_value2}}'}
};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://https/dispatch/assign-team"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"team_id\"\r\n\r\n3fa85f64-5717-4562-b3fc-2c963f66afa6\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"work_order_id\"\r\n\r\n7c9e6679-7425-40de-944b-e07fc1f90ae7\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"assignment_notes\"\r\n\r\nEnsure all safety protocols are followed during the assignment.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scheduled_end_time\"\r\n\r\n2024-07-01T17:00:00Z\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scheduled_start_time\"\r\n\r\n2024-07-01T09:00:00Z\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("{{tenant_key_name}}", "{{tenant_key_value1}}|{{tenant_key_value2}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://https/dispatch/assign-team")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["{{tenant_key_name}}"] = '{{tenant_key_value1}}|{{tenant_key_value2}}'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"team_id\"\r\n\r\n3fa85f64-5717-4562-b3fc-2c963f66afa6\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"work_order_id\"\r\n\r\n7c9e6679-7425-40de-944b-e07fc1f90ae7\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"assignment_notes\"\r\n\r\nEnsure all safety protocols are followed during the assignment.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scheduled_end_time\"\r\n\r\n2024-07-01T17:00:00Z\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scheduled_start_time\"\r\n\r\n2024-07-01T09:00:00Z\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://https/dispatch/assign-team")
  .header("{{tenant_key_name}}", "{{tenant_key_value1}}|{{tenant_key_value2}}")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"team_id\"\r\n\r\n3fa85f64-5717-4562-b3fc-2c963f66afa6\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"work_order_id\"\r\n\r\n7c9e6679-7425-40de-944b-e07fc1f90ae7\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"assignment_notes\"\r\n\r\nEnsure all safety protocols are followed during the assignment.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scheduled_end_time\"\r\n\r\n2024-07-01T17:00:00Z\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scheduled_start_time\"\r\n\r\n2024-07-01T09:00:00Z\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/dispatch/assign-team', [
  'multipart' => [
    [
        'name' => 'team_id',
        'contents' => '3fa85f64-5717-4562-b3fc-2c963f66afa6'
    ],
    [
        'name' => 'work_order_id',
        'contents' => '7c9e6679-7425-40de-944b-e07fc1f90ae7'
    ],
    [
        'name' => 'assignment_notes',
        'contents' => 'Ensure all safety protocols are followed during the assignment.'
    ],
    [
        'name' => 'scheduled_end_time',
        'contents' => '2024-07-01T17:00:00Z'
    ],
    [
        'name' => 'scheduled_start_time',
        'contents' => '2024-07-01T09:00:00Z'
    ]
  ]
  'headers' => [
    '{{tenant_key_name}}' => '{{tenant_key_value1}}|{{tenant_key_value2}}',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://https/dispatch/assign-team");
var request = new RestRequest(Method.POST);
request.AddHeader("{{tenant_key_name}}", "{{tenant_key_value1}}|{{tenant_key_value2}}");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"team_id\"\r\n\r\n3fa85f64-5717-4562-b3fc-2c963f66afa6\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"work_order_id\"\r\n\r\n7c9e6679-7425-40de-944b-e07fc1f90ae7\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"assignment_notes\"\r\n\r\nEnsure all safety protocols are followed during the assignment.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scheduled_end_time\"\r\n\r\n2024-07-01T17:00:00Z\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scheduled_start_time\"\r\n\r\n2024-07-01T09:00:00Z\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["{{tenant_key_name}}": "{{tenant_key_value1}}|{{tenant_key_value2}}"]
let parameters = [
  [
    "name": "team_id",
    "value": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  [
    "name": "work_order_id",
    "value": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
  ],
  [
    "name": "assignment_notes",
    "value": "Ensure all safety protocols are followed during the assignment."
  ],
  [
    "name": "scheduled_end_time",
    "value": "2024-07-01T17:00:00Z"
  ],
  [
    "name": "scheduled_start_time",
    "value": "2024-07-01T09:00:00Z"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://https/dispatch/assign-team")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```