{
  "openapi": "3.1.0",
  "info": {
    "title": "APISync API",
    "version": "2.6.1",
    "description": "Webhook ingest and delivery. Human-readable docs: https://apisynccloud.info/docs/api/",
    "contact": {
      "email": "support@apisynccloud.info"
    }
  },
  "servers": [
    {
      "url": "https://apisynccloud.info/api/v1"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "tags": [
    {
      "name": "Sources",
      "description": "A source is one sender with its own ingest URL."
    },
    {
      "name": "Endpoints",
      "description": "An endpoint is a URL on your side that receives deliveries."
    },
    {
      "name": "Events",
      "description": "Everything ingest accepted, kept for your plan's retention period."
    },
    {
      "name": "Deliveries",
      "description": "One event sent to one endpoint, with all its attempts."
    }
  ],
  "paths": {
    "/sources": {
      "get": {
        "tags": [
          "Sources"
        ],
        "summary": "List sources",
        "operationId": "list_sources",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1-100, default 20.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "Cursor: the id of the last item on the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "id": "src_7Hq2Lw9xVb3e",
                      "object": "source",
                      "name": "Shop orders",
                      "provider": "shopify",
                      "ingest_url": "https://apisynccloud.info/in/src_7Hq2Lw9xVb3e",
                      "verification": {
                        "enabled": true,
                        "last_failure_at": null
                      },
                      "created_at": "2026-11-03T14:16:05Z"
                    }
                  ],
                  "has_more": false
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "tags": [
          "Sources"
        ],
        "summary": "Create a source",
        "operationId": "create_a_source",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Shown in the dashboard. Up to 80 characters."
                  },
                  "provider": {
                    "type": "string",
                    "description": "stripe, github, shopify, mollie, twilio or generic."
                  },
                  "verify_secret": {
                    "type": "string",
                    "description": "The provider's signing secret. When set, requests that fail the provider's signature check are refused at ingest."
                  },
                  "type_path": {
                    "type": "string",
                    "description": "Generic only. JSON Pointer to the event type, default /type."
                  },
                  "verify_header": {
                    "type": "string",
                    "description": "Generic only. Header that carries the HMAC."
                  },
                  "verify_encoding": {
                    "type": "string",
                    "description": "Generic only. hex (default) or base64."
                  },
                  "ingest_url_params": {
                    "type": "object",
                    "description": "Twilio only. Query parameters you added to the URL in the Twilio console."
                  }
                },
                "required": [
                  "name",
                  "provider"
                ]
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Shown in the dashboard. Up to 80 characters."
                  },
                  "provider": {
                    "type": "string",
                    "description": "stripe, github, shopify, mollie, twilio or generic."
                  },
                  "verify_secret": {
                    "type": "string",
                    "description": "The provider's signing secret. When set, requests that fail the provider's signature check are refused at ingest."
                  },
                  "type_path": {
                    "type": "string",
                    "description": "Generic only. JSON Pointer to the event type, default /type."
                  },
                  "verify_header": {
                    "type": "string",
                    "description": "Generic only. Header that carries the HMAC."
                  },
                  "verify_encoding": {
                    "type": "string",
                    "description": "Generic only. hex (default) or base64."
                  },
                  "ingest_url_params": {
                    "type": "object",
                    "description": "Twilio only. Query parameters you added to the URL in the Twilio console."
                  }
                },
                "required": [
                  "name",
                  "provider"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "id": "src_7Hq2Lw9xVb3e",
                  "object": "source",
                  "name": "Shop orders",
                  "provider": "shopify",
                  "ingest_url": "https://apisynccloud.info/in/src_7Hq2Lw9xVb3e",
                  "verification": {
                    "enabled": true,
                    "last_failure_at": null
                  },
                  "created_at": "2026-11-03T14:16:05Z"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/sources/{id}": {
      "get": {
        "tags": [
          "Sources"
        ],
        "summary": "Retrieve a source",
        "operationId": "retrieve_a_source",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "id": "src_7Hq2Lw9xVb3e",
                  "object": "source",
                  "name": "Shop orders",
                  "provider": "shopify",
                  "ingest_url": "https://apisynccloud.info/in/src_7Hq2Lw9xVb3e",
                  "verification": {
                    "enabled": true,
                    "last_failure_at": null
                  },
                  "created_at": "2026-11-03T14:16:05Z"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "tags": [
          "Sources"
        ],
        "summary": "Delete a source",
        "operationId": "delete_a_source",
        "description": "The ingest URL stops accepting requests immediately and returns 404. Events already received are still delivered.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "id": "src_7Hq2Lw9xVb3e",
                  "object": "source",
                  "deleted": true
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/endpoints": {
      "get": {
        "tags": [
          "Endpoints"
        ],
        "summary": "List endpoints",
        "operationId": "list_endpoints",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "enabled or disabled.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1-100, default 20.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "Cursor.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "id": "ep_4mRt8YwQ2kLs",
                      "object": "endpoint",
                      "url": "https://shop.example.com/hooks/apisync",
                      "description": null,
                      "sources": [
                        "src_7Hq2Lw9xVb3e"
                      ],
                      "event_types": [
                        "orders.*",
                        "refunds.create"
                      ],
                      "format": "raw",
                      "max_concurrency": 10,
                      "headers": {},
                      "status": "enabled",
                      "disabled_reason": null,
                      "created_at": "2026-11-03T14:18:52Z",
                      "updated_at": "2026-11-03T14:18:52Z"
                    }
                  ],
                  "has_more": false
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "tags": [
          "Endpoints"
        ],
        "summary": "Create an endpoint",
        "operationId": "create_an_endpoint",
        "description": "The response includes secret. It is only returned here and by rotate_secret.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "HTTPS URL. See URL rules."
                  },
                  "sources": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Source ids this endpoint listens to."
                  },
                  "event_types": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Filters with * wildcards. Default [\"*\"]."
                  },
                  "description": {
                    "type": "string",
                    "description": "Free text, up to 200 characters."
                  },
                  "format": {
                    "type": "string",
                    "description": "raw (default) or envelope."
                  },
                  "max_concurrency": {
                    "type": "integer",
                    "description": "1 up to your plan's maximum. Default 10."
                  },
                  "headers": {
                    "type": "object",
                    "description": "Up to 10 static headers added to every request."
                  }
                },
                "required": [
                  "url",
                  "sources"
                ]
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "HTTPS URL. See URL rules."
                  },
                  "sources": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Source ids this endpoint listens to."
                  },
                  "event_types": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Filters with * wildcards. Default [\"*\"]."
                  },
                  "description": {
                    "type": "string",
                    "description": "Free text, up to 200 characters."
                  },
                  "format": {
                    "type": "string",
                    "description": "raw (default) or envelope."
                  },
                  "max_concurrency": {
                    "type": "integer",
                    "description": "1 up to your plan's maximum. Default 10."
                  },
                  "headers": {
                    "type": "object",
                    "description": "Up to 10 static headers added to every request."
                  }
                },
                "required": [
                  "url",
                  "sources"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "id": "ep_4mRt8YwQ2kLs",
                  "object": "endpoint",
                  "url": "https://shop.example.com/hooks/apisync",
                  "description": null,
                  "sources": [
                    "src_7Hq2Lw9xVb3e"
                  ],
                  "event_types": [
                    "orders.*",
                    "refunds.create"
                  ],
                  "format": "raw",
                  "max_concurrency": 10,
                  "headers": {},
                  "status": "enabled",
                  "disabled_reason": null,
                  "created_at": "2026-11-03T14:18:52Z",
                  "updated_at": "2026-11-03T14:18:52Z",
                  "secret": "whsec_Zq3v8TnR1xKc6pLm0Wb4yJf2"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/endpoints/{id}": {
      "get": {
        "tags": [
          "Endpoints"
        ],
        "summary": "Retrieve an endpoint",
        "operationId": "retrieve_an_endpoint",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "id": "ep_4mRt8YwQ2kLs",
                  "object": "endpoint",
                  "url": "https://shop.example.com/hooks/apisync",
                  "description": null,
                  "sources": [
                    "src_7Hq2Lw9xVb3e"
                  ],
                  "event_types": [
                    "orders.*",
                    "refunds.create"
                  ],
                  "format": "raw",
                  "max_concurrency": 10,
                  "headers": {},
                  "status": "enabled",
                  "disabled_reason": null,
                  "created_at": "2026-11-03T14:18:52Z",
                  "updated_at": "2026-11-03T14:18:52Z"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "tags": [
          "Endpoints"
        ],
        "summary": "Update an endpoint",
        "operationId": "update_an_endpoint",
        "description": "Takes the same fields as create, all optional, plus status. Arrays and headers are replaced, not merged.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "description": "enabled or disabled. Enabling releases deliveries held while the endpoint was disabled."
                  },
                  "url": {
                    "type": "string",
                    "description": "New URL. Applies to attempts from now on."
                  },
                  "event_types": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Replaces the filter list."
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "description": "enabled or disabled. Enabling releases deliveries held while the endpoint was disabled."
                  },
                  "url": {
                    "type": "string",
                    "description": "New URL. Applies to attempts from now on."
                  },
                  "event_types": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Replaces the filter list."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "id": "ep_4mRt8YwQ2kLs",
                  "object": "endpoint",
                  "url": "https://shop.example.com/hooks/apisync",
                  "description": null,
                  "sources": [
                    "src_7Hq2Lw9xVb3e"
                  ],
                  "event_types": [
                    "orders.*",
                    "refunds.*"
                  ],
                  "format": "raw",
                  "max_concurrency": 10,
                  "headers": {},
                  "status": "enabled",
                  "disabled_reason": null,
                  "created_at": "2026-11-03T14:18:52Z",
                  "updated_at": "2026-11-05T09:02:37Z"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "tags": [
          "Endpoints"
        ],
        "summary": "Delete an endpoint",
        "operationId": "delete_an_endpoint",
        "description": "Pending and retrying deliveries to it are cancelled.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "id": "ep_4mRt8YwQ2kLs",
                  "object": "endpoint",
                  "deleted": true
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/endpoints/{id}/rotate_secret": {
      "post": {
        "tags": [
          "Endpoints"
        ],
        "summary": "Rotate an endpoint secret",
        "operationId": "rotate_an_endpoint_secret",
        "description": "Returns a new secret. Until the old one expires, requests carry two signatures.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expire_old_in": {
                    "type": "integer",
                    "description": "Seconds the old secret stays valid. Default 86400, max 604800, 0 to drop it now."
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "expire_old_in": {
                    "type": "integer",
                    "description": "Seconds the old secret stays valid. Default 86400, max 604800, 0 to drop it now."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "id": "ep_4mRt8YwQ2kLs",
                  "object": "endpoint_secret",
                  "secret": "whsec_Lr6Tq0Ve3Nb9Xk2Hc7Wp5Ds1",
                  "old_secret_expires_at": "2026-11-06T09:10:00Z"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/endpoints/{id}/test": {
      "post": {
        "tags": [
          "Endpoints"
        ],
        "summary": "Send a test event",
        "operationId": "send_a_test_event",
        "description": "Creates an apisync.test event and delivers it to this endpoint only, ignoring the filter.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "payload": {
                    "type": "object",
                    "description": "Body to send. Default {\"hello\":\"from APISync\"}."
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "payload": {
                    "type": "object",
                    "description": "Body to send. Default {\"hello\":\"from APISync\"}."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "object": "delivery",
                  "id": "dlv_0Ab3Kx9Wq2Lm5Tz8",
                  "event": "evt_8Yp4Ns1Gv6Rd0Hq3",
                  "endpoint": "ep_4mRt8YwQ2kLs",
                  "status": "pending"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/events": {
      "get": {
        "tags": [
          "Events"
        ],
        "summary": "List events",
        "operationId": "list_events",
        "description": "Newest first. Bodies are not included in lists.",
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "Source id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Exact type or a pattern with *.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "received_after",
            "in": "query",
            "required": false,
            "description": "RFC 3339 timestamp.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "received_before",
            "in": "query",
            "required": false,
            "description": "RFC 3339 timestamp.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1-100, default 20.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "Cursor.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "id": "evt_5Jm1Rk8vQs2Hx7Ta",
                      "object": "event",
                      "source": "src_7Hq2Lw9xVb3e",
                      "type": "orders.create",
                      "received_at": "2026-11-03T14:20:10.912Z",
                      "content_type": "application/json",
                      "size": 2318,
                      "body_encoding": "utf-8",
                      "deliveries": [
                        "dlv_9cXr2TfB0wLq6nPe"
                      ]
                    }
                  ],
                  "has_more": true
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/events/{id}": {
      "get": {
        "tags": [
          "Events"
        ],
        "summary": "Retrieve an event",
        "operationId": "retrieve_an_event",
        "description": "Includes headers and body. Bodies that aren't UTF-8 come base64-encoded.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "id": "evt_5Jm1Rk8vQs2Hx7Ta",
                  "object": "event",
                  "source": "src_7Hq2Lw9xVb3e",
                  "type": "orders.create",
                  "received_at": "2026-11-03T14:20:10.912Z",
                  "content_type": "application/json",
                  "size": 2318,
                  "headers": {
                    "X-Shopify-Topic": "orders/create",
                    "X-Shopify-Webhook-Id": "b54557e4-bdd9-4b37-8a5f-bf7d70bcd043"
                  },
                  "body": "{\"id\":820982911946154500,\"email\":\"jon@example.com\", ...}",
                  "body_encoding": "utf-8",
                  "deliveries": [
                    "dlv_9cXr2TfB0wLq6nPe"
                  ]
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/events/{id}/replay": {
      "post": {
        "tags": [
          "Events"
        ],
        "summary": "Replay an event",
        "operationId": "replay_an_event",
        "description": "Creates new deliveries for an event. Each gets a fresh delivery id and retry schedule; the event id stays the same.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "endpoints": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Endpoint ids. Default: every endpoint that matches now, which may differ from when the event arrived."
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "endpoints": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Endpoint ids. Default: every endpoint that matches now, which may differ from when the event arrived."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "object": "delivery",
                      "id": "dlv_6Wn2Hc8Rt4Kq0Xv1",
                      "endpoint": "ep_4mRt8YwQ2kLs",
                      "status": "pending"
                    }
                  ],
                  "has_more": false
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/deliveries": {
      "get": {
        "tags": [
          "Deliveries"
        ],
        "summary": "List deliveries",
        "operationId": "list_deliveries",
        "parameters": [
          {
            "name": "endpoint",
            "in": "query",
            "required": false,
            "description": "Endpoint id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "description": "Event id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "pending, retrying, succeeded, failed or cancelled.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1-100, default 20.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "Cursor.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "id": "dlv_9cXr2TfB0wLq6nPe",
                      "object": "delivery",
                      "event": "evt_5Jm1Rk8vQs2Hx7Ta",
                      "endpoint": "ep_4mRt8YwQ2kLs",
                      "status": "succeeded",
                      "attempt_count": 3,
                      "next_attempt_at": null,
                      "created_at": "2026-11-03T14:20:10.930Z"
                    }
                  ],
                  "has_more": false
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/deliveries/{id}": {
      "get": {
        "tags": [
          "Deliveries"
        ],
        "summary": "Retrieve a delivery",
        "operationId": "retrieve_a_delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "id": "dlv_9cXr2TfB0wLq6nPe",
                  "object": "delivery",
                  "event": "evt_5Jm1Rk8vQs2Hx7Ta",
                  "endpoint": "ep_4mRt8YwQ2kLs",
                  "status": "succeeded",
                  "attempt_count": 3,
                  "next_attempt_at": null,
                  "created_at": "2026-11-03T14:20:10.930Z",
                  "attempts": [
                    {
                      "number": 1,
                      "started_at": "2026-11-03T14:20:11.004Z",
                      "duration_ms": 15000,
                      "status_code": null,
                      "error": "timeout",
                      "response_body": null
                    },
                    {
                      "number": 2,
                      "started_at": "2026-11-03T14:20:53.316Z",
                      "duration_ms": 412,
                      "status_code": 503,
                      "error": null,
                      "response_body": "<html><head><title>503 Service Temporarily Unavailable</title>..."
                    },
                    {
                      "number": 3,
                      "started_at": "2026-11-03T14:22:41.870Z",
                      "duration_ms": 184,
                      "status_code": 200,
                      "error": null,
                      "response_body": "ok"
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/deliveries/{id}/retry": {
      "post": {
        "tags": [
          "Deliveries"
        ],
        "summary": "Retry a delivery",
        "operationId": "retry_a_delivery",
        "description": "Runs one attempt now. The rest of the schedule is unchanged. Works on failed deliveries too, for one extra attempt.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "object": "delivery",
                  "id": "dlv_3Ve7Lp1Xc9Wb4Ry2",
                  "status": "retrying",
                  "attempt_count": 5,
                  "next_attempt_at": "2026-11-03T15:58:40Z"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/deliveries/{id}/cancel": {
      "post": {
        "tags": [
          "Deliveries"
        ],
        "summary": "Cancel a delivery",
        "operationId": "cancel_a_delivery",
        "description": "Stops further attempts. Has no effect on deliveries that already succeeded or failed.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "object": "delivery",
                  "id": "dlv_3Ve7Lp1Xc9Wb4Ry2",
                  "status": "cancelled",
                  "next_attempt_at": null
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "as_live_... or as_test_..."
      }
    },
    "responses": {
      "Error": {
        "description": "Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "invalid_request",
                        "unauthorized",
                        "forbidden",
                        "not_found",
                        "method_not_allowed",
                        "idempotency_mismatch",
                        "payload_too_large",
                        "validation_failed",
                        "rate_limited",
                        "internal_error",
                        "unavailable"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    }
  }
}
