Customer Users

Customer users are to support managing access to flights and stays

created_at
datetime

The ISO 8601 datetime at which the user was created

Example: "2020-04-11T15:48:11.642Z"
email
string

The customer user's email address

Example: "amelia@duffel.com"
family_name
string

The customer user's family name

Example: "Earhart"
given_name
string

The customer user's given name

Example: "Amelia"
group
object

The group to which the user belongs

id
string

Duffel's unique identifier for the resource

Example: "icu_0000AgZitpOnQtd3NQxjwO"
live_mode
boolean

This field will be set to true if the customer user was created in live mode, or false if it was created in test mode.

Example: false
phone_number
stringnullable

The customer user's phone number in E.164 (international) format.

Example: "+442080160509"

Preview

This is not yet finalised. It may change, or be removed or be not yet accessible.

Lists the customer users for the organisation.

Query parameters

limit
integer

The maximum number of records to return per page. Defaults to 50. May be set to any integer between 1 and 200. For more information on how to paginate through records, see the Pagination section.

Example: 1
Default value: 50
before
string

A cursor pointing to the next page of records. For more information on how to paginate through records, see the Pagination section.

Example: "g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="
after
string

A cursor pointing to the previous page of records. For more information on how to paginate through records, see the Pagination section.

Example: "g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="
email
string

The email address of the customer users you'd like to retrieve

Example: "email@example.com"

Preview

This is not yet finalised. It may change, or be removed or be not yet accessible.

Endpoint

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

Request

curl -X GET --compressed "https://api.duffel.com/identity/customer/users?limit=1&before=g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB=&after=g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB=&email=email@example.com" \
-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": [
{
"phone_number": "+442080160509",
"live_mode": false,
"id": "icu_0000AgZitpOnQtd3NQxjwO",
"group": {
"name": "Northwind Solutions",
"id": "usg_0000AgZitpOnQtd3NQxjwO"
},
"given_name": "Amelia",
"family_name": "Earhart",
"email": "amelia@duffel.com",
"created_at": "2020-04-11T15:48:11.642Z"
}
]
}

Preview

This is not yet finalised. It may change, or be removed or be not yet accessible.

Creates a customer user for the organisation.

Body parameters

email
stringrequired

The customer user's email address

Example: "amelia@duffel.com"
family_name
stringrequired

The customer user's family name

Example: "Earhart"
given_name
stringrequired

The customer user's given name

Example: "Amelia"
group_id
string

The group you'd like to associate the customer user to

Example: "usg_0000AgZitpOnQtd3NQxjwO"
phone_number
string

The customer user's phone number in E.164 (international) format.

Example: "+442080160509"

Preview

This is not yet finalised. It may change, or be removed or be not yet accessible.

Endpoint

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

Request

curl -X POST --compressed "https://api.duffel.com/identity/customer/users" \
-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": {
"phone_number": "+442080160509",
"group_id": "usg_0000AgZitpOnQtd3NQxjwO",
"given_name": "Amelia",
"family_name": "Earhart",
"email": "amelia@duffel.com"
}
}'

Response

{
"data": {
"phone_number": "+442080160509",
"live_mode": false,
"id": "icu_0000AgZitpOnQtd3NQxjwO",
"group": {
"name": "Northwind Solutions",
"id": "usg_0000AgZitpOnQtd3NQxjwO"
},
"given_name": "Amelia",
"family_name": "Earhart",
"email": "amelia@duffel.com",
"created_at": "2020-04-11T15:48:11.642Z"
}
}

Preview

This is not yet finalised. It may change, or be removed or be not yet accessible.

Retrieves an customer user by its ID

URL parameters

id
stringrequired

Duffel's unique identifier for the resource

Example: "icu_0000AgZitpOnQtd3NQxjwO"

Preview

This is not yet finalised. It may change, or be removed or be not yet accessible.

Endpoint

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

Request

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

Response

{
"data": {
"phone_number": "+442080160509",
"live_mode": false,
"id": "icu_0000AgZitpOnQtd3NQxjwO",
"group": {
"name": "Northwind Solutions",
"id": "usg_0000AgZitpOnQtd3NQxjwO"
},
"given_name": "Amelia",
"family_name": "Earhart",
"email": "amelia@duffel.com",
"created_at": "2020-04-11T15:48:11.642Z"
}
}

Preview

This is not yet finalised. It may change, or be removed or be not yet accessible.

Updates a customer user based on provided ID

URL parameters

id
stringrequired

Duffel's unique identifier for the resource

Example: "icu_0000AgZitpOnQtd3NQxjwO"

Body parameters

email
stringrequired

The customer user's email address

Example: "amelia@duffel.com"
family_name
stringrequired

The customer user's family name

Example: "Earhart"
given_name
stringrequired

The customer user's given name

Example: "Amelia"
group_id
string

The group you'd like to associate the customer user to

Example: "usg_0000AgZitpOnQtd3NQxjwO"
phone_number
string

The customer user's phone number in E.164 (international) format.

Example: "+442080160509"

Preview

This is not yet finalised. It may change, or be removed or be not yet accessible.

Endpoint

PUT https://api.duffel.com/identity/customer/users/{id}

Request

curl -X PUT --compressed "https://api.duffel.com/identity/customer/users/{id}" \
-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": {
"phone_number": "+442080160509",
"group_id": "usg_0000AgZitpOnQtd3NQxjwO",
"given_name": "Amelia",
"family_name": "Earhart",
"email": "amelia@duffel.com"
}
}'

Response

{
"data": {
"phone_number": "+442080160509",
"live_mode": false,
"id": "icu_0000AgZitpOnQtd3NQxjwO",
"group": {
"name": "Northwind Solutions",
"id": "usg_0000AgZitpOnQtd3NQxjwO"
},
"given_name": "Amelia",
"family_name": "Earhart",
"email": "amelia@duffel.com",
"created_at": "2020-04-11T15:48:11.642Z"
}
}