{
  "openapi": "3.1.0",
  "info": {
    "title": "AdBid Local API",
    "version": "1.0.0",
    "description": "Design-stage contract. See /docs/conformance for current posture."
  },
  "security": [
    {
      "bearer": []
    }
  ],
  "paths": {
    "/v1/tenants/{tenant_id}": {
      "get": {
        "operationId": "getTenant",
        "parameters": [
          {
            "name": "tenant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tenant"
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/v1/campaigns": {
      "get": {
        "operationId": "listCampaigns",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Campaigns"
          }
        }
      }
    },
    "/v1/decisions/bid": {
      "post": {
        "operationId": "createBidDecision",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "tenant_id",
                  "campaign_id",
                  "warrant_id"
                ],
                "properties": {
                  "tenant_id": {
                    "type": "string"
                  },
                  "campaign_id": {
                    "type": "string"
                  },
                  "warrant_id": {
                    "type": "string"
                  },
                  "expected_revision": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Decision and receipt"
          },
          "409": {
            "description": "Revision conflict"
          },
          "428": {
            "description": "Approval required"
          }
        }
      }
    },
    "/v1/receipts/{receipt_id}": {
      "get": {
        "operationId": "getReceipt",
        "parameters": [
          {
            "name": "receipt_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Receipt"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
