Customer User Groups

Customer user groups can be used to separate travel for a single user to be segmented into silos (e.g. businesses), so that access can be controlled via the business that the user is accessing the product through.

id
string

Duffel's unique identifier for the resource

Example: "usg_0000AgZitpOnQtd3NQxjwO"
name
string

The customer user group's name

Example: "Northwind Solutions"
user_ids
string[]

The list of customer users that belong to this group

Example: ["icu_0000AgZitpOnQtd3NQxjwX"]

Retrieves a list of customer user groups

Endpoint

GET https://api.duffel.com/identity/customer/user_groups

Request

curl -X GET --compressed "https://api.duffel.com/identity/customer/user_groups" \
-H "Accept-Encoding: gzip" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Duffel-Version: v2" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"

Response

{
"meta": {
"limit": 50,
"after": "g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="
},
"data": [
{
"user_ids": [
"icu_0000AgZitpOnQtd3NQxjwX"
],
"name": "Northwind Solutions",
"id": "usg_0000AgZitpOnQtd3NQxjwO"
}
]
}

Creates a customer user group for the organisation.

Body parameters

name
stringrequired

The customer user group's name

Example: "Northwind Solutions"
user_ids
string[]

The list of customer users that belong to this group

Example: ["icu_0000AgZitpOnQtd3NQxjwX"]

Endpoint

POST https://api.duffel.com/identity/customer/user_groups

Request

curl -X POST --compressed "https://api.duffel.com/identity/customer/user_groups" \
-H "Accept-Encoding: gzip" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Duffel-Version: v2" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
-d '{
"data": {
"user_ids": [
"icu_0000AgZitpOnQtd3NQxjwX"
],
"name": "Northwind Solutions"
}
}'

Response

{
"data": {
"user_ids": [
"icu_0000AgZitpOnQtd3NQxjwX"
],
"name": "Northwind Solutions",
"id": "usg_0000AgZitpOnQtd3NQxjwO"
}
}

Delete an customer user group by its ID

URL parameters

id
stringrequired

Duffel's unique identifier for the resource

Example: "usg_0000AgZitpOnQtd3NQxjwO"

Endpoint

DELETE https://api.duffel.com/identity/customer/user_groups/{id}

Request

curl -X DELETE --compressed "https://api.duffel.com/identity/customer/user_groups/{id}" \
-H "Accept-Encoding: gzip" \
-H "Accept: application/json" \
-H "Duffel-Version: v2" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"

Response

No response body

Retrieves an customer user group by its ID

URL parameters

id
stringrequired

Duffel's unique identifier for the resource

Example: "usg_0000AgZitpOnQtd3NQxjwO"

Endpoint

GET https://api.duffel.com/identity/customer/user_groups/{id}

Request

curl -X GET --compressed "https://api.duffel.com/identity/customer/user_groups/{id}" \
-H "Accept-Encoding: gzip" \
-H "Accept: application/json" \
-H "Duffel-Version: v2" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"

Response

{
"data": {
"user_ids": [
"icu_0000AgZitpOnQtd3NQxjwX"
],
"name": "Northwind Solutions",
"id": "usg_0000AgZitpOnQtd3NQxjwO"
}
}

Updates an customer user group by its ID

URL parameters

id
stringrequired

Duffel's unique identifier for the resource

Example: "usg_0000AgZitpOnQtd3NQxjwO"

Body parameters

name
string

The customer user group's name

Example: "Northwind Solutions"
user_ids
string[]

The list of customer users that belong to this group

Example: ["icu_00009zg3q4J9z4z3"]

Endpoint

PATCH https://api.duffel.com/identity/customer/user_groups/{id}

Request

curl -X PATCH --compressed "https://api.duffel.com/identity/customer/user_groups/{id}" \
-H "Accept-Encoding: gzip" \
-H "Accept: application/json" \
-H "Duffel-Version: v2" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
-d '{
"data": {
"user_ids": [
"icu_00009zg3q4J9z4z3"
],
"name": "Northwind Solutions"
}
}'

Response

{
"data": {
"user_ids": [
"icu_0000AgZitpOnQtd3NQxjwX"
],
"name": "Northwind Solutions",
"id": "usg_0000AgZitpOnQtd3NQxjwO"
}
}