Update profile

PATCH /api/my-account

Update profile for the user, only the fields that are passed in will be updated.

application/json

Body Required

  • name string | null

    The new name for the user.

  • avatar string(url) | null

    The new avatar for the user, must be a URL.

  • username string(regex) | null

    The new username for the user, must be a valid username and unique.

    Format should match the following pattern: /^[A-Z_a-z]\w*$/.

Responses

  • 200 application/json

    The profile was updated successfully.

    Hide response attributes Show response attributes object
    • id string

      Minimum length is 1, maximum length is 12.

    • username string | null

      Maximum length is 128.

    • primaryEmail string | null

      Maximum length is 128.

    • primaryPhone string | null

      Maximum length is 128.

    • name string | null

      Maximum length is 128.

    • avatar string | null

      Maximum length is 2048.

    • customData object

      arbitrary

    • identities object
      Hide identities attribute Show identities attribute object
      • * object Additional properties
        Hide * attributes Show * attributes object
        • userId string Required
        • details object

          arbitrary

    • lastSignInAt number | null
    • createdAt number
    • updatedAt number
    • profile object
      Hide profile attributes Show profile attributes object
      • familyName string
      • givenName string
      • middleName string
      • nickname string
      • preferredUsername string
      • profile string
      • website string
      • gender string
      • birthdate string
      • zoneinfo string
      • locale string
      • address object
        Hide address attributes Show address attributes object
        • formatted string
        • streetAddress string
        • locality string
        • region string
        • postalCode string
        • country string
    • applicationId string | null

      Maximum length is 21.

    • isSuspended boolean
    • hasPassword boolean
    • ssoIdentities array[object]
      Hide ssoIdentities attributes Show ssoIdentities attributes object
      • tenantId string Required

        Maximum length is 21.

      • id string Required

        Minimum length is 1, maximum length is 21.

      • userId string Required

        Minimum length is 1, maximum length is 12.

      • issuer string Required

        Minimum length is 1, maximum length is 256.

      • identityId string Required

        Minimum length is 1, maximum length is 128.

      • detail object Required

        arbitrary

      • createdAt number Required
      • updatedAt number Required
      • ssoConnectorId string Required

        Minimum length is 1, maximum length is 128.

  • 400

    The request body is invalid.

  • 401

    Unauthorized

  • 403

    Forbidden

  • 422

    The username is already in use.

PATCH /api/my-account
curl \
 --request PATCH 'https://[tenant_id].logto.app/api/my-account' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"name":"string","avatar":"string","username":"string"}'
Request examples
{
  "name": "string",
  "avatar": "string",
  "username": "string"
}
Response examples (200)
{
  "id": "string",
  "username": "string",
  "primaryEmail": "string",
  "primaryPhone": "string",
  "name": "string",
  "avatar": "string",
  "customData": {},
  "identities": {
    "additionalProperty1": {
      "userId": "string",
      "details": {}
    },
    "additionalProperty2": {
      "userId": "string",
      "details": {}
    }
  },
  "lastSignInAt": 42.0,
  "createdAt": 42.0,
  "updatedAt": 42.0,
  "profile": {
    "familyName": "string",
    "givenName": "string",
    "middleName": "string",
    "nickname": "string",
    "preferredUsername": "string",
    "profile": "string",
    "website": "string",
    "gender": "string",
    "birthdate": "string",
    "zoneinfo": "string",
    "locale": "string",
    "address": {
      "formatted": "string",
      "streetAddress": "string",
      "locality": "string",
      "region": "string",
      "postalCode": "string",
      "country": "string"
    }
  },
  "applicationId": "string",
  "isSuspended": true,
  "hasPassword": true,
  "ssoIdentities": [
    {
      "tenantId": "string",
      "id": "string",
      "userId": "string",
      "issuer": "string",
      "identityId": "string",
      "detail": {},
      "createdAt": 42.0,
      "updatedAt": 42.0,
      "ssoConnectorId": "string"
    }
  ]
}