# Update a Person. - This endpoint enables the update of a Person resource. - The endpoint requires the personio:persons:write scope. # OpenAPI definition ```json { "openapi": "3.0.3", "info": { "title": "Person", "version": "2.0.1", "description": "This is a set of REST endpoints for writing Person & Employment entities." }, "servers": [ { "url": "https://api.personio.de" } ], "security": [ { "BearerAuth": [] } ], "paths": { "/v2/persons/{person_id}": { "patch": { "summary": "Update a Person.", "description": "- This endpoint enables the update of a Person resource.\n- The endpoint requires the personio:persons:write scope.\n", "tags": [ "Persons" ], "parameters": [ { "$ref": "#/components/parameters/PersonId" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Person" }, "examples": { "Update Person": { "$ref": "#/components/examples/ValidUpdatePerson" } } } } }, "responses": { "204": { "description": "Person updated successfully.", "x-response-example": "Update Person" }, "400": { "$ref": "#/components/responses/InvalidRequest" }, "404": { "$ref": "#/components/responses/ResourceNotFound" } }, "x-path-examples": { "Update Person": { "value": "/v2/persons/12345" } } } } }, "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer" } }, "schemas": { "Person": { "type": "object", "description": "The Person model.", "properties": { "email": { "type": "string", "format": "email", "description": "Email of the employee. The email must be unique : 2+ employees cannot have the same email.", "nullable": false }, "first_name": { "type": "string", "description": "First name of the employee.", "nullable": false }, "preferred_name": { "type": "string", "description": "The preferred name of the employee, if relevant.", "nullable": false }, "last_name": { "type": "string", "description": "Last name of the employee.", "nullable": false }, "gender": { "type": "string", "enum": [ "MALE", "FEMALE", "DIVERSE", "UNKNOWN", "UNDEFINED" ], "description": "Gender of the employee.", "nullable": true }, "language_code": { "type": "string", "enum": [ "en", "de", "es", "fr", "nl", "it", "sv", "fi" ], "description": "Main language of the employee.", "nullable": false }, "custom_attributes": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "The ID for the attribute.", "nullable": false }, "value": { "oneOf": [ { "type": "string", "description": "An arbitrary value that can be represented as a string.", "example": "Munich Center" }, { "type": "array", "items": { "type": "string" }, "description": "An array of arbitrary values that can be represented as a string.", "example": [ "Munich center", "Munich train station" ] } ], "nullable": false } } }, "description": "List of custom attributes for the employee." } } } }, "responses": { "InvalidRequest": { "description": "Invalid input data.", "content": { "application/problem+json": { "schema": { "type": "object", "description": "This object represents an error response.", "properties": { "personio_trace_id": { "type": "string", "example": "aswo3f-a202lfso-312123sld-1230ddd", "description": "A unique ID that was created for this error." }, "timestamp": { "type": "string", "format": "date-time", "example": "2021-05-28T11:17:30.000Z", "description": "The timestamp of when the error occurred." }, "errors": { "type": "array", "items": { "type": "object", "properties": { "title": { "type": "string", "example": "Not found", "description": "The title of the error." }, "detail": { "type": "string", "example": "The requested resource was not found.", "description": "A short description about the error." }, "type": { "type": "string", "format": "uri", "example": "https://developer.personio.de/reference/errors#common.requested_resource_not_found", "description": "A link to the developer hub where more information can be found for the encountered error." }, "_meta": { "type": "object", "additionalProperties": { "type": "string" } } } } } } }, "examples": { "Invalid parameter": { "$ref": "#/components/examples/InvalidParameter" } } } } }, "ResourceNotFound": { "description": "Resource not found.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/responses/InvalidRequest/content/application~1problem%2Bjson/schema" }, "examples": { "Invalid parameter": { "$ref": "#/components/examples/ResourceNotFound" } } } } } }, "parameters": { "PersonId": { "name": "person_id", "in": "path", "description": "The ID of the target Person.", "example": "5678", "required": true, "schema": { "type": "string" } } }, "examples": { "ValidUpdatePerson": { "value": { "email": "john.smith@company.com", "first_name": "John", "preferred_name": "Dr. Smith", "last_name": "Smith", "gender": "MALE", "language_code": "de", "custom_attributes": [ { "id": "laptop_serial_number", "value": "123-456" }, { "id": "customer_offices", "value": [ "Munich center", "Munich train station" ] } ] } }, "InvalidParameter": { "value": { "personio_trace_id": "aswo3f-a202lfso-312123sld-1230ddd", "timestamp": "2021-05-28T11:17:30+00:00", "errors": [ { "title": "Bad request", "detail": "Provided request parameters are invalid.", "type": "https://developer.personio.de/reference/errors#common.bad_request" } ] } }, "ResourceNotFound": { "value": { "personio_trace_id": "aswo3f-a202lfso-312123sld-1230ddd", "timestamp": "2021-05-28T11:17:30+00:00", "errors": [ { "title": "Resource not found", "detail": "No resource was found for the specified id.", "type": "https://developer.personio.de/reference/errors#common.resource_not_found" } ] } } } } } ```