{
    "x-generator": "NSwag v14.0.0.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))",
    "openapi": "3.0.0",
    "info": {
        "title": "Qala Publishing API",
        "version": "v1.0"
    },
    "servers": [
        {
            "url": "https://publisher-api.qalatech.io"
        }
    ],
    "paths": {
        "/v1/security/subscriber-groups/{subscriberGroupId}/session-token": {
            "get": {
                "tags": [
                    "Security / Subscriber Groups"
                ],
                "summary": "Create Subscriber Group Session Token",
                "description": "Creates a new Session Token for a Subscriber Group",
                "operationId": "create-subscriber-group-session-token",
                "parameters": [
                    {
                        "name": "subscriberGroupId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "guid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "properties": {
                                        "sessionToken": {
                                            "type": "string",
                                            "example": "ABC-G-kbI6ZQ1nr4qbs-U81Nt_p93GpxeT_m43grreIEnVZjG53Sa5skfeN7YmSGGGSs-vIemIw7U_EXAMPLE-w"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ProblemDetails"
                                },
                                "example": {
                                    "type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1",
                                    "title": "One or more validation errors occurred.",
                                    "status": 400,
                                    "instance": "/v1/security/subscriber-groups/e0b841db-c27b-47ad-861f-8b8fbb1223e2XX/session-token",
                                    "traceId": "0HN5I8TBVM6OO:00000001",
                                    "errors": [
                                        {
                                            "name": "subscriberGroupId",
                                            "reason": "Value [e0b841db-c27b-47ad-861f-8b8fbb1223e2XX] is not valid for a [Guid] property!"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "404": {
                        "description": "Not Found"
                    }
                },
                "security": [
                    {
                        "ApiKey": []
                    }
                ]
            }
        },
        "/v1/topics/{topicName}/events/publish": {
            "post": {
                "tags": [
                    "Events"
                ],
                "summary": "Publish Events",
                "description": "Publishes Events to a Topic",
                "operationId": "publish-events",
                "parameters": [
                    {
                        "name": "topicName",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "x-environment-id",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "guid"
                        }
                    }
                ],
                "requestBody": {
                    "x-name": "PublishEventsRequest",
                    "description": "",
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PublishEventsRequest"
                            },
                            "example": {
                                "events": [
                                    {
                                        "type": "customer.created",
                                        "id": "Example2",
                                        "data": {
                                            "customer_id": "123456",
                                            "name": "John Doe",
                                            "email": "johndoe@letsqala.com",
                                            "createdAt": "2024-04-30T08:45:00",
                                            "address": {
                                                "street": "123 Main St",
                                                "city": "Anytown",
                                                "state": "CA",
                                                "zipCode": "90210",
                                                "country": "USA"
                                            }
                                        }
                                    }
                                ]
                            }
                        }
                    },
                    "required": true,
                    "x-position": 1
                },
                "responses": {
                    "202": {
                        "description": "Accepted"
                    },
                    "400": {
                        "description": "Bad Request",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ProblemDetails"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "404": {
                        "description": "Not Found"
                    }
                },
                "security": [
                    {
                        "ApiKey": []
                    }
                ]
            }
        }
    },
    "components": {
        "schemas": {
            "ProblemDetails": {
                "type": "object",
                "description": "RFC7807 compatible problem details/ error response class. this can be used by configuring startup like so:\n\n    app.UseFastEndpoints(x => x.Errors.ResponseBuilder = ProblemDetails.ResponseBuilder);",
                "additionalProperties": false,
                "properties": {
                    "type": {
                        "type": "string",
                        "default": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1"
                    },
                    "title": {
                        "type": "string",
                        "default": "One or more validation errors occurred."
                    },
                    "status": {
                        "type": "integer",
                        "format": "int32",
                        "default": 400
                    },
                    "instance": {
                        "type": "string",
                        "default": "/api/route"
                    },
                    "traceId": {
                        "type": "string",
                        "default": "0HMPNHL0JHL76:00000001"
                    },
                    "detail": {
                        "type": "string",
                        "description": "the details of the error",
                        "nullable": true
                    },
                    "errors": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/ProblemDetails_Error"
                        }
                    }
                }
            },
            "ProblemDetails_Error": {
                "type": "object",
                "description": "the error details object",
                "additionalProperties": false,
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "the name of the error or property of the dto that caused the error",
                        "default": "Error or field name"
                    },
                    "reason": {
                        "type": "string",
                        "description": "the reason for the error",
                        "default": "Error reason"
                    },
                    "code": {
                        "type": "string",
                        "description": "the code of the error",
                        "nullable": true
                    },
                    "severity": {
                        "type": "string",
                        "description": "the severity of the error",
                        "nullable": true
                    }
                }
            },
            "GetSubscriberGroupSessionTokenRequest": {
                "type": "object",
                "additionalProperties": false
            },
            "PublishEventsRequest": {
                "type": "object",
                "example": {
                    "events": [
                        {
                            "type": "transaction.updated",
                            "id": "Example2",
                            "data": {
                                "customerId": "123456",
                                "name": "John Doe",
                                "email": "johndoe@letsqala.com",
                                "createdAt": "2024-04-30T08:45:00",
                                "address": {
                                    "street": "123 Main St",
                                    "city": "Los Angeles",
                                    "state": "California",
                                    "zipCode": "90210",
                                    "country": "United States"
                                }
                            }
                        }
                    ]
                },
                "additionalProperties": false,
                "required": [
                    "events"
                ],
                "properties": {
                    "events": {
                        "type": "array",
                        "minLength": 1,
                        "nullable": false,
                        "items": {
                            "$ref": "#/components/schemas/Event"
                        }
                    }
                }
            },
            "Event": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "type",
                    "data"
                ],
                "properties": {
                    "type": {
                        "type": "string",
                        "minLength": 1,
                        "pattern": "^(?:[A-Za-z0-9.,_\\-&()\\[\\]<>]{1,100})$",
                        "nullable": false
                    },
                    "id": {
                        "type": "string"
                    },
                    "data": {
                        "nullable": false
                    }
                }
            }
        },
        "securitySchemes": {
            "ApiKey": {
                "type": "apiKey",
                "name": "x-auth-token",
                "in": "header"
            }
        }
    },
    "tags": [
        {
            "name": "Events",
            "description": ""
        },
        {
            "name": "Security / Subscriber Groups",
            "description": ""
        }
    ]
}