{
  "components": {
    "schemas": {
      "Enqueue": {
        "additionalProperties": false,
        "properties": {
          "destination_id": {
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$",
            "title": "Destination Id",
            "type": "string"
          },
          "event_type": {
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$",
            "title": "Event Type",
            "type": "string"
          },
          "payload": {
            "additionalProperties": true,
            "title": "Payload",
            "type": "object"
          }
        },
        "required": [
          "destination_id",
          "event_type",
          "payload"
        ],
        "title": "Enqueue",
        "type": "object"
      },
      "EnqueueAcknowledgment": {
        "additionalProperties": false,
        "properties": {
          "item": {
            "$ref": "#/components/schemas/OutboxItem"
          },
          "replayed": {
            "title": "Replayed",
            "type": "boolean"
          }
        },
        "required": [
          "item",
          "replayed"
        ],
        "title": "EnqueueAcknowledgment",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "OutboxItem": {
        "additionalProperties": false,
        "properties": {
          "attempt_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Attempt Id"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "destination_id": {
            "title": "Destination Id",
            "type": "string"
          },
          "event_type": {
            "title": "Event Type",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "payload_sha256": {
            "title": "Payload Sha256",
            "type": "string"
          },
          "revision": {
            "title": "Revision",
            "type": "integer"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "revision",
          "status",
          "destination_id",
          "event_type",
          "payload_sha256",
          "created_at",
          "updated_at",
          "attempt_id"
        ],
        "title": "OutboxItem",
        "type": "object"
      },
      "Revision": {
        "additionalProperties": false,
        "properties": {
          "expected_revision": {
            "maximum": 2147483647.0,
            "minimum": 1.0,
            "title": "Expected Revision",
            "type": "integer"
          }
        },
        "required": [
          "expected_revision"
        ],
        "title": "Revision",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      }
    }
  },
  "info": {
    "title": "Gradia Outbox reference",
    "version": "0.1.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/outbox": {
      "get": {
        "operationId": "listing_v1_outbox_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-principal",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9a-f]{64}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Principal"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-configuration",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9a-f]{64}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Configuration"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-block-version",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 40,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Block-Version"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Listing"
      },
      "post": {
        "operationId": "enqueue_v1_outbox_post",
        "parameters": [
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "title": "Idempotency-Key",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-principal",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9a-f]{64}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Principal"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-configuration",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9a-f]{64}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Configuration"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-block-version",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 40,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Block-Version"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Enqueue"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnqueueAcknowledgment"
                }
              }
            },
            "description": "Successful Response"
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnqueueAcknowledgment"
                }
              }
            },
            "description": "Created"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Enqueue"
      }
    },
    "/v1/outbox/destinations": {
      "get": {
        "operationId": "configured_destinations_v1_outbox_destinations_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-principal",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9a-f]{64}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Principal"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-configuration",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9a-f]{64}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Configuration"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-block-version",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 40,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Block-Version"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Configured Destinations"
      }
    },
    "/v1/outbox/diagnostics/attempts": {
      "get": {
        "operationId": "diagnostics_v1_outbox_diagnostics_attempts_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-principal",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9a-f]{64}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Principal"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-configuration",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9a-f]{64}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Configuration"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-block-version",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 40,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Block-Version"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Diagnostics"
      }
    },
    "/v1/outbox/session": {
      "get": {
        "operationId": "session_v1_outbox_session_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-principal",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9a-f]{64}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Principal"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-configuration",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9a-f]{64}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Configuration"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-block-version",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 40,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Block-Version"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Session"
      }
    },
    "/v1/outbox/{identity}": {
      "get": {
        "operationId": "get_one_v1_outbox__identity__get",
        "parameters": [
          {
            "in": "path",
            "name": "identity",
            "required": true,
            "schema": {
              "title": "Identity",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-principal",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9a-f]{64}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Principal"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-configuration",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9a-f]{64}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Configuration"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-block-version",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 40,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Block-Version"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboxItem"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get One"
      }
    },
    "/v1/outbox/{identity}/deliver": {
      "post": {
        "operationId": "deliver_v1_outbox__identity__deliver_post",
        "parameters": [
          {
            "in": "path",
            "name": "identity",
            "required": true,
            "schema": {
              "title": "Identity",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-principal",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9a-f]{64}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Principal"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-configuration",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9a-f]{64}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Configuration"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-block-version",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 40,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Block-Version"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Revision"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboxItem"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Deliver"
      }
    },
    "/v1/outbox/{identity}/events": {
      "get": {
        "operationId": "events_v1_outbox__identity__events_get",
        "parameters": [
          {
            "in": "path",
            "name": "identity",
            "required": true,
            "schema": {
              "title": "Identity",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-principal",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9a-f]{64}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Principal"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-configuration",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9a-f]{64}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Configuration"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-block-version",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 40,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Block-Version"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Events"
      }
    },
    "/v1/outbox/{identity}/mark-uncertain": {
      "post": {
        "operationId": "mark_uncertain_v1_outbox__identity__mark_uncertain_post",
        "parameters": [
          {
            "in": "path",
            "name": "identity",
            "required": true,
            "schema": {
              "title": "Identity",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-principal",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9a-f]{64}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Principal"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-configuration",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9a-f]{64}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Configuration"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-block-version",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 40,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Block-Version"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Revision"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboxItem"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Mark Uncertain"
      }
    },
    "/v1/outbox/{identity}/reconcile": {
      "post": {
        "operationId": "reconcile_v1_outbox__identity__reconcile_post",
        "parameters": [
          {
            "in": "path",
            "name": "identity",
            "required": true,
            "schema": {
              "title": "Identity",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-principal",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9a-f]{64}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Principal"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-configuration",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9a-f]{64}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Configuration"
            }
          },
          {
            "in": "header",
            "name": "if-gradia-block-version",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 40,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Gradia-Block-Version"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Revision"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboxItem"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Reconcile"
      }
    }
  }
}
