v1

latestSwagger 2.0Apache 2.02026-07-1334102.9 MB
Users

Update a User's Settings

Updates a user's settings, including email subscriptions, two-factor authentication setup, and account deactivation status. Only the authenticated user can modify their settings.

Editable Attributes

  • two_factor_enabled (boolean): Enables or disables two-factor authentication.
  • two_factor_verification (integer): Verification code for two-factor setup.
  • subscribe_osf_general_email (boolean): Subscribe/unsubscribe from OSF general communications.
  • subscribe_osf_help_email (boolean): Subscribe/unsubscribe from OSF help communications.
  • deactivation_requested (boolean): Request deactivation of your OSF account.

Returns

Returns the updated user's settings in a JSON object with a data key.

Errors

If the request is unsuccessful, an errors key containing information about the failure will be returned. Refer to the list of error codes.

patch/users/{user_id}/settings/

Path parameters

user_idstring required

The unique identifier of the user. Example: abc123

Request body

Example request

{
  "data": {
    "type": "user-settings",
    "id": "abc123",
    "attributes": {
      "two_factor_enabled": true,
      "two_factor_verification": 123456,
      "subscribe_osf_general_email": true
    }
  }
}

Response

Successfully updated the user's settings.