Update ({collection.name})

Update a single {collection.name} record.

Body parameters could be sent as application/json or multipart/form-data.

File upload is supported only via multipart/form-data.
For more info and examples you could check the detailed Files upload and handling docs .

{#if isAuth}

Note that in case of a password change all previously issued tokens for the current record will be automatically invalidated and if you want your user to remain signed in you need to reauthenticate manually after the update call.

{/if}
${JSON.stringify(getPayload(collection), null, 2)}; final record = await pb.collection('${collection?.name}').update('RECORD_ID', body: body); `} />
API details
PATCH

/api/collections/{collection.name}/records/:id

{#if superusersOnly}

Requires superuser Authorization:TOKEN header

{/if}
Path parameters
Param Type Description
id String ID of the record to update.
Body Parameters
{#if isAuth} {/if} {#each tableFields as field (field.name)} {/each}
Param Type Description
Auth specific fields
Optional email
String The auth record email address.
This field can be updated only by superusers or auth records with "Manage" access.
Regular accounts can update their email by calling "Request email change".
{#if collection?.fields?.find((f) => f.name == "emailVisibility")?.required} Required {:else} Optional {/if} emailVisibility
Boolean Whether to show/hide the auth record email when fetching the record data.
Optional oldPassword
String Old auth record password.
This field is required only when changing the record password. Superusers and auth records with "Manage" access can skip this field.
Optional password
String New auth record password.
Optional passwordConfirm
String New auth record password confirmation.
Optional verified
Boolean Indicates whether the auth record is verified or not.
This field can be set only by superusers or auth records with "Manage" access.
Other fields
{#if field.required} Required {:else} Optional {/if} {field.name}
{CommonHelper.getFieldValueType(field)} {#if field.type === "text"} Plain text value. {:else if field.type === "number"} Number value. {:else if field.type === "json"} JSON array or object. {:else if field.type === "email"} Email address. {:else if field.type === "url"} URL address. {:else if field.type === "geoPoint"} {`{"lon":x,"lat":y}`} object. {:else if field.type === "file"} File object.
Set to null to delete already uploaded file(s). {:else if field.type === "relation"} Relation record {field.maxSelect == 1 ? "id" : "ids"}. {/if}
Query parameters
Param Type Description
expand String Auto expand relations when returning the updated record. Ex.: Supports up to 6-levels depth nested relations expansion.
The expanded relations will be appended to the record under the expand property (eg. {`"expand": {"relField1": {...}, ...}`}). Only the relations that the user has permissions to view will be expanded.
Responses
{#each responses as response (response.code)} {/each}
{#each responses as response (response.code)}
{/each}