---
title: "Update Account Login"
method: PATCH
path: "/v2/ap-portals/accounts/{account_id}"
tags: ["ap-portals"]
---

# Update Account Login

`PATCH /v2/ap-portals/accounts/{account_id}`

## Request

- Base URL: `https://api.stuut.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.stuut.ai/v2/ap-portals/accounts/{account_id}`
- Auth: HTTP bearer

Update login

Rotate an AP-portal login's credentials (password, header token, TOTP secret) or scope.
Only the fields you supply change; a supplied password clears a prior lock so sweeps
resume. Credentials are encrypted at rest and never returned.

## Path parameters

- `account_id` string, required

## Request body

- UpdateLoginRequest: Rotate credentials on an existing AP-portal login. Every field is optional; only the ones supplied are changed. A supplied password clears a prior LOCKED so sweeps resume. Credentials are encrypted at rest and never returned.
  - `username` string, nullable
  - `password` string, nullable
  - `header_token` string, nullable
  - `totp_secret` string, nullable: Base32 TOTP seed for authenticator-app MFA; the sweep mints the one-time code at login. Write-only.
  - `scope` APPortalScope[], nullable: Replace the swept document kinds. Omit to leave unchanged; must be non-empty when supplied.
  - `login_url` string, nullable: The login's own sign-in page when it differs from the provider's default, such as https://go.servicetitan.com/ for a ServiceTitan user outside Enterprise Hub.

## Response `200`

Successful Response

- APPortalLoginItem: An AP-portal login. Credentials (password / header token / TOTP secret) are write-only and never surfaced here.
  - `id` string, required
  - `provider` 'kehe' | 'taulia' | 'coupa' | 'ariba' | 'meijer' | 'kroger' | 'walgreens' | 'albertsons' | 'target' | 'heb' | 'heb_sidm' | 'c_and_s' | 'walmart' | 'walmart_highradius' | 'cvs' | 'cvs_sap' | 'cvs_image_silo' | 'kroger_supplier_connect' | 'kroger_claimtrax' | 'kroger_verigon' | 'servicetitan' | 'sandbox' | 'generic', required: Supported AP Portal providers.
  - `username` string, nullable, required
  - `status` 'active' | 'locked' | 'awaiting_auth' | 'password_expiring' | 'password_expired' | 'connecting', required: Status of an AP portal account (the login/credential).
  - `scope` APPortalScope[], required
  - `login_url` string, nullable, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/stuut/apis/stuut-api.md) - [All operations](https://skmtc.dev/stuut/apis/stuut-api/llms.txt) - [OpenAPI document](https://skmtc.dev/stuut/apis/stuut-api/revisions/ff0ad16a55ff?raw)
