{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/BadRequestResponse",
  "title": "BadRequestResponse",
  "type": "object",
  "x-apideck-schema-id": "BadRequest",
  "properties": {
    "status_code": {
      "type": "number",
      "description": "HTTP status code",
      "example": 400
    },
    "error": {
      "type": "string",
      "description": "Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231)",
      "example": "Bad Request"
    },
    "type_name": {
      "type": "string",
      "description": "The type of error returned",
      "example": "RequestValidationError"
    },
    "message": {
      "type": "string",
      "description": "A human-readable message providing more details about the error.",
      "example": "Invalid Params",
      "x-speakeasy-error-message": true
    },
    "detail": {
      "anyOf": [
        {
          "type": "string",
          "example": "Missing property foobar"
        },
        {
          "type": "object",
          "x-speakeasy-detail": true,
          "example": {
            "missing": [
              {
                "foobar": "required"
              }
            ]
          }
        }
      ],
      "description": "Contains parameter or domain specific information related to the error and why it occurred."
    },
    "ref": {
      "type": "string",
      "description": "Link to documentation of error type",
      "example": "https://developers.apideck.com/errors#requestvalidationerror"
    },
    "downstream_errors": {
      "type": "array",
      "description": "Contains downstream errors returned from the connector. Only present when type_name is ConnectorExecutionError.",
      "items": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message from the downstream provider"
          },
          "detail": {
            "type": "string",
            "description": "Additional error details"
          },
          "code": {
            "type": "string",
            "description": "Error code from the downstream provider"
          }
        }
      },
      "example": [
        {
          "message": "Account code '100' has been archived or deleted",
          "detail": "Each line item must reference a valid account",
          "code": "VALIDATION_ERROR"
        }
      ]
    }
  }
}