Customer Users
Customer users are to support managing access to flights and stays
List customer users
Lists the customer users for the organisation.
Query parameters
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.
1
50
A cursor pointing to the next page of records. For more information on how to paginate through records, see the Pagination section.
"g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="
A cursor pointing to the previous page of records. For more information on how to paginate through records, see the Pagination section.
"g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="
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"}]}
Create a Customer User
Creates a customer user for the organisation.
Body parameters
The customer user's family name. Only space
, -
, '
, and letters from the ASCII
, Latin-1 Supplement
and Latin Extended-A
(with the exceptions of Æ
, æ
, IJ
, ij
, Œ
, œ
, Þ
, and ð
) Unicode charts are accepted. All other characters will result in a validation error. The minimum length is 1 or 2 characters, and the maximum, combined with given_name
, is 40 characters. We recommend using a minimum length of 2.
"Earhart"
The customer user's given name. Only space
, -
, '
, and letters from the ASCII
, Latin-1 Supplement
and Latin Extended-A
(with the exceptions of Æ
, æ
, IJ
, ij
, Œ
, œ
, Þ
, and ð
) Unicode charts are accepted. All other characters will result in a validation error. The minimum length is 1 or 2 characters, and the maximum, combined with family_name
, is 40 characters. We recommend using a minimum length of 2.
"Amelia"
The customer user's phone number in E.164 (international) format.
"+442080160509"
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"}}
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"}}
Update a single customer user
Updates a customer user based on provided ID
URL parameters
Body parameters
The customer user's phone number in E.164 (international) format.
"+442080160509"
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"}}