Component Client Keys

Component client keys are used to authenticate Duffel UI components.

component_client_key
string

The client key to authenticate Duffel UI components. This is a signed JWT of the claims you provided; consuming endpoints enforce those claims when the key is used.

Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiaWN1XzAwMDBBZ1ppdHBPblF0ZDNOUXhqd08iLCJvcmRlcl9pZCI6Im9yZF8wMDAwQUJkWm5nZ1NjdDdCb3JhVTFvIiwiaWF0IjoxNTE2MjM5MDIyfQ.GtJDKrfum7aLlNaXmUj-RtQIbx0-Opwjdid0fiJk6DE"

Creates a component client key by signing the claims you send.

This endpoint does not validate that the claims are correct, complete, or appropriate for a later request. It only signs them into a short-lived token. If a claim is missing or wrong, this request will still succeed; the API call that uses the key will fail.

You can omit the request body to create a key with no extra claims.

Body parameters

Claims to sign into the client key.

You may provide a user_id, a user_id and order_id, or a user_id and booking_id. You can also omit the request body to create a key with no extra claims.

This endpoint does not check that the claims are valid, complete, or appropriate for a later request. Downstream endpoints that accept the key decide whether the claims make sense; if they are missing or incorrect, creating the key will still succeed and the failure happens when the key is used.

Component Client Key User Only Payload
object

Use this payload to create a client key scoped to a customer user

Component Client Key User And Order Payload
object

Use this payload to create a client key scoped to a customer user and order.

Component Client Key User And Booking Payload
object

Use this payload to create a client key scoped to a customer user and booking.

Endpoint

POST https://api.duffel.com/identity/component_client_keys

Request

curl -X POST --compressed "https://api.duffel.com/identity/component_client_keys" \
-H "Accept: application/json" \
-H "Accept-Encoding: gzip" \
-H "Duffel-Version: v2" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
-d '{}'

Response

{
"data": {
"component_client_key": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiaWN1XzAwMDBBZ1ppdHBPblF0ZDNOUXhqd08iLCJvcmRlcl9pZCI6Im9yZF8wMDAwQUJkWm5nZ1NjdDdCb3JhVTFvIiwiaWF0IjoxNTE2MjM5MDIyfQ.GtJDKrfum7aLlNaXmUj-RtQIbx0-Opwjdid0fiJk6DE"
}
}