{
  "schemaVersion": 1,
  "operation": {
    "operationId": "updateCurrentPrincipal",
    "method": "PATCH",
    "path": "/api/v1/me",
    "summary": "Update the current principal's self-managed profile fields",
    "description": "",
    "tags": [
      "Current User"
    ],
    "effect": "write",
    "confirmation": "conditional",
    "parameters": [
      {
        "name": "If-Match",
        "in": "header",
        "required": true,
        "description": "",
        "schema": {
          "type": "string"
        }
      }
    ],
    "requestBody": {
      "required": true,
      "description": "",
      "content": [
        {
          "contentType": "application/json",
          "schema": {
            "$ref": "#/components/schemas/CurrentPrincipalPatchRequest"
          }
        }
      ]
    },
    "responses": [
      {
        "status": "200",
        "description": "The request has succeeded.",
        "content": [
          {
            "contentType": "application/json",
            "schema": {
              "$ref": "#/components/schemas/CurrentPrincipalResponse"
            }
          }
        ]
      },
      {
        "status": "400",
        "description": "The server could not understand the request due to invalid syntax.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "401",
        "description": "Access is unauthorized.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "403",
        "description": "Access is forbidden.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "404",
        "description": "The server cannot find the requested resource.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "409",
        "description": "The request conflicts with the current state of the server.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "412",
        "description": "Precondition failed.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "413",
        "description": "Client error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "415",
        "description": "Client error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "422",
        "description": "Client error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "429",
        "description": "Client error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "500",
        "description": "Server error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "502",
        "description": "Server error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "503",
        "description": "Service unavailable.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      }
    ]
  },
  "schemas": {
    "AvatarResponse": {
      "example": {
        "height": 1,
        "mediaType": "example",
        "principalId": "example",
        "sha256": "example",
        "sizeBytes": 1,
        "updatedAt": "2026-01-02T15:04:05Z",
        "url": "example",
        "width": 1
      },
      "properties": {
        "height": {
          "example": 1,
          "format": "int32",
          "type": "integer"
        },
        "mediaType": {
          "enum": [
            "image/png"
          ],
          "example": "example",
          "type": "string"
        },
        "principalId": {
          "example": "example",
          "type": "string"
        },
        "sha256": {
          "example": "example",
          "type": "string"
        },
        "sizeBytes": {
          "example": 1,
          "format": "int64",
          "type": "integer"
        },
        "updatedAt": {
          "example": "2026-01-02T15:04:05Z",
          "format": "date-time",
          "type": "string"
        },
        "url": {
          "example": "example",
          "type": "string"
        },
        "width": {
          "example": 1,
          "format": "int32",
          "type": "integer"
        }
      },
      "required": [
        "principalId",
        "sha256",
        "mediaType",
        "sizeBytes",
        "width",
        "height",
        "updatedAt",
        "url"
      ],
      "type": "object"
    },
    "CurrentPrincipalCapabilities": {
      "example": {
        "canChangePassword": true,
        "canManageApiTokens": true,
        "canManageAuthoringSessions": true,
        "canManageAvatar": true,
        "canManageSessions": true,
        "canUpdateDisplayName": true
      },
      "properties": {
        "canChangePassword": {
          "example": true,
          "type": "boolean"
        },
        "canManageApiTokens": {
          "example": true,
          "type": "boolean"
        },
        "canManageAuthoringSessions": {
          "example": true,
          "type": "boolean"
        },
        "canManageAvatar": {
          "example": true,
          "type": "boolean"
        },
        "canManageSessions": {
          "example": true,
          "type": "boolean"
        },
        "canUpdateDisplayName": {
          "example": true,
          "type": "boolean"
        }
      },
      "required": [
        "canUpdateDisplayName",
        "canChangePassword",
        "canManageAvatar",
        "canManageSessions",
        "canManageAuthoringSessions",
        "canManageApiTokens"
      ],
      "type": "object"
    },
    "CurrentPrincipalPatchRequest": {
      "example": {
        "displayName": "example"
      },
      "properties": {
        "displayName": {
          "example": "example",
          "type": "string"
        }
      },
      "type": "object"
    },
    "CurrentPrincipalResponse": {
      "example": {
        "avatar": {
          "height": 1,
          "mediaType": "example",
          "principalId": "example",
          "sha256": "example",
          "sizeBytes": 1,
          "updatedAt": "2026-01-02T15:04:05Z",
          "url": "example",
          "width": 1
        },
        "blockedAt": "2026-01-02T15:04:05Z",
        "capabilities": {
          "canChangePassword": true,
          "canManageApiTokens": true,
          "canManageAuthoringSessions": true,
          "canManageAvatar": true,
          "canManageSessions": true,
          "canUpdateDisplayName": true
        },
        "createdAt": "2026-01-02T15:04:05Z",
        "disabledAt": "2026-01-02T15:04:05Z",
        "displayName": "example",
        "email": "example",
        "id": "example",
        "identityManagement": {
          "provider": "example",
          "source": "local"
        },
        "kind": "example",
        "updatedAt": "2026-01-02T15:04:05Z"
      },
      "properties": {
        "avatar": {
          "$ref": "#/components/schemas/AvatarResponse"
        },
        "blockedAt": {
          "description": "LeapView administrator block. This is independent from externally managed lifecycle state.",
          "example": "2026-01-02T15:04:05Z",
          "format": "date-time",
          "type": "string"
        },
        "capabilities": {
          "$ref": "#/components/schemas/CurrentPrincipalCapabilities"
        },
        "createdAt": {
          "example": "2026-01-02T15:04:05Z",
          "format": "date-time",
          "type": "string"
        },
        "disabledAt": {
          "description": "Lifecycle disable owned by the identity provisioning authority, such as SCIM active=false.",
          "example": "2026-01-02T15:04:05Z",
          "format": "date-time",
          "type": "string"
        },
        "displayName": {
          "example": "example",
          "type": "string"
        },
        "email": {
          "example": "example",
          "type": "string"
        },
        "id": {
          "example": "example",
          "type": "string"
        },
        "identityManagement": {
          "$ref": "#/components/schemas/IdentityManagementResponse"
        },
        "kind": {
          "example": "example",
          "type": "string"
        },
        "updatedAt": {
          "example": "2026-01-02T15:04:05Z",
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "id",
        "kind",
        "email",
        "displayName",
        "createdAt",
        "updatedAt",
        "identityManagement",
        "capabilities"
      ],
      "type": "object"
    },
    "IdentityManagementResponse": {
      "example": {
        "provider": "example",
        "source": "local"
      },
      "properties": {
        "provider": {
          "example": "example",
          "type": "string"
        },
        "source": {
          "$ref": "#/components/schemas/IdentityManagementSource"
        }
      },
      "required": [
        "source"
      ],
      "type": "object"
    },
    "IdentityManagementSource": {
      "enum": [
        "local",
        "external",
        "system"
      ],
      "example": "local",
      "type": "string"
    },
    "ProblemDetails": {
      "example": {
        "code": "example",
        "detail": "example",
        "errors": [
          {
            "code": "example",
            "detail": "example",
            "field": "example"
          }
        ],
        "instance": "example",
        "requestId": "example",
        "status": 1,
        "title": "example",
        "type": "example"
      },
      "properties": {
        "code": {
          "example": "example",
          "type": "string"
        },
        "detail": {
          "example": "example",
          "type": "string"
        },
        "errors": {
          "example": [
            {
              "code": "example",
              "detail": "example",
              "field": "example"
            }
          ],
          "items": {
            "$ref": "#/components/schemas/ProblemFieldError"
          },
          "type": "array"
        },
        "instance": {
          "example": "example",
          "type": "string"
        },
        "requestId": {
          "example": "example",
          "type": "string"
        },
        "status": {
          "example": 1,
          "format": "int32",
          "type": "integer"
        },
        "title": {
          "example": "example",
          "type": "string"
        },
        "type": {
          "example": "example",
          "type": "string"
        }
      },
      "required": [
        "type",
        "title",
        "status",
        "detail",
        "instance",
        "code",
        "requestId",
        "errors"
      ],
      "type": "object"
    },
    "ProblemFieldError": {
      "example": {
        "code": "example",
        "detail": "example",
        "field": "example"
      },
      "properties": {
        "code": {
          "example": "example",
          "type": "string"
        },
        "detail": {
          "example": "example",
          "type": "string"
        },
        "field": {
          "example": "example",
          "type": "string"
        }
      },
      "required": [
        "field",
        "code",
        "detail"
      ],
      "type": "object"
    }
  }
}
