{
	"openapi": "3.1.1",
	"info": {
		"title": "TWIN - Test Endpoints",
		"description": "REST API for TWIN - Test Endpoints.",
		"version": "1.0.0",
		"license": {
			"name": "Apache 2.0 License",
			"url": "https://opensource.org/licenses/Apache-2.0"
		}
	},
	"servers": [
		{
			"url": "https://localhost"
		}
	],
	"tags": [
		{
			"name": "Authentication",
			"description": "Authentication endpoints for the REST server."
		},
		{
			"name": "Authentication Admin",
			"description": "Authentication Admin endpoints for the REST server."
		},
		{
			"name": "Authentication Audit",
			"description": "Authentication audit endpoints for the REST server."
		}
	],
	"paths": {
		"/authentication/login": {
			"post": {
				"operationId": "authenticationLogin",
				"summary": "Login to the server",
				"tags": [
					"Authentication"
				],
				"requestBody": {
					"description": "Perform a login on the server.",
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/LoginRequest"
							},
							"examples": {
								"loginRequestExample": {
									"summary": "The request to login to the server.",
									"value": {
										"email": "user@example.com",
										"password": "MyPassword123!"
									}
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "Response from a login on the server.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/LoginResponse"
								},
								"examples": {
									"loginResponseExample": {
										"summary": "The response for the login request.",
										"value": {
											"expiry": 1722514341067
										}
									}
								}
							}
						}
					},
					"400": {
						"description": "The server cannot process the request, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "GeneralError",
											"message": "errorMessage",
											"properties": {
												"foo": "bar"
											}
										}
									}
								}
							}
						}
					},
					"401": {
						"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "UnauthorizedError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					},
					"500": {
						"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "InternalServerError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					}
				}
			}
		},
		"/authentication/logout": {
			"post": {
				"operationId": "authenticationLogout",
				"summary": "Logout from the server",
				"tags": [
					"Authentication"
				],
				"security": [
					{
						"jwtBearerAuthScheme": []
					}
				],
				"requestBody": {
					"description": "Perform a logout on the auth token.",
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/LogoutRequest"
							},
							"examples": {
								"logoutRequestExample": {
									"summary": "The request to logout from the server.",
									"value": {
										"token": "eyJhbGciOiJIU...sw5c"
									}
								}
							}
						}
					}
				},
				"responses": {
					"204": {
						"description": "The rest request ended in success with no data."
					},
					"400": {
						"description": "The server cannot process the request, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "GeneralError",
											"message": "errorMessage",
											"properties": {
												"foo": "bar"
											}
										}
									}
								}
							}
						}
					},
					"401": {
						"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "UnauthorizedError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					},
					"500": {
						"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "InternalServerError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					}
				}
			}
		},
		"/authentication/refresh": {
			"post": {
				"operationId": "authenticationRefreshToken",
				"summary": "Refresh an authentication token",
				"tags": [
					"Authentication"
				],
				"security": [
					{
						"jwtBearerAuthScheme": []
					}
				],
				"requestBody": {
					"description": "Perform a refresh of the auth token.",
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/RefreshTokenRequest"
							},
							"examples": {
								"refreshTokenRequestExample": {
									"summary": "The request to refresh an auth token.",
									"value": {
										"token": "eyJhbGciOiJIU...sw5c"
									}
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "Response from a refresh on the auth token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/RefreshTokenResponse"
								},
								"examples": {
									"refreshTokenResponseExample": {
										"summary": "The response for the refresh token request.",
										"value": {
											"expiry": 1722514341067
										}
									}
								}
							}
						}
					},
					"400": {
						"description": "The server cannot process the request, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "GeneralError",
											"message": "errorMessage",
											"properties": {
												"foo": "bar"
											}
										}
									}
								}
							}
						}
					},
					"401": {
						"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "UnauthorizedError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					},
					"500": {
						"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "InternalServerError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					}
				}
			}
		},
		"/authentication/password": {
			"put": {
				"operationId": "authenticationUpdatePassword",
				"summary": "Update the current user's password",
				"tags": [
					"Authentication"
				],
				"security": [
					{
						"jwtBearerAuthScheme": []
					}
				],
				"requestBody": {
					"description": "Update the current user's password.",
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/UpdatePasswordRequest"
							},
							"examples": {
								"updatePasswordRequestExample": {
									"summary": "The request to update the current user's password.",
									"value": {
										"currentPassword": "MyNewPassword123!",
										"newPassword": "MyNewPassword123!"
									}
								}
							}
						}
					}
				},
				"responses": {
					"204": {
						"description": "The rest request ended in success with no data."
					},
					"400": {
						"description": "The server cannot process the request, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "GeneralError",
											"message": "errorMessage",
											"properties": {
												"foo": "bar"
											}
										}
									}
								}
							}
						}
					},
					"401": {
						"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "UnauthorizedError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					},
					"500": {
						"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "InternalServerError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					}
				}
			}
		},
		"/authentication/admin/users": {
			"post": {
				"operationId": "authenticationAdminCreateUser",
				"summary": "Create a new user",
				"tags": [
					"Authentication Admin"
				],
				"security": [
					{
						"jwtBearerAuthScheme": []
					}
				],
				"requestBody": {
					"description": "Create a new user as an admin.",
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/AdminUserCreateRequest"
							},
							"examples": {
								"createUserRequestExample": {
									"summary": "The request to create a new user.",
									"value": {
										"email": "user@example.com",
										"password": "MyPassword123!",
										"userIdentity": "did:example:123456789abcdefghi",
										"organizationIdentity": "did:example:123456789abcdefghi",
										"scope": [
											"scope1",
											"scope2"
										]
									}
								}
							}
						}
					}
				},
				"responses": {
					"204": {
						"description": "The rest request ended in success with no data."
					},
					"400": {
						"description": "The server cannot process the request, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "GeneralError",
											"message": "errorMessage",
											"properties": {
												"foo": "bar"
											}
										}
									}
								}
							}
						}
					},
					"401": {
						"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "UnauthorizedError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					},
					"500": {
						"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "InternalServerError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					}
				}
			}
		},
		"/authentication/admin/users/{email}": {
			"put": {
				"operationId": "authenticationAdminUpdateUser",
				"summary": "Update an existing user",
				"tags": [
					"Authentication Admin"
				],
				"parameters": [
					{
						"name": "email",
						"description": "The user email.",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string"
						},
						"style": "simple",
						"example": "user@example.com"
					}
				],
				"security": [
					{
						"jwtBearerAuthScheme": []
					}
				],
				"requestBody": {
					"description": "Update a user as an admin.",
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/AdminUserUpdateRequest"
							},
							"examples": {
								"updateUserRequestExample": {
									"summary": "The request to update an existing user.",
									"value": {
										"userIdentity": "did:example:123456789abcdefghi",
										"organizationIdentity": "did:example:123456789abcdefghi",
										"scope": [
											"scope1",
											"scope2"
										]
									}
								}
							}
						}
					}
				},
				"responses": {
					"204": {
						"description": "The rest request ended in success with no data."
					},
					"400": {
						"description": "The server cannot process the request, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "GeneralError",
											"message": "errorMessage",
											"properties": {
												"foo": "bar"
											}
										}
									}
								}
							}
						}
					},
					"401": {
						"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "UnauthorizedError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					},
					"500": {
						"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "InternalServerError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					}
				}
			},
			"get": {
				"operationId": "authenticationAdminGetUser",
				"summary": "Get existing user",
				"tags": [
					"Authentication Admin"
				],
				"parameters": [
					{
						"name": "email",
						"description": "The user email.",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string"
						},
						"style": "simple",
						"example": "user@example.com"
					}
				],
				"security": [
					{
						"jwtBearerAuthScheme": []
					}
				],
				"responses": {
					"200": {
						"description": "Get a user as an admin.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/AuthenticationUser"
								},
								"examples": {
									"getUserResponseExample": {
										"summary": "The response to get an existing user.",
										"value": {
											"email": "user@example.com",
											"userIdentity": "did:example:123456789abcdefghi",
											"organizationIdentity": "did:example:123456789abcdefghi",
											"scope": [
												"scope1",
												"scope2"
											]
										}
									}
								}
							}
						}
					},
					"400": {
						"description": "The server cannot process the request, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "GeneralError",
											"message": "errorMessage",
											"properties": {
												"foo": "bar"
											}
										}
									}
								}
							}
						}
					},
					"401": {
						"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "UnauthorizedError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					},
					"500": {
						"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "InternalServerError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					}
				}
			},
			"delete": {
				"operationId": "authenticationAdminRemoveUser",
				"summary": "Remove existing user",
				"tags": [
					"Authentication Admin"
				],
				"parameters": [
					{
						"name": "email",
						"description": "The user email.",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string"
						},
						"style": "simple",
						"example": "user@example.com"
					}
				],
				"security": [
					{
						"jwtBearerAuthScheme": []
					}
				],
				"responses": {
					"204": {
						"description": "The rest request ended in success with no data."
					},
					"400": {
						"description": "The server cannot process the request, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "GeneralError",
											"message": "errorMessage",
											"properties": {
												"foo": "bar"
											}
										}
									}
								}
							}
						}
					},
					"401": {
						"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "UnauthorizedError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					},
					"500": {
						"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "InternalServerError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					}
				}
			}
		},
		"/authentication/admin/users/{email}/password": {
			"put": {
				"operationId": "authenticationAdminUpdateUserPassword",
				"summary": "Update an existing user password",
				"tags": [
					"Authentication Admin"
				],
				"parameters": [
					{
						"name": "email",
						"description": "The user email.",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string"
						},
						"style": "simple",
						"example": "user@example.com"
					}
				],
				"security": [
					{
						"jwtBearerAuthScheme": []
					}
				],
				"requestBody": {
					"description": "Update a users password as an admin.",
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/AdminUserUpdatePasswordRequest"
							},
							"examples": {
								"updateUserPasswordRequestExample": {
									"summary": "The request to update an existing user password.",
									"value": {
										"newPassword": "MyNewPassword123!"
									}
								}
							}
						}
					}
				},
				"responses": {
					"204": {
						"description": "The rest request ended in success with no data."
					},
					"400": {
						"description": "The server cannot process the request, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "GeneralError",
											"message": "errorMessage",
											"properties": {
												"foo": "bar"
											}
										}
									}
								}
							}
						}
					},
					"401": {
						"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "UnauthorizedError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					},
					"500": {
						"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "InternalServerError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					}
				}
			}
		},
		"/authentication/admin/users/identity/{identity}": {
			"get": {
				"operationId": "authenticationAdminGetByIdentityUser",
				"summary": "Get existing user by identity",
				"tags": [
					"Authentication Admin"
				],
				"parameters": [
					{
						"name": "identity",
						"description": "The user identity.",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string"
						},
						"style": "simple",
						"example": "did:example:123456789abcdefghi"
					}
				],
				"security": [
					{
						"jwtBearerAuthScheme": []
					}
				],
				"responses": {
					"200": {
						"description": "Get a user as an admin.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/AuthenticationUser"
								},
								"examples": {
									"getUserResponseExample": {
										"summary": "The response to get an existing user.",
										"value": {
											"email": "user@example.com",
											"userIdentity": "did:example:123456789abcdefghi",
											"organizationIdentity": "did:example:123456789abcdefghi",
											"scope": [
												"scope1",
												"scope2"
											]
										}
									}
								}
							}
						}
					},
					"400": {
						"description": "The server cannot process the request, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "GeneralError",
											"message": "errorMessage",
											"properties": {
												"foo": "bar"
											}
										}
									}
								}
							}
						}
					},
					"401": {
						"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "UnauthorizedError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					},
					"500": {
						"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "InternalServerError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					}
				}
			}
		},
		"/authentication/audit": {
			"post": {
				"operationId": "authenticationAuditCreate",
				"summary": "Create an authentication audit entry",
				"tags": [
					"Authentication Audit"
				],
				"security": [
					{
						"jwtBearerAuthScheme": []
					}
				],
				"requestBody": {
					"description": "Create an authentication audit entry.",
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/AuditCreateRequest"
							},
							"examples": {
								"authenticationAuditCreateRequestExample": {
									"summary": "The request to create an authentication audit entry.",
									"value": {
										"actorId": "user@example.com",
										"event": "login-success",
										"data": {
											"organizationIdentity": "did:example:org1"
										}
									}
								}
							}
						}
					}
				},
				"responses": {
					"201": {
						"description": "The rest request ended in created response.",
						"headers": {
							"location": {
								"schema": {
									"type": "string"
								},
								"description": "e.g. 018f0b53d5d5704fa3a06d6ed2478575"
							}
						}
					},
					"400": {
						"description": "The server cannot process the request, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "GeneralError",
											"message": "errorMessage",
											"properties": {
												"foo": "bar"
											}
										}
									}
								}
							}
						}
					},
					"401": {
						"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "UnauthorizedError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					},
					"500": {
						"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "InternalServerError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					}
				}
			},
			"get": {
				"operationId": "authenticationAuditQuery",
				"summary": "Query authentication audit entries",
				"tags": [
					"Authentication Audit"
				],
				"parameters": [
					{
						"name": "actorId",
						"description": "The actor identifier to filter by.",
						"in": "query",
						"required": false,
						"schema": {
							"type": "string"
						},
						"example": "user@example.com"
					},
					{
						"name": "organizationId",
						"description": "The organization identifier to filter by.",
						"in": "query",
						"required": false,
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "tenantId",
						"description": "The tenant identifier to filter by.",
						"in": "query",
						"required": false,
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "nodeId",
						"description": "The node identifier to filter by.",
						"in": "query",
						"required": false,
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "event",
						"description": "The event to filter by.",
						"in": "query",
						"required": false,
						"schema": {
							"anyOf": [
								{
									"$ref": "#/components/schemas/AuthAuditEvent"
								},
								{
									"type": "string"
								}
							]
						},
						"example": "login-success"
					},
					{
						"name": "startDate",
						"description": "The inclusive start date for filtering, in ISO 8601 format.",
						"in": "query",
						"required": false,
						"schema": {
							"type": "string"
						},
						"example": "2026-01-01T00:00:00.000Z"
					},
					{
						"name": "endDate",
						"description": "The inclusive end date for filtering, in ISO 8601 format.",
						"in": "query",
						"required": false,
						"schema": {
							"type": "string"
						},
						"example": "2026-01-31T23:59:59.999Z"
					},
					{
						"name": "cursor",
						"description": "The pagination cursor.",
						"in": "query",
						"required": false,
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "limit",
						"description": "The maximum number of results to return.",
						"in": "query",
						"required": false,
						"schema": {
							"type": "string"
						},
						"example": "50"
					}
				],
				"security": [
					{
						"jwtBearerAuthScheme": []
					}
				],
				"responses": {
					"200": {
						"description": "Response from querying authentication audit entries.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/AuditQueryResponse"
								},
								"examples": {
									"authenticationAuditQueryResponseExample": {
										"summary": "The response for querying authentication audit entries.",
										"value": {
											"entries": [
												{
													"id": "018f0b53d5d5704fa3a06d6ed2478575",
													"actorId": "user@example.com",
													"dateCreated": "2026-01-12T09:05:23.123Z",
													"event": "login-success",
													"data": {
														"organizationIdentity": "did:example:org1"
													}
												}
											],
											"cursor": "next-cursor"
										}
									}
								}
							}
						}
					},
					"400": {
						"description": "The server cannot process the request, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "GeneralError",
											"message": "errorMessage",
											"properties": {
												"foo": "bar"
											}
										}
									}
								}
							}
						}
					},
					"401": {
						"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "UnauthorizedError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					},
					"500": {
						"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "InternalServerError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					}
				}
			}
		},
		"/authentication/audit/{id}": {
			"get": {
				"operationId": "authenticationAuditGet",
				"summary": "Get an authentication audit entry",
				"tags": [
					"Authentication Audit"
				],
				"parameters": [
					{
						"name": "id",
						"description": "The audit entry id.",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string"
						},
						"style": "simple",
						"example": "018f0b53d5d5704fa3a06d6ed2478575"
					}
				],
				"security": [
					{
						"jwtBearerAuthScheme": []
					}
				],
				"responses": {
					"200": {
						"description": "Response from getting an authentication audit entry.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/AuthenticationAuditEntry"
								},
								"examples": {
									"authenticationAuditGetResponseExample": {
										"summary": "The response for getting an authentication audit entry.",
										"value": {
											"id": "018f0b53d5d5704fa3a06d6ed2478575",
											"actorId": "user@example.com",
											"dateCreated": "2026-01-12T09:05:23.123Z",
											"event": "login-success",
											"data": {
												"organizationIdentity": "did:example:org1"
											}
										}
									}
								}
							}
						}
					},
					"400": {
						"description": "The server cannot process the request, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "GeneralError",
											"message": "errorMessage",
											"properties": {
												"foo": "bar"
											}
										}
									}
								}
							}
						}
					},
					"401": {
						"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "UnauthorizedError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					},
					"500": {
						"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "InternalServerError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					}
				}
			},
			"put": {
				"operationId": "authenticationAuditUpdate",
				"summary": "Update an authentication audit entry",
				"tags": [
					"Authentication Audit"
				],
				"parameters": [
					{
						"name": "id",
						"description": "The audit entry id.",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string"
						},
						"style": "simple",
						"example": "018f0b53d5d5704fa3a06d6ed2478575"
					}
				],
				"security": [
					{
						"jwtBearerAuthScheme": []
					}
				],
				"requestBody": {
					"description": "Update an authentication audit entry.",
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/AuditUpdateRequest"
							},
							"examples": {
								"authenticationAuditUpdateRequestExample": {
									"summary": "The request to update an authentication audit entry.",
									"value": {
										"data": {
											"organizationIdentity": "did:example:org1"
										}
									}
								}
							}
						}
					}
				},
				"responses": {
					"204": {
						"description": "The rest request ended in success with no data."
					},
					"400": {
						"description": "The server cannot process the request, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "GeneralError",
											"message": "errorMessage",
											"properties": {
												"foo": "bar"
											}
										}
									}
								}
							}
						}
					},
					"401": {
						"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "UnauthorizedError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					},
					"500": {
						"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "InternalServerError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					}
				}
			},
			"delete": {
				"operationId": "authenticationAuditRemove",
				"summary": "Remove an authentication audit entry",
				"tags": [
					"Authentication Audit"
				],
				"parameters": [
					{
						"name": "id",
						"description": "The audit entry id.",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string"
						},
						"style": "simple",
						"example": "018f0b53d5d5704fa3a06d6ed2478575"
					}
				],
				"security": [
					{
						"jwtBearerAuthScheme": []
					}
				],
				"responses": {
					"204": {
						"description": "The rest request ended in success with no data."
					},
					"400": {
						"description": "The server cannot process the request, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "GeneralError",
											"message": "errorMessage",
											"properties": {
												"foo": "bar"
											}
										}
									}
								}
							}
						}
					},
					"401": {
						"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "UnauthorizedError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					},
					"500": {
						"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								},
								"examples": {
									"exampleResponse": {
										"value": {
											"name": "InternalServerError",
											"message": "errorMessage"
										}
									}
								}
							}
						}
					}
				}
			}
		}
	},
	"components": {
		"schemas": {
			"AdminUserCreateRequest": {
				"type": "object",
				"properties": {
					"password": {
						"type": "string"
					}
				},
				"required": [
					"password"
				],
				"allOf": [
					{
						"$ref": "#/components/schemas/AuthenticationUser"
					}
				],
				"description": "The body of the request."
			},
			"AdminUserUpdatePasswordRequest": {
				"type": "object",
				"properties": {
					"newPassword": {
						"type": "string",
						"description": "The new password for the user."
					},
					"currentPassword": {
						"type": "string",
						"description": "The current password for the user."
					}
				},
				"required": [
					"newPassword"
				],
				"description": "The body of the request."
			},
			"AdminUserUpdateRequest": {
				"description": "The body of the request.",
				"type": "object",
				"properties": {
					"userIdentity": {
						"type": "string",
						"description": "The user identity."
					},
					"organizationIdentity": {
						"type": "string",
						"description": "The users organization."
					},
					"scope": {
						"type": "array",
						"items": {
							"type": "string"
						},
						"description": "The scope assigned to the user, comma separated."
					}
				}
			},
			"AuditCreateRequest": {
				"description": "The body of the request.",
				"type": "object",
				"properties": {
					"event": {
						"anyOf": [
							{
								"$ref": "#/components/schemas/AuthAuditEvent"
							},
							{
								"type": "string"
							}
						],
						"description": "The audit event that occurred."
					},
					"actorId": {
						"type": "string",
						"description": "The actor identifier, could be e-mail, username, or other unique identifier."
					},
					"nodeId": {
						"type": "string",
						"description": "The node identifier associated with the audit entry, if applicable."
					},
					"organizationId": {
						"type": "string",
						"description": "The organization identifier associated with the audit entry, if applicable."
					},
					"tenantId": {
						"type": "string",
						"description": "The tenant identifier associated with the audit entry, if applicable."
					},
					"ipAddressHashes": {
						"type": "array",
						"items": {
							"type": "string"
						},
						"description": "The hashed IP addresses of the client."
					},
					"userAgent": {
						"type": "string",
						"description": "The user agent string of the client."
					},
					"correlationId": {
						"type": "string",
						"description": "The correlation ID for request tracing."
					},
					"data": {
						"description": "Additional data related to the audit entry, such as IP address, user agent, etc."
					}
				},
				"required": [
					"event"
				]
			},
			"AuditQueryResponse": {
				"type": "object",
				"properties": {
					"entries": {
						"type": "array",
						"items": {
							"$ref": "#/components/schemas/AuthenticationAuditEntry"
						},
						"description": "The returned audit entries."
					},
					"cursor": {
						"type": "string",
						"description": "The cursor to retrieve the next page, if any."
					}
				},
				"required": [
					"entries"
				],
				"description": "The response body."
			},
			"AuditUpdateRequest": {
				"description": "The body of the request.",
				"type": "object",
				"properties": {
					"event": {
						"anyOf": [
							{
								"$ref": "#/components/schemas/AuthAuditEvent"
							},
							{
								"type": "string"
							}
						],
						"description": "The audit event that occurred."
					},
					"actorId": {
						"type": "string",
						"description": "The actor identifier, could be e-mail, username, or other unique identifier."
					},
					"nodeId": {
						"type": "string",
						"description": "The node identifier associated with the audit entry, if applicable."
					},
					"organizationId": {
						"type": "string",
						"description": "The organization identifier associated with the audit entry, if applicable."
					},
					"tenantId": {
						"type": "string",
						"description": "The tenant identifier associated with the audit entry, if applicable."
					},
					"ipAddressHashes": {
						"type": "array",
						"items": {
							"type": "string"
						},
						"description": "The hashed IP addresses of the client."
					},
					"userAgent": {
						"type": "string",
						"description": "The user agent string of the client."
					},
					"correlationId": {
						"type": "string",
						"description": "The correlation ID for request tracing."
					},
					"data": {
						"description": "Additional data related to the audit entry, such as IP address, user agent, etc."
					}
				}
			},
			"AuthAuditEvent": {
				"description": "Supported authentication audit event values.",
				"anyOf": [
					{
						"const": "login-success",
						"description": "Login success."
					},
					{
						"const": "login-failure",
						"description": "Login failure."
					},
					{
						"const": "logout",
						"description": "Logout."
					},
					{
						"const": "token-refreshed",
						"description": "Token refreshed."
					},
					{
						"const": "account-created",
						"description": "Account created."
					},
					{
						"const": "account-deleted",
						"description": "Account deleted."
					},
					{
						"const": "account-updated",
						"description": "Account updated."
					},
					{
						"const": "account-locked",
						"description": "Account locked."
					},
					{
						"const": "account-unlocked",
						"description": "Account unlocked."
					},
					{
						"const": "password-changed",
						"description": "Password changed."
					}
				]
			},
			"AuthenticationAuditEntry": {
				"description": "Contract definition for authentication audit entry.",
				"type": "object",
				"properties": {
					"id": {
						"type": "string",
						"description": "The unique identifier for the audit entry."
					},
					"event": {
						"anyOf": [
							{
								"$ref": "#/components/schemas/AuthAuditEvent"
							},
							{
								"type": "string"
							}
						],
						"description": "The audit event that occurred."
					},
					"dateCreated": {
						"type": "string",
						"description": "The timestamp of the audit entry in ISO 8601 format."
					},
					"actorId": {
						"type": "string",
						"description": "The actor identifier, could be e-mail, username, or other unique identifier."
					},
					"nodeId": {
						"type": "string",
						"description": "The node identifier associated with the audit entry, if applicable."
					},
					"organizationId": {
						"type": "string",
						"description": "The organization identifier associated with the audit entry, if applicable."
					},
					"tenantId": {
						"type": "string",
						"description": "The tenant identifier associated with the audit entry, if applicable."
					},
					"ipAddressHashes": {
						"type": "array",
						"items": {
							"type": "string"
						},
						"description": "The hashed IP addresses of the client."
					},
					"userAgent": {
						"type": "string",
						"description": "The user agent string of the client."
					},
					"correlationId": {
						"type": "string",
						"description": "The correlation ID for request tracing."
					},
					"data": {
						"description": "Additional data related to the audit entry, such as IP address, user agent, etc."
					}
				},
				"required": [
					"id",
					"event",
					"dateCreated"
				]
			},
			"AuthenticationUser": {
				"description": "Contract definition for authentication user.",
				"type": "object",
				"properties": {
					"email": {
						"type": "string",
						"description": "The user e-mail address."
					},
					"userIdentity": {
						"type": "string",
						"description": "The user identity."
					},
					"organizationIdentity": {
						"type": "string",
						"description": "The users organization."
					},
					"scope": {
						"type": "array",
						"items": {
							"type": "string"
						},
						"description": "The scope assigned to the user, comma separated."
					}
				},
				"required": [
					"email",
					"userIdentity",
					"organizationIdentity",
					"scope"
				]
			},
			"Error": {
				"description": "Model to describe serialized error.",
				"type": "object",
				"properties": {
					"name": {
						"type": "string",
						"description": "The name for the error."
					},
					"message": {
						"type": "string",
						"description": "The message for the error as an i18n key."
					},
					"source": {
						"type": "string",
						"description": "The source of the error."
					},
					"properties": {
						"type": "object",
						"additionalProperties": {},
						"description": "Any additional information for the error."
					},
					"stack": {
						"type": "string",
						"description": "The stack trace for the error."
					},
					"cause": {
						"$ref": "#/components/schemas/Error"
					}
				},
				"required": [
					"name",
					"message"
				]
			},
			"LoginRequest": {
				"type": "object",
				"properties": {
					"email": {
						"type": "string",
						"description": "The email address for the user."
					},
					"password": {
						"type": "string",
						"description": "The password for the user."
					}
				},
				"required": [
					"email",
					"password"
				],
				"description": "The login details."
			},
			"LoginResponse": {
				"type": "object",
				"properties": {
					"expiry": {
						"type": "number",
						"description": "The expiry time of the token."
					}
				},
				"required": [
					"expiry"
				],
				"description": "The login response details."
			},
			"LogoutRequest": {
				"type": "object",
				"properties": {
					"token": {
						"type": "string",
						"description": "The token to logout, if it uses a mechanism with public access."
					}
				},
				"description": "The logout token details."
			},
			"RefreshTokenRequest": {
				"type": "object",
				"properties": {
					"token": {
						"type": "string",
						"description": "The token to refresh, if it uses a mechanism with public access."
					}
				},
				"description": "The refresh token details."
			},
			"RefreshTokenResponse": {
				"type": "object",
				"properties": {
					"expiry": {
						"type": "number",
						"description": "The expiry time of the token."
					}
				},
				"required": [
					"expiry"
				],
				"description": "The refresh token details."
			},
			"UpdatePasswordRequest": {
				"type": "object",
				"properties": {
					"currentPassword": {
						"type": "string",
						"description": "The current password for the user."
					},
					"newPassword": {
						"type": "string",
						"description": "The new password for the user."
					}
				},
				"required": [
					"currentPassword",
					"newPassword"
				],
				"description": "The body of the request."
			}
		},
		"securitySchemes": {
			"jwtBearerAuthScheme": {
				"type": "http",
				"scheme": "bearer",
				"bearerFormat": "JWT"
			}
		}
	}
}
