Skip to main content
Allows a logged-in user to update their own Nombre_Completo (display name). This is a self-service action — the server verifies that the sessionToken belongs to the userId being updated. A user cannot update another user’s profile through this endpoint. Endpoint: USERS service — https://script.google.com/macros/s/AKfycbxAqyEcAHetH6yN4qccGILL-L3IzMSPVuVJ1kpuO86GqfDXTKP8cHrrB7UkKN1r_0g5/exec Action: updateProfile
Only Nombre_Completo can be changed through this endpoint. To change a password, use changePassword. To change a role or manage other users, use updateUser.

Request

action
string
required
Must be "updateProfile".
payload.userId
number
required
The ID of the currently authenticated user updating their own profile.
payload.sessionToken
string
required
The active session token of the user. Must match the session owner for the given userId.
payload.updates
object
required
Object containing profile fields to update.

Response

status
string
required
"success" on success, "error" on failure.
message
string
"Perfil actualizado correctamente." on success.

Example

const USERS_ENDPOINT = 'https://script.google.com/macros/s/AKfycbxAqyEcAHetH6yN4qccGILL-L3IzMSPVuVJ1kpuO86GqfDXTKP8cHrrB7UkKN1r_0g5/exec';

const session = JSON.parse(localStorage.getItem('gpsepedia_session'));

const response = await fetch(USERS_ENDPOINT, {
  method: 'POST',
  headers: { 'Content-Type': 'text/plain' },
  body: JSON.stringify({
    action: 'updateProfile',
    payload: {
      userId: session.ID,
      sessionToken: session.SessionToken,
      updates: {
        Nombre_Completo: 'Carlos Mejía Vargas'
      }
    }
  }),
  redirect: 'follow'
});

const result = await response.json();
if (result.status === 'success') {
  console.log('Profile updated');
  // Update the stored session with the new display name
  const updatedSession = { ...session, Nombre_Completo: 'Carlos Mejía Vargas' };
  localStorage.setItem('gpsepedia_session', JSON.stringify(updatedSession));
}

Build docs developers (and LLMs) love