Skip to main content

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 & Last-Mile / Teams
GET/delivery/teams

List all teams for the tenant with member counts.

Query parameters

ParameterTypeDescription
pagestring

Page number

Example: 1

limitstring

Items per page (max 100)

Example: 20

activestring

Filter by active status (true/false)

Example: true

searchstring

Search by name or code

tenant_idstring

Tenant ID

languagestring

Preferred language

Example: en

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Staging
Request
curl
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

200OK
Response body
json
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 & Last-Mile / Teams
POST/delivery/teams

Create a new team. Code is auto-generated (T001, T002, ...). Name/description accept a plain string or a multilingual object { en, ar, ku, ... }.

Query parameters

ParameterTypeDescription
tenant_idstring

Tenant ID

languagestring

Preferred language

Example: en

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
nameobject—
name.enstring—
name.arstring—
name.kustring—
descriptionobject—
description.enstring—
description.arstring—
Staging
Request
curl
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

201Created
Response body
json
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 & Last-Mile / Teams
GET/delivery/teams/:teamId

Get team detail with assigned services, drivers, users, and customers.

Path parameters

ParameterTypeDescription
teamIdRequiredstring

Team UUID

Query parameters

ParameterTypeDescription
tenant_idstring

Tenant ID

languagestring

Preferred language

Example: en

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Staging
Request
curl
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

200OK
Response body
json
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 & Last-Mile / Teams
PUT/delivery/teams/:teamId

Update team properties. All fields optional. Code is auto-generated and cannot be changed. Name/description accept a plain string or multilingual object.

Path parameters

ParameterTypeDescription
teamIdRequiredstring

Team UUID

Query parameters

ParameterTypeDescription
tenant_idstring

Tenant ID

languagestring

Preferred language

Example: en

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
nameobject—
name.enstring—
name.arstring—
descriptionstring—
activeboolean—
Staging
Request
curl
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

200OK
Response body
json
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 & Last-Mile / Teams
DELETE/delivery/teams/:teamId

Delete a team. Clears all entity mappings (entities become 'All Teams' if no other assignments).

Path parameters

ParameterTypeDescription
teamIdRequiredstring

Team UUID

Query parameters

ParameterTypeDescription
tenant_idstring

Tenant ID

languagestring

Preferred language

Example: en

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Staging
Request
curl
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

200OK
Response body
json
1{2  "success": true,3  "message": "team_deleted"4}

Assign Services to Team​

Delivery & Last-Mile / Teams
PUT/delivery/teams/:teamId/services

Replace all services assigned to this team. Send empty array to clear.

Path parameters

ParameterTypeDescription
teamIdRequiredstring

Team UUID

Query parameters

ParameterTypeDescription
tenant_idstring

Tenant ID

languagestring

Preferred language

Example: en

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
service_idsarray<string>—
Staging
Request
curl
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

200OK
Response body
json
1{2  "success": true,3  "message": "team_services_updated"4}

Assign Drivers to Team​

Delivery & Last-Mile / Teams
PUT/delivery/teams/:teamId/drivers

Replace all drivers assigned to this team.

Path parameters

ParameterTypeDescription
teamIdRequiredstring

Team UUID

Query parameters

ParameterTypeDescription
tenant_idstring

Tenant ID

languagestring

Preferred language

Example: en

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
driver_idsarray<string>—
Staging
Request
curl
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

200OK
Response body
json
1{2  "success": true,3  "message": "team_drivers_updated"4}

Assign Users to Team​

Delivery & Last-Mile / Teams
PUT/delivery/teams/:teamId/users

Replace all users (admins/dispatchers) assigned to this team.

Path parameters

ParameterTypeDescription
teamIdRequiredstring

Team UUID

Query parameters

ParameterTypeDescription
tenant_idstring

Tenant ID

languagestring

Preferred language

Example: en

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
user_idsarray<string>—
Staging
Request
curl
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

200OK
Response body
json
1{2  "success": true,3  "message": "team_users_updated"4}

Assign Customers to Team​

Delivery & Last-Mile / Teams
PUT/delivery/teams/:teamId/customers

Replace all customers assigned to this team.

Path parameters

ParameterTypeDescription
teamIdRequiredstring

Team UUID

Query parameters

ParameterTypeDescription
tenant_idstring

Tenant ID

languagestring

Preferred language

Example: en

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
customer_idsarray<string>—
Staging
Request
curl
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

200OK
Response body
json
1{2  "success": true,3  "message": "team_customers_updated"4}

Remove Service from Team​

Delivery & Last-Mile / Teams
DELETE/delivery/teams/:teamId/services/:serviceId

Remove a single service from a team without affecting other assignments.

Path parameters

ParameterTypeDescription
teamIdRequiredstring

Team UUID

serviceIdRequiredstring

Delivery Service UUID

Query parameters

ParameterTypeDescription
tenant_idstring

Tenant ID

languagestring

Preferred language

Example: en

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Staging
Request
curl
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

200OK
Response body
json
1{2  "success": true,3  "message": "service_removed_from_team"4}

Remove Driver from Team​

Delivery & Last-Mile / Teams
DELETE/delivery/teams/:teamId/drivers/:driverId

Remove a single driver from a team. Also removes the driver's auto-synced user_teams entry.

Path parameters

ParameterTypeDescription
teamIdRequiredstring

Team UUID

driverIdRequiredstring

Driver UUID

Query parameters

ParameterTypeDescription
tenant_idstring

Tenant ID

languagestring

Preferred language

Example: en

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Staging
Request
curl
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

200OK
Response body
json
1{2  "success": true,3  "message": "driver_removed_from_team"4}

Remove User from Team​

Delivery & Last-Mile / Teams
DELETE/delivery/teams/:teamId/users/:userId

Remove a single user (admin/dispatcher) from a team.

Path parameters

ParameterTypeDescription
teamIdRequiredstring

Team UUID

userIdRequiredstring

User UUID

Query parameters

ParameterTypeDescription
tenant_idstring

Tenant ID

languagestring

Preferred language

Example: en

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Staging
Request
curl
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

200OK
Response body
json
1{2  "success": true,3  "message": "user_removed_from_team"4}

Remove Customer from Team​

Delivery & Last-Mile / Teams
DELETE/delivery/teams/:teamId/customers/:customerId

Remove a single customer from a team.

Path parameters

ParameterTypeDescription
teamIdRequiredstring

Team UUID

customerIdRequiredstring

Customer UUID

Query parameters

ParameterTypeDescription
tenant_idstring

Tenant ID

languagestring

Preferred language

Example: en

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Staging
Request
curl
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

200OK
Response body
json
1{2  "success": true,3  "message": "customer_removed_from_team"4}

Set Teams for Service​

Delivery & Last-Mile / Teams
PUT/delivery/services/:serviceId/teams

Set teams for a delivery service. Use all_teams:true to make unrestricted.

Path parameters

ParameterTypeDescription
serviceIdRequiredstring

Delivery Service UUID

Query parameters

ParameterTypeDescription
tenant_idstring

Tenant ID

languagestring

Preferred language

Example: en

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
all_teamsboolean—
team_idsarray<string>—
Staging
Request
curl
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

200OK
Response body
json
1{2  "success": true,3  "message": "service_teams_updated"4}

Set Teams for Driver​

Delivery & Last-Mile / Teams
PUT/delivery/drivers/:driverId/teams

Set teams for a driver. Use all_teams:true to make unrestricted.

Path parameters

ParameterTypeDescription
driverIdRequiredstring

Driver UUID

Query parameters

ParameterTypeDescription
tenant_idstring

Tenant ID

languagestring

Preferred language

Example: en

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
all_teamsboolean—
team_idsarray<string>—
Staging
Request
curl
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

200OK
Response body
json
1{2  "success": true,3  "message": "driver_teams_updated"4}

Set Teams for User​

Delivery & Last-Mile / Teams
PUT/delivery/users/:userId/teams

Set teams for a user (admin/dispatcher). Use all_teams:true to make unrestricted.

Path parameters

ParameterTypeDescription
userIdRequiredstring

User UUID

Query parameters

ParameterTypeDescription
tenant_idstring

Tenant ID

languagestring

Preferred language

Example: en

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
all_teamsboolean—
team_idsarray<string>—
Staging
Request
curl
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

200OK
Response body
json
1{2  "success": true,3  "message": "user_teams_updated"4}

Set Teams for Customer​

Delivery & Last-Mile / Teams
PUT/delivery/customers/:customerId/teams

Set teams for a customer. Use all_teams:true to make unrestricted.

Path parameters

ParameterTypeDescription
customerIdRequiredstring

Customer UUID

Query parameters

ParameterTypeDescription
tenant_idstring

Tenant ID

languagestring

Preferred language

Example: en

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
all_teamsboolean—
team_idsarray<string>—
Staging
Request
curl
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

200OK
Response body
json
1{2  "success": true,3  "message": "customer_teams_updated"4}