{
  "swagger": "2.0",
  "info": {
    "title": "evey/v1/webhook.proto",
    "version": "version not set"
  },
  "tags": [
    {
      "name": "WebhookService"
    }
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/api/v1/admin/webhooks": {
      "get": {
        "operationId": "WebhookService_ListWebhooks",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListWebhooksResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "tags": [
          "WebhookService"
        ]
      },
      "post": {
        "operationId": "WebhookService_CreateWebhook",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1WebhookConfig"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1CreateWebhookRequest"
            }
          }
        ],
        "tags": [
          "WebhookService"
        ]
      }
    },
    "/api/v1/admin/webhooks/{id}": {
      "delete": {
        "operationId": "WebhookService_DeleteWebhook",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1DeleteWebhookResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "WebhookService"
        ]
      },
      "put": {
        "operationId": "WebhookService_UpdateWebhook",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1WebhookConfig"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/WebhookServiceUpdateWebhookBody"
            }
          }
        ],
        "tags": [
          "WebhookService"
        ]
      }
    },
    "/api/v1/admin/webhooks/{webhookId}/deliveries": {
      "get": {
        "operationId": "WebhookService_ListWebhookDeliveries",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListWebhookDeliveriesResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "tags": [
          "WebhookService"
        ]
      }
    }
  },
  "definitions": {
    "WebhookServiceUpdateWebhookBody": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "events": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "secret": {
          "type": "string"
        },
        "headers": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "enabled": {
          "type": "boolean"
        }
      }
    },
    "protobufAny": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        }
      },
      "additionalProperties": {}
    },
    "rpcStatus": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32"
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/protobufAny"
          }
        }
      }
    },
    "v1CreateWebhookRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "events": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "secret": {
          "type": "string"
        },
        "headers": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "enabled": {
          "type": "boolean"
        }
      }
    },
    "v1DeleteWebhookResponse": {
      "type": "object"
    },
    "v1ListWebhookDeliveriesResponse": {
      "type": "object",
      "properties": {
        "deliveries": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1WebhookDelivery"
          }
        }
      }
    },
    "v1ListWebhooksResponse": {
      "type": "object",
      "properties": {
        "webhooks": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1WebhookConfig"
          }
        }
      }
    },
    "v1WebhookConfig": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "events": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "secret": {
          "type": "string"
        },
        "headers": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "enabled": {
          "type": "boolean"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "v1WebhookDelivery": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "webhookId": {
          "type": "string"
        },
        "event": {
          "type": "string"
        },
        "statusCode": {
          "type": "integer",
          "format": "int32"
        },
        "error": {
          "type": "string"
        },
        "sentAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}
