Skip to main content

Update Partner Login

This request updates a partner login, targeted by secure ID.

patch /oauth/logins/{login_sid}
put /oauth/logins/{login_sid}

Sample​

A sample PATCH request to update the Partner Login object, targeted by secure ID, with the values in the request body:

curl -X PATCH \
'https://api.carrierx.com/core/v2/oauth/logins/abcf6b1f-7281-4da9-a4d6-3fb53e3a76de' \
-H 'Content-Type: application/json' \
--data-binary '{"password":"myNewStrongPassword"}' \
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'

Response​

200 status code with a serialized copy of the updated Partner Login object:

{
"email": "[email protected]",
"login": "carrierx_partner",
"login_sid": "abcf6b1f-7281-4da9-a4d6-3fb53e3a76de",
"partner_sid": "edebf627-ebce-4f77-8160-75db76154168",
"token_scopes": [
"partners.read",
"partners.update"
]
}

A sample PATCH request to attach an MFA configuration to the login:

curl -X PATCH \
'https://api.carrierx.com/core/v2/oauth/logins/abcf6b1f-7281-4da9-a4d6-3fb53e3a76de' \
-H 'Content-Type: application/json' \
--data-binary '{"mfa":{"method":"email","email":"[email protected]"}}' \
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'
{
"login": "carrierx_partner",
"login_sid": "abcf6b1f-7281-4da9-a4d6-3fb53e3a76de",
"mfa": {
"method": "email",
"email": "[email protected]"
},
"partner_sid": "edebf627-ebce-4f77-8160-75db76154168",
"token_scopes": [
"partners.read",
"partners.update"
]
}

A Partner Login object can be updated using either a PATCH or PUT request.

  • A PATCH request can be used to update one or more attribute values. When using a PATCH request, only the attributes specified in the request payload will be updated, all other attributes and values will remain the same. The partner login secure ID is passed in the query URL, and the values to be modified are passed in the request body.

  • A PUT request can be used to update an entire Partner Login object. The partner login secure ID is passed in the query URL, and the entire Partner Login object is passed in the request body.

note

Note, while all the fields must be present in a PUT request, not all the attribute values may be modified after the initial creation, because when created, some of them become read-only.

Required Scopes​

To update a Partner Login object, the partner must have one of the following scopes enabled:

  • oauth.logins.manage_all_logins
  • oauth.logins.manage
  • oauth.logins.update

If the token has oauth.logins.manage or oauth.logins.update, but not oauth.logins.manage_all_logins:

  • Only the login that the token was issued to can be updated. For any other login, the request returns a 404 error.
  • The login can change its own password, but not its own role or token_scopes. If it tries, the request returns a 422 error.
  • Use PATCH to update the login. PUT replaces all fields, so a PUT request without token_scopes is treated as a change of token_scopes and returns a 422 error.

Path Arguments​

ParameterData TypeDescription
login_sid requiredstringThe partner login secure ID.

Body Arguments​

JSON representation of the fields and values to be updated.

Fields that can be modified are:

  • email
  • mfa
  • password

email is validated only when present in the request. Setting it to an empty string clears the value; an invalid value returns a 422 error ({"field": "email", "message": "wrong value"}).

To remove MFA from a login, send {"mfa": null} in a full PUT request, or include {"mfa": null} in a PATCH request.

note

When the role or token_scopes of a sub-login changes, its tokens are affected as follows:

  • Scopes that the sub-login no longer has stop working within about 15 seconds, also for tokens that already exist.
  • New scopes are not added to existing tokens or to refreshed tokens. To use the new scopes, get a new token with the password grant type.

Refer to this table to view all fields that appear in the Partner Login object.