feat: people management (#31620)

Co-authored-by: Jason Rasmussen <jason@rasm.me>
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
Daniel Dietzler
2026-09-28 21:29:15 +02:00
committed by GitHub
co-authored by Jason Rasmussen shenlong-tanwen
parent 0f179b9914
commit c12d5e6d35
67 changed files with 4812 additions and 582 deletions
+532 -1
View File
@@ -9717,7 +9717,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BulkIdsDto"
"$ref": "#/components/schemas/PeopleDeleteDto"
}
}
},
@@ -9786,6 +9786,24 @@
"type": "string"
}
},
{
"name": "isFavorite",
"required": false,
"in": "query",
"description": "Filter by favorite status",
"schema": {
"type": "boolean"
}
},
{
"name": "isHidden",
"required": false,
"in": "query",
"description": "Filter by hidden status",
"schema": {
"type": "boolean"
}
},
{
"name": "page",
"required": false,
@@ -9798,6 +9816,28 @@
"type": "integer"
}
},
{
"name": "sharedById",
"required": false,
"in": "query",
"description": "Only include people to which the user gave access",
"schema": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"type": "string"
}
},
{
"name": "sharedWithId",
"required": false,
"in": "query",
"description": "Only include people to which the user was given access",
"schema": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"type": "string"
}
},
{
"name": "size",
"required": false,
@@ -10043,6 +10083,197 @@
"x-immich-state": "Stable"
}
},
"/people/users": {
"delete": {
"description": "Remove user access to people",
"operationId": "removeUsersFromPeople",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PersonUsersDeleteDto"
}
}
},
"required": true
},
"responses": {
"200": {
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"summary": "Remove users from people",
"tags": [
"People"
],
"x-immich-history": [
{
"version": "v3.3",
"state": "Added"
},
{
"version": "v3.3",
"state": "Stable"
}
],
"x-immich-permission": "person.delete",
"x-immich-state": "Stable"
},
"get": {
"description": "Retrieve a list of users and the people to which they have been given access",
"operationId": "getUsersForPeople",
"parameters": [
{
"name": "direction",
"required": false,
"in": "query",
"schema": {
"$ref": "#/components/schemas/SharingDirection"
}
},
{
"name": "personId",
"required": false,
"in": "query",
"description": "Person ID",
"schema": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"type": "string"
}
},
{
"name": "role",
"required": false,
"in": "query",
"description": "Role of user",
"schema": {
"$ref": "#/components/schemas/PersonUserRole"
}
},
{
"name": "sharedById",
"required": false,
"in": "query",
"description": "User ID of the user that gave access",
"schema": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"type": "string"
}
},
{
"name": "sharedWithId",
"required": false,
"in": "query",
"description": "User ID of the user that was given access",
"schema": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PersonUsersResponseDto"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"summary": "Get people access",
"tags": [
"People"
],
"x-immich-history": [
{
"version": "v3.3",
"state": "Added"
},
{
"version": "v3.3",
"state": "Stable"
}
],
"x-immich-permission": "person.read",
"x-immich-state": "Stable"
},
"put": {
"description": "Give users access to people",
"operationId": "addUsersToPeople",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PersonUsersCreateDto"
}
}
},
"required": true
},
"responses": {
"200": {
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"summary": "Give users access to people",
"tags": [
"People"
],
"x-immich-history": [
{
"version": "v3.3",
"state": "Added"
},
{
"version": "v3.3",
"state": "Stable"
}
],
"x-immich-permission": "person.update",
"x-immich-state": "Stable"
}
},
"/people/{id}": {
"delete": {
"description": "Delete an individual person.",
@@ -10059,6 +10290,16 @@
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PersonDeleteDto"
}
}
},
"required": true
},
"responses": {
"204": {
"description": ""
@@ -20263,6 +20504,12 @@
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
"type": "string"
},
"userId": {
"description": "User ID",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
"type": "string"
},
"width": {
"description": "Face bounding box width",
"maximum": 9007199254740991,
@@ -20403,6 +20650,12 @@
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
"type": "string"
},
"userId": {
"description": "User ID",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
"type": "string"
}
},
"required": [
@@ -24650,6 +24903,32 @@
],
"type": "object"
},
"PeopleDeleteDto": {
"properties": {
"ids": {
"description": "IDs to process",
"items": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
"type": "string"
},
"type": "array"
},
"userId": {
"type": "string"
}
},
"required": [
"ids"
],
"type": "object",
"x-immich-history": [
{
"version": "v3.3",
"state": "Added"
}
]
},
"PeopleResponse": {
"properties": {
"enabled": {
@@ -24788,6 +25067,12 @@
"name": {
"description": "Person name",
"type": "string"
},
"userId": {
"description": "User ID",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"type": "string"
}
},
"required": [
@@ -24795,6 +25080,52 @@
],
"type": "object"
},
"PeopleUserResponseDto": {
"properties": {
"avatarColor": {
"$ref": "#/components/schemas/UserAvatarColor"
},
"email": {
"description": "User email",
"format": "email",
"pattern": "^[\\p{L}\\p{M}\\p{N}.!#$%&'*+/=?^_`{|}~-]+@[\\p{L}\\p{N}](?:[\\p{L}\\p{M}\\p{N}-]{0,61}[\\p{L}\\p{M}\\p{N}])?(?:\\.[\\p{L}\\p{N}](?:[\\p{L}\\p{M}\\p{N}-]{0,61}[\\p{L}\\p{M}\\p{N}])?)*$",
"type": "string"
},
"id": {
"description": "User ID",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
"type": "string"
},
"name": {
"description": "User name",
"type": "string"
},
"profileChangedAt": {
"description": "Profile change date",
"format": "date-time",
"type": "string"
},
"profileImagePath": {
"description": "Profile image path",
"type": "string"
},
"role": {
"$ref": "#/components/schemas/PersonUserRole",
"description": "Access role"
}
},
"required": [
"avatarColor",
"email",
"id",
"name",
"profileChangedAt",
"profileImagePath",
"role"
],
"type": "object"
},
"Permission": {
"description": "List of permissions",
"enum": [
@@ -24998,6 +25329,52 @@
},
"type": "object"
},
"PersonDeleteDto": {
"default": {},
"properties": {
"userId": {
"type": "string"
}
},
"type": "object",
"x-immich-history": [
{
"version": "v3.3",
"state": "Added"
},
{
"version": "v3.3",
"state": "Stable"
}
],
"x-immich-state": "Stable"
},
"PersonOtherResponseDto": {
"properties": {
"birthDate": {
"nullable": true,
"type": "string"
},
"name": {
"type": "string"
},
"role": {
"$ref": "#/components/schemas/PersonUserRole"
},
"sharedById": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"type": "string"
}
},
"required": [
"birthDate",
"name",
"role",
"sharedById"
],
"type": "object"
},
"PersonResponseDto": {
"properties": {
"birthDate": {
@@ -25050,6 +25427,26 @@
"description": "Person name",
"type": "string"
},
"otherPeople": {
"items": {
"$ref": "#/components/schemas/PersonOtherResponseDto"
},
"type": "array"
},
"sharedBy": {
"description": "Users that gave the current user access to this person",
"items": {
"$ref": "#/components/schemas/PeopleUserResponseDto"
},
"type": "array"
},
"sharedWith": {
"description": "Users the current user gave access to this person",
"items": {
"$ref": "#/components/schemas/PeopleUserResponseDto"
},
"type": "array"
},
"thumbnailPath": {
"description": "Thumbnail path",
"type": "string"
@@ -25076,6 +25473,9 @@
"id",
"isHidden",
"name",
"otherPeople",
"sharedBy",
"sharedWith",
"thumbnailPath"
],
"type": "object"
@@ -25125,10 +25525,133 @@
"name": {
"description": "Person name",
"type": "string"
},
"userId": {
"description": "User ID",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"type": "string"
}
},
"type": "object"
},
"PersonUserRole": {
"description": "Levels of access for managing people resources on behalf of another user.",
"enum": [
"read",
"write",
"admin"
],
"type": "string"
},
"PersonUsersCreateDto": {
"properties": {
"personIds": {
"description": "Person IDs",
"items": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"type": "string"
},
"type": "array"
},
"role": {
"$ref": "#/components/schemas/PersonUserRole",
"description": "Role that should be applied"
},
"sharedWithIds": {
"description": "User IDs that should be given access to the person",
"items": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"type": "string"
},
"type": "array"
}
},
"required": [
"personIds",
"role",
"sharedWithIds"
],
"type": "object"
},
"PersonUsersDeleteDto": {
"items": {
"properties": {
"personId": {
"description": "Person ID",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"type": "string"
},
"sharedById": {
"description": "User ID of the user that gave access to the person",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"type": "string"
},
"sharedWithId": {
"description": "User ID of the user that was given access to the person",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"type": "string"
}
},
"required": [
"personId",
"sharedWithId"
],
"type": "object"
},
"type": "array"
},
"PersonUsersResponseDto": {
"items": {
"properties": {
"personId": {
"description": "Person ID",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"type": "string"
},
"role": {
"$ref": "#/components/schemas/PersonUserRole",
"description": "Access role"
},
"sharedBy": {
"$ref": "#/components/schemas/UserResponseDto",
"description": "The user that gave access to this person"
},
"sharedById": {
"description": "User ID of the user that gave access to this person",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"type": "string"
},
"sharedWith": {
"$ref": "#/components/schemas/UserResponseDto",
"description": "The user that was given access to this person"
},
"sharedWithId": {
"description": "User ID of the user that was given access to this person",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"type": "string"
}
},
"required": [
"personId",
"sharedById",
"sharedWithId",
"sharedBy",
"sharedWith",
"role"
],
"type": "object"
},
"type": "array"
},
"PinCodeChangeDto": {
"properties": {
"newPinCode": {
@@ -27972,6 +28495,14 @@
},
"type": "object"
},
"SharingDirection": {
"description": "Sharing direction",
"enum": [
"shared-by",
"shared-with"
],
"type": "string"
},
"SignUpDto": {
"properties": {
"email": {