Three lines

Uber

Developers

Link Account

Identity

The Identity endpoint links the requested third party account to the Uber user that has authorized the application.

Resource

POST /v1/identity/link-account

Authorization

OAuth 2.0 user access token that has the identity.link-account scope

POST Parameters
Parameter Type Description
thirdPartyUserID string The unique identifier of the user’s third party account.
accountType (optional) enum Distinguishes the type of third party account being linked to the user’s Uber account. Must be configured prior to use, please contact 3p-identity-group@uber.com.

Example Request

Replace <TOKEN> in the example below with a user access token

curl -X POST \
     -H 'Authorization: Bearer <TOKEN>' \
     -H 'Accept-Language: en_US' \
     -H 'Content-Type: application/json' \
     -d '{
           "thirdPartyUserID": "{THIRD_PARTY_USER_ID}",
        }' "https://api.uber.com/v1/identity/link-account"
Response for Example Request

Status-Code: 200 OK

{}
Subsequent response for Example Request

If subsequent requests are made with Example Request it will also succeed. It will not return a conflict because the Uber user is already linked to the requested thirdPartyUserID

Status-Code: 200 OK

{}

Unauthorized Request

Replace <BAD_TOKEN> in the example below with a user access token that does not have the identity.link-account scope

curl -X POST \
     -H 'Authorization: Bearer <BAD_TOKEN>' \
     -H 'Accept-Language: en_US' \
     -H 'Content-Type: application/json' \
     -d '{
           "thirdPartyUserID": "{THIRD_PARTY_USER_ID}",
        }' "https://api.uber.com/v1/identity/link-account"
Unauthorized Response

Status-Code: 401 UNAUTHORIZED

{"code":"unauthorized","message":"This endpoint requires at least one of the following scopes: identity.link-account"}

Conflict Request

Assume that Example Request was sent, and you received a Success Response. Now, you send a Conflict Request:

  1. A new user access token (<NEW_TOKEN>) is provided with the same thirdPartyUserID from Example Request. This will fail because the thirdPartyUserID is already linked to the user in Example Request.
  2. The same user access token (<TOKEN>) is provided with a different thirdPartyUserID from Example Request. This will fail because the user is already linked to the thirdPartyUserID from Example Request.
Conflict Response

Status-Code: 409 CONFLICT

{"code":"conflict","message":"this user has already been linked to another account"}

Uber

Developers
© 2023 Uber Technologies Inc.