{
  "openapi": "3.1.0",
  "info": {
    "title": "Bucketlist.nl Dream of the Day API",
    "version": "1.0.0",
    "description": "Returns one published Bucketlist.nl experience with its own image, canonical source URL and referral URL. The selection changes daily in the Europe/Amsterdam time zone.",
    "contact": {
      "name": "Bucketlist.nl",
      "url": "https://bucketlist.nl/samenwerken?lang=en#droom-van-de-dag",
      "email": "support@bucketlist.nl"
    },
    "termsOfService": "https://bucketlist.nl/algemene-voorwaarden"
  },
  "externalDocs": {
    "description": "Documentation, examples and embed instructions",
    "url": "https://bucketlist.nl/samenwerken?lang=en#droom-van-de-dag"
  },
  "x-postman-collection": "https://bucketlist.nl/brand/droom-van-de-dag.postman_collection.json",
  "servers": [
    {
      "url": "https://bucketlist.nl"
    }
  ],
  "paths": {
    "/api/droom-van-de-dag": {
      "get": {
        "operationId": "getDreamOfTheDay",
        "summary": "Get the current dream of the day",
        "description": "No authentication is required. Responses support CORS and should be cached according to their Cache-Control header.",
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "description": "Limit the selection to the Netherlands or use worldwide inspiration.",
            "schema": {
              "type": "string",
              "enum": ["nederland", "wereld"],
              "default": "nederland"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "description": "Language used for the returned experience fields.",
            "schema": {
              "type": "string",
              "enum": ["nl", "en", "de", "fr", "es"],
              "default": "nl"
            }
          },
          {
            "name": "theme",
            "in": "query",
            "description": "Optional editorial theme. The API falls back to the complete image-ready selection when no matching dream is available.",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The current dream and source attribution.",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": { "type": "string", "const": "*" }
              },
              "Cache-Control": {
                "schema": { "type": "string" }
              }
            },
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/DreamResponse" }
              }
            }
          },
          "503": {
            "description": "No suitable published dream is currently available.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": { "type": "string", "const": "no_dream_available" }
                  },
                  "required": ["error"]
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "DreamResponse": {
        "type": "object",
        "properties": {
          "date": { "type": "string", "format": "date" },
          "scope": { "type": "string", "enum": ["nederland", "wereld"] },
          "language": { "type": "string", "enum": ["nl", "en", "de", "fr", "es"] },
          "requestedTheme": { "type": ["string", "null"] },
          "dream": {
            "type": "object",
            "properties": {
              "title": { "type": "string" },
              "slug": { "type": "string" },
              "theme": { "type": "string" },
              "destination": { "type": ["string", "null"] },
              "image": {
                "type": "object",
                "properties": {
                  "url": { "type": "string", "format": "uri" },
                  "alt": { "type": "string" }
                },
                "required": ["url", "alt"]
              },
              "canonicalUrl": { "type": "string", "format": "uri" },
              "referralUrl": { "type": "string", "format": "uri" }
            },
            "required": ["title", "slug", "theme", "destination", "image", "canonicalUrl", "referralUrl"]
          },
          "attribution": {
            "type": "object",
            "properties": {
              "name": { "type": "string" },
              "url": { "type": "string", "format": "uri" },
              "documentationUrl": { "type": "string", "format": "uri" }
            },
            "required": ["name", "url", "documentationUrl"]
          }
        },
        "required": ["date", "scope", "language", "requestedTheme", "dream", "attribution"]
      }
    }
  }
}
