Change the signed-in user's attributes
Docs version v1 (main)Nauthera is pre-1.0, in a design-partner program
/v1/auth/account/profileApplies a merge patch (RFC 7396 §2) to the account's attributes: a member
sets its attribute, null, an empty string or an empty list removes it,
and an attribute the patch does not name is left as it is. Every member
must be one the user may change (user_access write), conform to its
declaration and leave every required attribute a value, or the whole
patch is refused as validation_error, one field error per attribute,
and nothing is written. A member equal to the stored value is never
refused and writes nothing. The write is serialized per account, so a
concurrent change of another attribute is kept.
Tokens already issued keep the claims they were issued with; the next token and UserInfo answer carry the new values.
- Cookiestring
The request Cookie header; the interactive login / pending-auth session cookie, and the browser marker a sign-in is recognized by, are read from it.
at most 16384 characters
- Originstring
Browser Origin, checked (with Sec-Fetch-Site) as a same-origin/CSRF guard.
at most 1024 characters
- Sec-Fetch-Sitestring
Fetch metadata; only same-origin is trusted (CSRF guard).
at most 32 characters
- Content-Typestring
Must be application/json — a JSON body cannot be a CORS simple request, closing form-based CSRF.
at most 256 characters
Request body
A merge patch of the signed-in user's attributes (RFC 7396 §2).
The attributes to change, by name: a value sets the attribute, and null, an empty string or an empty list removes it. Each must be one the user may change and conform to its declaration; an attribute not named here is left as it is.
No other properties are accepted.
200 OKapplication/jsonThe profile after the change.
The profile after the change.
Headers
Cache-Controlno-storeVaryCookie
Body
The signed-in user's account and the attributes the organization lets them read or change.
Each attribute declared with
user_accessread or write, in the order the declaration lists them.Each item:One attribute the user may read, and whether they may change it.
Show item attributesHide item attributes
One attribute an organization declares. A constraint applies only to the type it names, and is absent when not declared.
Show child attributesHide child attributes
The attribute's name: the key of its value in a user's
attributes.The type of a declared attribute's values: a string; a boolean; an integer within ±(2^53−1); a date, a full-date string (
YYYY-MM-DD); or an enum, a string that is one of its declared values.Possible values5 valuesstringbooleanintegerdateenum
What the user may do with a declared attribute's value on the account page and through the account API: nothing, read it, or read and change it. Who receives the value is the attribute's
scopes, not this.Possible values3 valuesnonereadwrite
Whether a value is a list of values of
type.Whether an administrator's create of a user without a value, or update removing the value, is refused.
Whether the name is one of the OpenID Connect standard claims the profile scope releases.
- application_writeboolean
Whether an attribute write grant may name the attribute, so a granted client may write it. It grants nothing by itself.
- access_tokenboolean
Whether a protected resource may select the attribute into the access tokens issued for it, under its
scopes. It releases nothing by itself. - labelsmap of strings
The attribute's name for a person, by BCP 47 language tag; absent when it has none.
- descriptionsmap of strings
What the attribute holds, for a person filling it in, by BCP 47 language tag; absent when it has none.
- min_lengthinteger
The fewest characters a string value holds.
- max_lengthinteger
The most characters a string value holds.
- patternstring
The RE2 regular expression a string value matches whole.
- minimuminteger · int64
The least an integer value may be.
- maximuminteger · int64
The most an integer value may be.
- earlieststring · date
The earliest a date value may be.
- lateststring · date
The latest a date value may be.
- min_itemsinteger
The fewest values a multi-valued attribute holds, when it has any.
- max_itemsinteger
The most values a multi-valued attribute holds.
- valuesarray of objects
The values an enum attribute may take, in the order forms show them.
Each item:One value an enum attribute may take, with its labels.
- scopesarray of strings
The scopes under which UserInfo releases the attribute; absent when it names none. A standard claim is released under profile whatever it declares.
- claimstring
The claim the attribute is released under; absent when it is the attribute's name.
No other properties are accepted.
Whether the user may change the value (
user_accesswrite).
No other properties are accepted.
The value of each attribute in
fieldsthat has one, by name, as its declaration reads it: a string, a boolean, an integer, a full-date string or a list of one of them. Nothing else the account holds is shown.- emailstring
The account's address; absent when it has none.
- email_verifiedboolean
429 Too Many Requestsapplication/problem+jsonToo many requests.
Too many requests.
Body
RFC 9457 (formerly RFC 7807) problem details (application/problem+json).
codeis a stable machine-readable slug for the problem kind (it mirrors the last path segment oftype), so consumers can branch on it without parsing prose.typeishttps://nauthera.io/problems/<code>, which resolves to the code's runbook: why it happened, who is affected and what to do (RFC 9457 §3.1.1). A problem without a code hasabout:blank.errorsis present on validation failures and lists every offending field.- Example
"Request validation failed" - Example
400 - typestring · uriExample
"https://nauthera.io/problems/validation_error" - detailstringExample
"One or more fields did not satisfy the API schema." - codeenum
The kind of problem, as a stable machine-readable slug a client branches on and translates rather than parsing
titleordetail, which are English prose for logs. A problem whose status says everything the server knows carries nocode.Show moreShow less
validation_erroris the one code whose message is not a sentence about the code itself: the request failed the schema, and the specifics are theerrorslist — one entry per offending field — which a form renders on those fields.requiredandmalformedare spelled like two of the per-field violation codes (FieldError.code) but mean something else; the two vocabularies are told apart by position, never by spelling.Compatibility: this is a CLOSED enum, with the same cost as
AuditAction: a client generated against an older version of this document rejects a problem carrying a code added after it was built. Regenerate on upgrade, or decode the field as a plain string. It is enumerated anyway so that what a client must translate is knowable from the contract alone.Possible values47 valuesinvalid_requestinvalid_credentialsforbiddenunauthorizedinsufficient_user_authenticationprotected_accountpassword_held_by_directorylast_role_administratorgroup_membership_managedinvalid_codetoo_many_requeststoo_many_attemptsaccount_lockedaccount_unavailablealready_enrolledregistration_disabledregistration_conflictterms_acceptance_requiredcaptcha_failedinvalid_reset_linkpassword_reusedpassword_too_shortpassword_too_longpassword_compromisedinvalid_verification_linkinvalid_invitation_linkmail_relay_missingemail_unverifiednot_foundconflictprecondition_failedunavailablebusywindow_too_largetoo_many_seriesinternal_errorrate_limitedmalformedbody_too_largeunsupported_media_typerequiredvalidation_errorunknown_orginvalid_tokeninvalid_dpop_proofuse_dpop_nonceserver_error
- instancestringExample
"/introspect" - request_idstringExample
"8d94ed49-1caf-4ab3-9594-557142f2d023" - trace_idstring
Distributed-trace id (hex) for correlating this response with traces and logs. Present only when tracing is enabled and the request was recorded. Opaque and safe to log/share.
Example"4bf92f3577b34da6a3ce929d0e0e4736" - errorsarray of objects
Field-level violations (present for validation errors).
Each item:A single field-level validation violation.
Show item attributesHide item attributes
Offending field, dotted for nested bodies (e.g. child.id).
Example"token_type_hint"The rule a field broke, as a stable machine-readable slug a client branches on and translates rather than parsing
message, which is English prose for logs.Show moreShow less
Compatibility: a CLOSED enum, with the cost
ProblemCodehas: a client generated against an older version of this document rejects a field error carrying a code added after it was built.Possible values14 valuesrequiredtoo_shorttoo_longpatterninvalid_formatnot_allowedminimummaximumtoo_fewtoo_manynot_uniquemalformedundeclaredread_only
- Example
"field token_type_hint must be one of [access_token, refresh_token]"
Errorapplication/problem+jsonProblem details (RFC 9457).
Problem details (RFC 9457).
Body
RFC 9457 (formerly RFC 7807) problem details (application/problem+json).
codeis a stable machine-readable slug for the problem kind (it mirrors the last path segment oftype), so consumers can branch on it without parsing prose.typeishttps://nauthera.io/problems/<code>, which resolves to the code's runbook: why it happened, who is affected and what to do (RFC 9457 §3.1.1). A problem without a code hasabout:blank.errorsis present on validation failures and lists every offending field.- Example
"Request validation failed" - Example
400 - typestring · uriExample
"https://nauthera.io/problems/validation_error" - detailstringExample
"One or more fields did not satisfy the API schema." - codeenum
The kind of problem, as a stable machine-readable slug a client branches on and translates rather than parsing
titleordetail, which are English prose for logs. A problem whose status says everything the server knows carries nocode.Show moreShow less
validation_erroris the one code whose message is not a sentence about the code itself: the request failed the schema, and the specifics are theerrorslist — one entry per offending field — which a form renders on those fields.requiredandmalformedare spelled like two of the per-field violation codes (FieldError.code) but mean something else; the two vocabularies are told apart by position, never by spelling.Compatibility: this is a CLOSED enum, with the same cost as
AuditAction: a client generated against an older version of this document rejects a problem carrying a code added after it was built. Regenerate on upgrade, or decode the field as a plain string. It is enumerated anyway so that what a client must translate is knowable from the contract alone.Possible values47 valuesinvalid_requestinvalid_credentialsforbiddenunauthorizedinsufficient_user_authenticationprotected_accountpassword_held_by_directorylast_role_administratorgroup_membership_managedinvalid_codetoo_many_requeststoo_many_attemptsaccount_lockedaccount_unavailablealready_enrolledregistration_disabledregistration_conflictterms_acceptance_requiredcaptcha_failedinvalid_reset_linkpassword_reusedpassword_too_shortpassword_too_longpassword_compromisedinvalid_verification_linkinvalid_invitation_linkmail_relay_missingemail_unverifiednot_foundconflictprecondition_failedunavailablebusywindow_too_largetoo_many_seriesinternal_errorrate_limitedmalformedbody_too_largeunsupported_media_typerequiredvalidation_errorunknown_orginvalid_tokeninvalid_dpop_proofuse_dpop_nonceserver_error
- instancestringExample
"/introspect" - request_idstringExample
"8d94ed49-1caf-4ab3-9594-557142f2d023" - trace_idstring
Distributed-trace id (hex) for correlating this response with traces and logs. Present only when tracing is enabled and the request was recorded. Opaque and safe to log/share.
Example"4bf92f3577b34da6a3ce929d0e0e4736" - errorsarray of objects
Field-level violations (present for validation errors).
Each item:A single field-level validation violation.
Show item attributesHide item attributes
Offending field, dotted for nested bodies (e.g. child.id).
Example"token_type_hint"The rule a field broke, as a stable machine-readable slug a client branches on and translates rather than parsing
message, which is English prose for logs.Show moreShow less
Compatibility: a CLOSED enum, with the cost
ProblemCodehas: a client generated against an older version of this document rejects a field error carrying a code added after it was built.Possible values14 valuesrequiredtoo_shorttoo_longpatterninvalid_formatnot_allowedminimummaximumtoo_fewtoo_manynot_uniquemalformedundeclaredread_only
- Example
"field token_type_hint must be one of [access_token, refresh_token]"