Password & two-step sign-in

Change your password; set up two-step sign-in (generate a secret, show it as a QR code, verify a code from the authenticator to switch it on); switch it off.

MethodPathSummary
GET/v1/user/2faIs two-step sign-in on?
POST/v1/user/2fa/disableSwitch off two-step sign-in
POST/v1/user/2fa/verifySwitch on two-step sign-in
POST/v1/user/2fa/generateStart setting up two-step sign-in
GET/user/2faIs two-step sign-in on? (legacy)
POST/user/2fa/generateStart setting up two-step sign-in (legacy)
POST/user/2fa/verifySwitch on two-step sign-in (legacy)
POST/user/2fa/disableSwitch off two-step sign-in (legacy)
POST/user/password/changeChange your password

#Is two-step sign-in on?

GET/v1/user/2fa
Address
https://<your-org>.brambleit.cloud/api/v1/user/2fa
Requires
Signed-in session, X-API-Key, or a Bramble app access token (Authorization: Bearer).

Response 200

FieldTypeDescription
totp_enabledany
Example response
JSON
{
  "totp_enabled": null,
  "…await mfaRequirement(u)": "…"
}

Errors

StatusMessage
404User not found

Example request

Bash
curl -X GET 'https://<your-org>.brambleit.cloud/api/v1/user/2fa' \
  -H "X-API-Key: $BRAMBLE_KEY"

#Switch off two-step sign-in

POST/v1/user/2fa/disable

Disable Two-Factor Authentication (2FA) for the authenticated user

Address
https://<your-org>.brambleit.cloud/api/v1/user/2fa/disable
Requires
Signed-in session, X-API-Key, or a Bramble app access token (Authorization: Bearer).

Response 200

FieldTypeDescription
messagestring
Example response
JSON
{
  "message": "Saved"
}

Errors

StatusMessage
404User not found
403Your organisation requires two-step sign-in (policy "…"), so it can't be turned off. Ask an administrator if you need help.

Example request

Bash
curl -X POST 'https://<your-org>.brambleit.cloud/api/v1/user/2fa/disable' \
  -H "X-API-Key: $BRAMBLE_KEY"

#Switch on two-step sign-in

POST/v1/user/2fa/verify

Verify a user's 2FA code and enable 2FA

Address
https://<your-org>.brambleit.cloud/api/v1/user/2fa/verify
Requires
Signed-in session, X-API-Key, or a Bramble app access token (Authorization: Bearer).

Request body JSON

NameTypeDescription
verify_code_inputrequiredanyThe 6-digit code from the authenticator app.

Response 200

FieldTypeDescription
messagestring
Example response
JSON
{
  "message": "Saved"
}

Errors

StatusMessage
400Verification code is required
400Invalid verification code
404User not found

Example request

Bash
curl -X POST 'https://<your-org>.brambleit.cloud/api/v1/user/2fa/verify' \
  -H "X-API-Key: $BRAMBLE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"verify_code_input":"…"}'

#Start setting up two-step sign-in

POST/v1/user/2fa/generate

Returns a new secret and a QR code to scan into an authenticator app. It isn't switched on until a code is verified.

Address
https://<your-org>.brambleit.cloud/api/v1/user/2fa/generate
Requires
Signed-in session, X-API-Key, or a Bramble app access token (Authorization: Bearer).

Response 200

FieldTypeDescription
twofaany
Example response
JSON
{
  "twofa": null
}

Errors

StatusMessage
404User not found

Example request

Bash
curl -X POST 'https://<your-org>.brambleit.cloud/api/v1/user/2fa/generate' \
  -H "X-API-Key: $BRAMBLE_KEY"

#Is two-step sign-in on? (legacy)

GET/user/2fa
Address
https://<your-org>.brambleit.cloud/api/user/2fa
Requires
Signed-in session, X-API-Key, or a Bramble app access token (Authorization: Bearer).

Response 200

FieldTypeDescription
resultany
Example response
JSON
{
  "result": null
}

Errors

StatusMessage
404User not found

Example request

Bash
curl -X GET 'https://<your-org>.brambleit.cloud/api/user/2fa' \
  -H "X-API-Key: $BRAMBLE_KEY"

#Start setting up two-step sign-in (legacy)

POST/user/2fa/generate
Address
https://<your-org>.brambleit.cloud/api/user/2fa/generate
Requires
Signed-in session, X-API-Key, or a Bramble app access token (Authorization: Bearer).

Response 200

FieldTypeDescription
twofaany
Example response
JSON
{
  "twofa": null
}

Errors

StatusMessage
404User not found

Example request

Bash
curl -X POST 'https://<your-org>.brambleit.cloud/api/user/2fa/generate' \
  -H "X-API-Key: $BRAMBLE_KEY"

#Switch on two-step sign-in (legacy)

POST/user/2fa/verify
Address
https://<your-org>.brambleit.cloud/api/user/2fa/verify
Requires
Signed-in session, X-API-Key, or a Bramble app access token (Authorization: Bearer).

Request body JSON

NameTypeDescription
verify_code_inputany

Response 200

FieldTypeDescription
messagestring
Example response
JSON
{
  "message": "Saved"
}

Errors

StatusMessage
404User not found
400Invalid Code

Example request

Bash
curl -X POST 'https://<your-org>.brambleit.cloud/api/user/2fa/verify' \
  -H "X-API-Key: $BRAMBLE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"verify_code_input":"…"}'

#Switch off two-step sign-in (legacy)

POST/user/2fa/disable
Address
https://<your-org>.brambleit.cloud/api/user/2fa/disable
Requires
Signed-in session, X-API-Key, or a Bramble app access token (Authorization: Bearer).

Response 200

FieldTypeDescription
messagestring
Example response
JSON
{
  "message": "Saved"
}

Errors

StatusMessage
404User not found

Example request

Bash
curl -X POST 'https://<your-org>.brambleit.cloud/api/user/2fa/disable' \
  -H "X-API-Key: $BRAMBLE_KEY"

#Change your password

POST/user/password/change
Address
https://<your-org>.brambleit.cloud/api/user/password/change
Requires
Signed-in session, X-API-Key, or a Bramble app access token (Authorization: Bearer).

Request body JSON

NameTypeDescription
totp_codeanyA code from your authenticator, if two-step sign-in is on.
current_passwordanyYour current password.
new_passwordanyThe new password.

Response 200

FieldTypeDescription
messagestring
Example response
JSON
{
  "message": "Saved"
}

Errors

StatusMessage
4002FA Verified
404User not found
404Password update failed
400Current password incorrect!
400Invalid TOTP Code!

Example request

Bash
curl -X POST 'https://<your-org>.brambleit.cloud/api/user/password/change' \
  -H "X-API-Key: $BRAMBLE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"totp_code":"…","current_password":"…","new_password":"…"}'