Teams
17 API calls in this section.
Team management for multi-team access control. Teams group services, drivers, users, and customers by operation area.
List Teams
/delivery/teamsList all teams for the tenant with member counts.
Query parameters
| Parameter | Type | Description |
|---|---|---|
page | string | Page number Example: |
limit | string | Items per page (max 100) Example: |
active | string | Filter by active status (true/false) Example: |
search | string | Search by name or code |
tenant_id | string | Tenant ID |
language | string | Preferred language Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/delivery/teams?page=1&limit=20&active=true&search=&tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "data": [4 {5 "id": "uuid",6 "tenant_id": "uuid",7 "name": "Erbil",8 "code": "erbil",9 "description": "Erbil city operations",10 "active": true,11 "created_at": "2026-05-09T10:00:00Z",12 "updated_at": "2026-05-09T10:00:00Z",13 "counts": {14 "services": 3,15 "drivers": 12,16 "users": 4,17 "customers": 018 }19 }20 ],21 "pagination": {22 "page": 1,23 "limit": 20,24 "total": 3,25 "total_pages": 126 }27}Create Team
/delivery/teamsCreate a new team. Code is auto-generated (T001, T002, ...). Name/description accept a plain string or a multilingual object { en, ar, ku, ... }.
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Tenant ID |
language | string | Preferred language Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
name | object | — |
name.en | string | — |
name.ar | string | — |
name.ku | string | — |
description | object | — |
description.en | string | — |
description.ar | string | — |
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/delivery/teams?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "name": {6 "en": "Erbil",7 "ar": "أربيل",8 "ku": "ھەولێر"9 },10 "description": {11 "en": "Erbil city operations team",12 "ar": "فريق عمليات مدينة أربيل"13 }14}'Response examples
1{2 "success": true,3 "message": "team_created",4 "data": {5 "id": "uuid",6 "tenant_id": "uuid",7 "name": "Erbil",8 "code": "T001",9 "description": "Erbil city operations team",10 "active": true,11 "created_at": "2026-05-09T10:00:00Z",12 "updated_at": "2026-05-09T10:00:00Z"13 }14}Get Team
/delivery/teams/:teamIdGet team detail with assigned services, drivers, users, and customers.
Path parameters
| Parameter | Type | Description |
|---|---|---|
teamIdRequired | string | Team UUID |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Tenant ID |
language | string | Preferred language Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/delivery/teams/${TEAMID}?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "data": {4 "id": "uuid",5 "tenant_id": "uuid",6 "name": "Erbil",7 "code": "erbil",8 "description": "Erbil city operations",9 "active": true,10 "created_at": "2026-05-09T10:00:00Z",11 "updated_at": "2026-05-09T10:00:00Z",12 "services": [13 {14 "id": "uuid",15 "name": "Erbil Same Day",16 "code": "erbil-sd",17 "active": true18 }19 ],20 "drivers": [21 {22 "id": "uuid",23 "user_id": "uuid",24 "status": "active",25 "full_name": "Ahmad",26 "avatar_url": null27 }28 ],29 "users": [30 {31 "id": "uuid",32 "full_name": "Dispatcher Ali",33 "avatar_url": null,34 "email": "ali@example.com"35 }36 ],37 "customers": []38 }39}Update Team
/delivery/teams/:teamIdUpdate team properties. All fields optional. Code is auto-generated and cannot be changed. Name/description accept a plain string or multilingual object.
Path parameters
| Parameter | Type | Description |
|---|---|---|
teamIdRequired | string | Team UUID |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Tenant ID |
language | string | Preferred language Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
name | object | — |
name.en | string | — |
name.ar | string | — |
description | string | — |
active | boolean | — |
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/delivery/teams/${TEAMID}?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "name": {6 "en": "Erbil Updated",7 "ar": "أربيل محدث"8 },9 "description": "Updated description",10 "active": true11}'Response examples
1{2 "success": true,3 "message": "team_updated",4 "data": {5 "id": "uuid",6 "name": "Erbil Updated",7 "code": "erbil",8 "active": true9 }10}Delete Team
/delivery/teams/:teamIdDelete a team. Clears all entity mappings (entities become 'All Teams' if no other assignments).
Path parameters
| Parameter | Type | Description |
|---|---|---|
teamIdRequired | string | Team UUID |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Tenant ID |
language | string | Preferred language Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request DELETE "https://staging-api.ondi.io/functions/v1/delivery/teams/${TEAMID}?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "message": "team_deleted"4}Assign Services to Team
/delivery/teams/:teamId/servicesReplace all services assigned to this team. Send empty array to clear.
Path parameters
| Parameter | Type | Description |
|---|---|---|
teamIdRequired | string | Team UUID |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Tenant ID |
language | string | Preferred language Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
service_ids | array<string> | — |
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/delivery/teams/${TEAMID}/services?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "service_ids": [6 "service-uuid-1",7 "service-uuid-2"8 ]9}'Response examples
1{2 "success": true,3 "message": "team_services_updated"4}Assign Drivers to Team
/delivery/teams/:teamId/driversReplace all drivers assigned to this team.
Path parameters
| Parameter | Type | Description |
|---|---|---|
teamIdRequired | string | Team UUID |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Tenant ID |
language | string | Preferred language Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
driver_ids | array<string> | — |
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/delivery/teams/${TEAMID}/drivers?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "driver_ids": [6 "driver-uuid-1",7 "driver-uuid-2"8 ]9}'Response examples
1{2 "success": true,3 "message": "team_drivers_updated"4}Assign Users to Team
/delivery/teams/:teamId/usersReplace all users (admins/dispatchers) assigned to this team.
Path parameters
| Parameter | Type | Description |
|---|---|---|
teamIdRequired | string | Team UUID |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Tenant ID |
language | string | Preferred language Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
user_ids | array<string> | — |
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/delivery/teams/${TEAMID}/users?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "user_ids": [6 "user-uuid-1",7 "user-uuid-2"8 ]9}'Response examples
1{2 "success": true,3 "message": "team_users_updated"4}Assign Customers to Team
/delivery/teams/:teamId/customersReplace all customers assigned to this team.
Path parameters
| Parameter | Type | Description |
|---|---|---|
teamIdRequired | string | Team UUID |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Tenant ID |
language | string | Preferred language Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
customer_ids | array<string> | — |
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/delivery/teams/${TEAMID}/customers?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "customer_ids": [6 "customer-uuid-1"7 ]8}'Response examples
1{2 "success": true,3 "message": "team_customers_updated"4}Remove Service from Team
/delivery/teams/:teamId/services/:serviceIdRemove a single service from a team without affecting other assignments.
Path parameters
| Parameter | Type | Description |
|---|---|---|
teamIdRequired | string | Team UUID |
serviceIdRequired | string | Delivery Service UUID |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Tenant ID |
language | string | Preferred language Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request DELETE "https://staging-api.ondi.io/functions/v1/delivery/teams/${TEAMID}/services/${SERVICEID}?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "message": "service_removed_from_team"4}Remove Driver from Team
/delivery/teams/:teamId/drivers/:driverIdRemove a single driver from a team. Also removes the driver's auto-synced user_teams entry.
Path parameters
| Parameter | Type | Description |
|---|---|---|
teamIdRequired | string | Team UUID |
driverIdRequired | string | Driver UUID |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Tenant ID |
language | string | Preferred language Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request DELETE "https://staging-api.ondi.io/functions/v1/delivery/teams/${TEAMID}/drivers/${DRIVERID}?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "message": "driver_removed_from_team"4}Remove User from Team
/delivery/teams/:teamId/users/:userIdRemove a single user (admin/dispatcher) from a team.
Path parameters
| Parameter | Type | Description |
|---|---|---|
teamIdRequired | string | Team UUID |
userIdRequired | string | User UUID |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Tenant ID |
language | string | Preferred language Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request DELETE "https://staging-api.ondi.io/functions/v1/delivery/teams/${TEAMID}/users/${USERID}?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "message": "user_removed_from_team"4}Remove Customer from Team
/delivery/teams/:teamId/customers/:customerIdRemove a single customer from a team.
Path parameters
| Parameter | Type | Description |
|---|---|---|
teamIdRequired | string | Team UUID |
customerIdRequired | string | Customer UUID |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Tenant ID |
language | string | Preferred language Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request DELETE "https://staging-api.ondi.io/functions/v1/delivery/teams/${TEAMID}/customers/${CUSTOMERID}?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "message": "customer_removed_from_team"4}Set Teams for Service
/delivery/services/:serviceId/teamsSet teams for a delivery service. Use all_teams:true to make unrestricted.
Path parameters
| Parameter | Type | Description |
|---|---|---|
serviceIdRequired | string | Delivery Service UUID |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Tenant ID |
language | string | Preferred language Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
all_teams | boolean | — |
team_ids | array<string> | — |
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/delivery/services/${SERVICEID}/teams?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "all_teams": false,6 "team_ids": [7 "team-uuid-1",8 "team-uuid-2"9 ]10}'Response examples
1{2 "success": true,3 "message": "service_teams_updated"4}Set Teams for Driver
/delivery/drivers/:driverId/teamsSet teams for a driver. Use all_teams:true to make unrestricted.
Path parameters
| Parameter | Type | Description |
|---|---|---|
driverIdRequired | string | Driver UUID |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Tenant ID |
language | string | Preferred language Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
all_teams | boolean | — |
team_ids | array<string> | — |
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/delivery/drivers/${DRIVERID}/teams?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "all_teams": false,6 "team_ids": [7 "team-uuid-1"8 ]9}'Response examples
1{2 "success": true,3 "message": "driver_teams_updated"4}Set Teams for User
/delivery/users/:userId/teamsSet teams for a user (admin/dispatcher). Use all_teams:true to make unrestricted.
Path parameters
| Parameter | Type | Description |
|---|---|---|
userIdRequired | string | User UUID |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Tenant ID |
language | string | Preferred language Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
all_teams | boolean | — |
team_ids | array<string> | — |
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/delivery/users/${USERID}/teams?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "all_teams": false,6 "team_ids": [7 "team-uuid-1",8 "team-uuid-2"9 ]10}'Response examples
1{2 "success": true,3 "message": "user_teams_updated"4}Set Teams for Customer
/delivery/customers/:customerId/teamsSet teams for a customer. Use all_teams:true to make unrestricted.
Path parameters
| Parameter | Type | Description |
|---|---|---|
customerIdRequired | string | Customer UUID |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Tenant ID |
language | string | Preferred language Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
all_teams | boolean | — |
team_ids | array<string> | — |
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/delivery/customers/${CUSTOMERID}/teams?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "all_teams": false,6 "team_ids": [7 "team-uuid-1"8 ]9}'Response examples
1{2 "success": true,3 "message": "customer_teams_updated"4}