{
  "openapi": "3.1.0",
  "info": {
    "title": "Event Registration Integration API",
    "version": "1.0.0"
  },
  "paths": {
    "/api/v1/registrations": {
      "get": {
        "summary": "List Registrations",
        "description": "Read a page in creation order. Requires registrations:read.",
        "operationId": "list_registrations_api_v1_registrations_get",
        "security": [
          {
            "ServiceKey": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 256
                },
                {
                  "type": "null"
                }
              ],
              "title": "After"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistrationPage"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create Registration",
        "description": "Create a pending registration with no photo or face enrollment. Requires registrations:write.",
        "operationId": "create_registration_api_v1_registrations_post",
        "security": [
          {
            "ServiceKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalRegistration"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistrationView"
                }
              }
            }
          },
          "200": {
            "description": "Idempotent replay",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistrationView"
                }
              }
            }
          },
          "409": {
            "description": "External reference or email conflict"
          },
          "410": {
            "description": "Previously erased registration"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/registrations/{registration_id}": {
      "get": {
        "summary": "Get Registration",
        "description": "Retrieve one registration. Requires registrations:read.",
        "operationId": "get_registration_api_v1_registrations__registration_id__get",
        "security": [
          {
            "ServiceKey": []
          }
        ],
        "parameters": [
          {
            "name": "registration_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Registration Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistrationView"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/events": {
      "get": {
        "summary": "Get Events",
        "description": "Poll in ascending commit sequence. Save nextCursor after processing. Requires events:read.",
        "operationId": "get_events_api_v1_events_get",
        "security": [
          {
            "ServiceKey": []
          }
        ],
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 0,
              "default": 0,
              "title": "After"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventPage"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "EventPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/EventView"
            },
            "type": "array",
            "title": "Items"
          },
          "nextCursor": {
            "type": "integer",
            "title": "Nextcursor"
          },
          "hasMore": {
            "type": "boolean",
            "title": "Hasmore"
          }
        },
        "type": "object",
        "required": [
          "items",
          "nextCursor",
          "hasMore"
        ],
        "title": "EventPage"
      },
      "EventView": {
        "properties": {
          "sequence": {
            "type": "integer",
            "title": "Sequence"
          },
          "type": {
            "type": "string",
            "enum": [
              "registration.created",
              "registration.status_changed",
              "registration.checked_in",
              "registration.deleted"
            ],
            "title": "Type"
          },
          "registrationId": {
            "type": "string",
            "title": "Registrationid"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "occurredAt": {
            "type": "string",
            "title": "Occurredat"
          }
        },
        "type": "object",
        "required": [
          "sequence",
          "type",
          "registrationId",
          "status",
          "occurredAt"
        ],
        "title": "EventView"
      },
      "ExternalRegistration": {
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "title": "Externalid",
            "description": "Stable opaque upstream reference, unique across this installation. Use a random identifier."
          },
          "firstName": {
            "type": "string",
            "maxLength": 80,
            "minLength": 1,
            "title": "Firstname"
          },
          "lastName": {
            "type": "string",
            "maxLength": 80,
            "minLength": 1,
            "title": "Lastname"
          },
          "email": {
            "type": "string",
            "maxLength": 254,
            "minLength": 5,
            "title": "Email"
          },
          "country": {
            "type": "string",
            "maxLength": 100,
            "minLength": 2,
            "title": "Country"
          },
          "role": {
            "type": "string",
            "enum": [
              "Attendee",
              "Investor",
              "Partner",
              "Speaker",
              "Exhibitor",
              "Sponsor",
              "Media"
            ],
            "title": "Role",
            "default": "Attendee"
          },
          "company": {
            "type": "string",
            "maxLength": 150,
            "title": "Company",
            "default": ""
          },
          "jobTitle": {
            "type": "string",
            "maxLength": 120,
            "title": "Jobtitle",
            "default": ""
          },
          "privacyConsent": {
            "type": "boolean",
            "title": "Privacyconsent",
            "description": "The caller attests the guest accepted this event's registration privacy notice."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "externalId",
          "firstName",
          "lastName",
          "email",
          "country",
          "privacyConsent"
        ],
        "title": "ExternalRegistration"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "RegistrationPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/RegistrationView"
            },
            "type": "array",
            "title": "Items"
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nextcursor"
          },
          "hasMore": {
            "type": "boolean",
            "title": "Hasmore"
          }
        },
        "type": "object",
        "required": [
          "items",
          "nextCursor",
          "hasMore"
        ],
        "title": "RegistrationPage"
      },
      "RegistrationView": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "firstName": {
            "type": "string",
            "title": "Firstname"
          },
          "lastName": {
            "type": "string",
            "title": "Lastname"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "company": {
            "type": "string",
            "title": "Company"
          },
          "jobTitle": {
            "type": "string",
            "title": "Jobtitle"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "rejected"
            ],
            "title": "Status"
          },
          "createdAt": {
            "type": "string",
            "title": "Createdat"
          },
          "expiresAt": {
            "type": "string",
            "title": "Expiresat"
          },
          "checkedInAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Checkedinat"
          }
        },
        "type": "object",
        "required": [
          "id",
          "firstName",
          "lastName",
          "role",
          "company",
          "jobTitle",
          "status",
          "createdAt",
          "expiresAt",
          "checkedInAt"
        ],
        "title": "RegistrationView"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    },
    "securitySchemes": {
      "ServiceKey": {
        "type": "http",
        "description": "Issue scoped keys on the installation host.",
        "scheme": "bearer"
      }
    }
  }
}