basePath: /v1 definitions: Delivery: properties: created_at: type: string delivery_attempts: type: integer id: type: string payload: type: string scheduled_at: type: string status: type: string updated_at: type: string webhook_id: type: string type: object DeliveryAttempt: properties: created_at: type: string delivery_id: type: string error: type: string execution_duration: type: integer id: type: string raw_request: type: string raw_response: type: string response_status_code: type: integer success: type: boolean webhook_id: type: string type: object DeliveryAttemptList: properties: delivery_attempts: items: $ref: '#/definitions/DeliveryAttempt' type: array limit: type: integer offset: type: integer type: object DeliveryList: properties: deliveries: items: $ref: '#/definitions/Delivery' type: array limit: type: integer offset: type: integer type: object Error: properties: code: $ref: '#/definitions/handler.errorResponseCode' details: type: string message: type: string type: object Webhook: properties: active: type: boolean content_type: type: string created_at: type: string delivery_attempt_timeout: type: integer id: type: string max_delivery_attempts: type: integer name: type: string retry_max_backoff: type: integer retry_min_backoff: type: integer secret_token: type: string updated_at: type: string url: type: string valid_status_codes: items: type: integer type: array type: object WebhookList: properties: limit: type: integer offset: type: integer webhooks: items: $ref: '#/definitions/Webhook' type: array type: object handler.errorResponseCode: enum: - 1 - 2 - 3 - 4 - 5 - 6 - 7 type: integer x-enum-varnames: - internalServerErrorCode - invalidIDCode - malformedRequestBodyCode - requestValidationFailedCode - webhookNotFoundCode - deliveryNotFoundCode - deliveryAttemptNotFoundCode info: contact: {} description: Simple webhook delivery system powered by Golang and PostgreSQL. title: Postmand API version: "1.0" paths: /deliveries: get: consumes: - application/json parameters: - description: The limit indicates the maximum number of items to return in: query name: limit type: integer - description: The offset indicates the starting position of the query in relation to the complete set of unpaginated items in: query name: offset type: integer - description: Filter by webhook_id field in: query name: webhook_id type: string - description: Filter by status field in: query name: status type: string - description: Return results where the created_at field is greater than this value in: query name: created_at.gt type: string - description: Return results where the created_at field is greater than or equal to this value in: query name: created_at.gte type: string - description: Return results where the created_at field is less than this value in: query name: created_at.lt type: string - description: Return results where the created_at field is less than or equal to this value in: query name: created_at.lte type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/DeliveryList' "500": description: Internal Server Error schema: $ref: '#/definitions/Error' summary: List deliveries tags: - deliveries post: consumes: - application/json parameters: - description: Add delivery in: body name: delivery required: true schema: $ref: '#/definitions/Delivery' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/Delivery' "400": description: Bad Request schema: $ref: '#/definitions/Error' "500": description: Internal Server Error schema: $ref: '#/definitions/Error' summary: Add an delivery tags: - deliveries /deliveries/{delivery_id}: delete: consumes: - application/json parameters: - description: Delivery ID in: path name: delivery_id required: true type: string produces: - application/json responses: "204": description: No Content "404": description: Not Found schema: $ref: '#/definitions/Error' "500": description: Internal Server Error schema: $ref: '#/definitions/Error' summary: Delete an delivery tags: - deliveries get: consumes: - application/json parameters: - description: Delivery ID in: path name: delivery_id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/Delivery' "404": description: Not Found schema: $ref: '#/definitions/Error' "500": description: Internal Server Error schema: $ref: '#/definitions/Error' summary: Show a delivery tags: - deliveries /delivery-attempts: get: consumes: - application/json parameters: - description: The limit indicates the maximum number of items to return in: query name: limit type: integer - description: The offset indicates the starting position of the query in relation to the complete set of unpaginated items in: query name: offset type: integer - description: Filter by webhook_id in: query name: webhook_id type: string - description: Filter by delivery_id in: query name: delivery_id type: string - description: Filter by success in: query name: success type: boolean - description: Return results where the created_at field is greater than this value in: query name: created_at.gt type: string - description: Return results where the created_at field is greater than or equal to this value in: query name: created_at.gte type: string - description: Return results where the created_at field is less than this value in: query name: created_at.lt type: string - description: Return results where the created_at field is less than or equal to this value in: query name: created_at.lte type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/DeliveryAttemptList' "500": description: Internal Server Error schema: $ref: '#/definitions/Error' summary: List delivery attempts tags: - delivery-attempts /delivery-attempts/{delivery_attempt_id}: get: consumes: - application/json parameters: - description: Delivery Attempt ID in: path name: delivery_attempt_id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/DeliveryAttempt' "404": description: Not Found schema: $ref: '#/definitions/Error' "500": description: Internal Server Error schema: $ref: '#/definitions/Error' summary: Show a delivery attempt tags: - delivery-attempts /webhooks: get: consumes: - application/json parameters: - description: The limit indicates the maximum number of items to return in: query name: limit type: integer - description: The offset indicates the starting position of the query in relation to the complete set of unpaginated items in: query name: offset type: integer - description: Filter by active field in: query name: active type: boolean - description: Return results where the created_at field is greater than this value in: query name: created_at.gt type: string - description: Return results where the created_at field is greater than or equal to this value in: query name: created_at.gte type: string - description: Return results where the created_at field is less than this value in: query name: created_at.lt type: string - description: Return results where the created_at field is less than or equal to this value in: query name: created_at.lte type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/WebhookList' "500": description: Internal Server Error schema: $ref: '#/definitions/Error' summary: List webhooks tags: - webhooks post: consumes: - application/json parameters: - description: Add webhook in: body name: webhook required: true schema: $ref: '#/definitions/Webhook' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/Webhook' "400": description: Bad Request schema: $ref: '#/definitions/Error' "500": description: Internal Server Error schema: $ref: '#/definitions/Error' summary: Add an webhook tags: - webhooks /webhooks/{webhook_id}: delete: consumes: - application/json parameters: - description: Webhook ID in: path name: webhook_id required: true type: string produces: - application/json responses: "204": description: No Content "404": description: Not Found schema: $ref: '#/definitions/Error' "500": description: Internal Server Error schema: $ref: '#/definitions/Error' summary: Delete an webhook tags: - webhooks get: consumes: - application/json parameters: - description: Webhook ID in: path name: webhook_id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/Webhook' "404": description: Not Found schema: $ref: '#/definitions/Error' "500": description: Internal Server Error schema: $ref: '#/definitions/Error' summary: Show a webhook tags: - webhooks put: consumes: - application/json parameters: - description: Webhook ID in: path name: webhook_id required: true type: string - description: Update webhook in: body name: webhook required: true schema: $ref: '#/definitions/Webhook' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/Webhook' "400": description: Bad Request schema: $ref: '#/definitions/Error' "404": description: Not Found schema: $ref: '#/definitions/Error' "500": description: Internal Server Error schema: $ref: '#/definitions/Error' summary: Update an webhook tags: - webhooks swagger: "2.0"