{
  "openapi": "3.1.0",
  "info": {
    "title": "DJ.Studio website API",
    "version": "1.0.0",
    "summary": "Public endpoints of the dj.studio marketing website.",
    "description": "The public, unauthenticated endpoints behind https://dj.studio. The DJ.Studio app itself (projects, mixes, accounts) has no public API.\n\nContent for agents: every page answers `Accept: text/markdown` with a Markdown version (Content-Type `text/markdown`, `Vary: Accept`) where one exists, and unknown pages return a Markdown 404. The page index is at https://dj.studio/llms.txt and the full text at https://dj.studio/llms-full.txt.\n\nErrors: API errors are JSON objects matching the `Error` schema, with a stable `code` and a `hint` on how to recover. Unknown `/api/*` paths return a JSON 404 with code `not_found`.\n\nRate limits: metered endpoints send the IETF RateLimit headers (draft-ietf-httpapi-ratelimit-headers) on every response, so clients can throttle themselves. `RateLimit-Policy: \"<policy>\";q=<requests>;w=<window seconds>` names the quota and `RateLimit: \"<policy>\";r=<remaining>;t=<seconds until reset>` the current state. The same numbers are also sent as `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` (seconds) for clients that read the older header names. When the quota is used up the response is a 429 with a `Retry-After` header (seconds) and an `Error` body with code `rate_limited`; wait at least that long before retrying. Quotas are counted per client IP in fixed windows that start with the first request: `newsletter` 10 requests per 600 seconds (`/api/v1/newsletter-subscribe`), `language` 60 per 60 seconds (`/api/v1/language`) and `api` 60 per 60 seconds (unknown `/api/*` paths). Counts are kept per server instance, so treat the headers, not the published numbers, as authoritative. `/api/v1/og` is served from the CDN cache and is not metered.\n\nVersioning: the API is versioned in the URL path (`/api/v1/...`). Within a major version only backwards-compatible changes are made (new endpoints, new optional request fields, new response fields); a breaking change gets a new path such as `/api/v2/...`. The unversioned paths (`/api/newsletter-subscribe`, `/api/language`, `/api/og`) are aliases of v1 that the website itself uses.\n\nDeprecation: before a version or endpoint is removed, its responses carry a `Deprecation` header (RFC 9745), a `Sunset` header (RFC 8594) with the removal date and a `Link` header with `rel=\"deprecation\"` pointing to https://dj.studio/developers. The sunset date is at least six months after the deprecation is announced. Deprecated operations are also marked `deprecated: true` in this document. Nothing is deprecated today.\n\nAuthentication: all endpoints are anonymous; there are no API keys, OAuth scopes or sandbox.",
    "contact": {
      "name": "DJ.Studio support",
      "url": "https://dj.studio/contact"
    },
    "termsOfService": "https://dj.studio/eula.pdf"
  },
  "externalDocs": {
    "description": "DJ.Studio developer portal",
    "url": "https://dj.studio/developers"
  },
  "servers": [
    {
      "url": "https://dj.studio"
    }
  ],
  "security": [],
  "tags": [
    {
      "name": "Newsletter",
      "description": "Mailing list sign-up."
    },
    {
      "name": "Site",
      "description": "Language preference and share images."
    }
  ],
  "paths": {
    "/api/v1/newsletter-subscribe": {
      "post": {
        "operationId": "subscribeToNewsletter",
        "tags": [
          "Newsletter"
        ],
        "summary": "Subscribe an email address to the DJ.Studio newsletter",
        "description": "Adds the address to the DJ.Studio newsletter list. Only submit an address with the explicit consent of its owner. Rate limited to 10 requests per 600 seconds per client (policy `newsletter`).",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 200,
                    "description": "Address to subscribe. Stored in lowercase."
                  }
                }
              },
              "example": {
                "email": "dj@example.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The address is subscribed (or was already subscribed).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "campaignMonitorStatus": {
                      "type": "integer",
                      "description": "HTTP status returned by the mailing list provider."
                    },
                    "data": {
                      "description": "Response body of the mailing list provider."
                    }
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/NewsletterError"
          },
          "405": {
            "$ref": "#/components/responses/NewsletterError"
          },
          "429": {
            "$ref": "#/components/responses/NewsletterTooManyRequests"
          },
          "502": {
            "$ref": "#/components/responses/NewsletterError"
          }
        }
      }
    },
    "/api/v1/language": {
      "get": {
        "operationId": "setSiteLanguage",
        "tags": [
          "Site"
        ],
        "summary": "Switch the site language and go to the matching page",
        "description": "Stores the language preference in a cookie and redirects (303) to the counterpart of `return` in that language. Only same-site paths are accepted for `return`; anything else redirects to the homepage. Rate limited to 60 requests per 60 seconds per client (policy `language`).",
        "security": [],
        "parameters": [
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Language to switch to. Anything other than `de` means English.",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "de"
              ],
              "default": "en"
            }
          },
          {
            "name": "return",
            "in": "query",
            "required": false,
            "description": "Same-site path to return to, for example `/pricing`.",
            "schema": {
              "type": "string",
              "default": "/"
            }
          }
        ],
        "responses": {
          "303": {
            "description": "Redirect to the page in the chosen language.",
            "headers": {
              "Location": {
                "description": "The page to go to.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "Set-Cookie": {
                "description": "`__djs_lang_pref=<en|de>`, valid for one year.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/api/v1/og": {
      "get": {
        "operationId": "getShareImage",
        "tags": [
          "Site"
        ],
        "summary": "Render a DJ.Studio branded share image",
        "description": "Returns a 1200x630 PNG with the DJ.Studio logo, a title and an optional description, as used for Open Graph previews. Served from the CDN cache and not rate limited.",
        "security": [],
        "parameters": [
          {
            "name": "title",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "description",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The share image.",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "image/png"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "description": "Error body returned by the API.",
        "required": [
          "error",
          "code",
          "status"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Human-readable message."
          },
          "code": {
            "type": "string",
            "description": "Stable machine-readable error code.",
            "examples": [
              "not_found",
              "method_not_allowed",
              "email_required",
              "subscription_failed",
              "rate_limited"
            ]
          },
          "status": {
            "type": "integer",
            "description": "HTTP status code of the response."
          },
          "hint": {
            "type": "string",
            "description": "How to fix the request or what to try next."
          },
          "docs": {
            "type": "string",
            "format": "uri",
            "description": "Where the API is described.",
            "const": "https://dj.studio/openapi.json"
          }
        }
      }
    },
    "responses": {
      "NewsletterError": {
        "description": "The subscription was not made. `success` is always false.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Error"
                },
                {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": false
                    }
                  }
                }
              ]
            },
            "example": {
              "error": "Email body is not provided",
              "code": "email_required",
              "status": 400,
              "hint": "Send a JSON body with an \"email\" string and Content-Type: application/json.",
              "docs": "https://dj.studio/openapi.json",
              "success": false
            }
          }
        },
        "headers": {
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          },
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          }
        }
      },
      "TooManyRequests": {
        "description": "The rate limit for this endpoint is used up. Wait `Retry-After` seconds before retrying.",
        "headers": {
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          },
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          },
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "Too many requests",
              "code": "rate_limited",
              "status": 429,
              "hint": "The \"language\" limit is 60 requests per 60 seconds. Retry after 42 seconds (see the Retry-After header).",
              "docs": "https://dj.studio/openapi.json"
            }
          }
        }
      },
      "NewsletterTooManyRequests": {
        "description": "The rate limit for this endpoint is used up. Wait `Retry-After` seconds before retrying. `success` is always false.",
        "headers": {
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          },
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          },
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Error"
                },
                {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": false
                    }
                  }
                }
              ]
            },
            "example": {
              "error": "Too many requests",
              "code": "rate_limited",
              "status": 429,
              "hint": "The \"newsletter\" limit is 10 requests per 600 seconds. Retry after 412 seconds (see the Retry-After header).",
              "docs": "https://dj.studio/openapi.json",
              "success": false
            }
          }
        }
      }
    },
    "headers": {
      "RateLimit-Policy": {
        "description": "Quota policy: `\"<policy>\";q=<requests>;w=<window seconds>`.",
        "schema": {
          "type": "string"
        },
        "example": "\"newsletter\";q=10;w=600"
      },
      "RateLimit": {
        "description": "Current state of the quota: `\"<policy>\";r=<remaining requests>;t=<seconds until the window resets>`.",
        "schema": {
          "type": "string"
        },
        "example": "\"newsletter\";r=9;t=600"
      },
      "RateLimit-Limit": {
        "description": "Requests allowed per window (older header form).",
        "schema": {
          "type": "integer"
        },
        "example": 10
      },
      "RateLimit-Remaining": {
        "description": "Requests left in the current window (older header form).",
        "schema": {
          "type": "integer"
        },
        "example": 9
      },
      "RateLimit-Reset": {
        "description": "Seconds until the window resets (older header form).",
        "schema": {
          "type": "integer"
        },
        "example": 600
      },
      "Retry-After": {
        "description": "Seconds to wait before retrying. Only sent with a 429.",
        "schema": {
          "type": "integer"
        },
        "example": 412
      },
      "Deprecation": {
        "description": "Sent once an operation is deprecated (RFC 9745): `@<unix time>` of the deprecation. Not sent today.",
        "schema": {
          "type": "string"
        },
        "example": "@1798761600"
      },
      "Sunset": {
        "description": "Sent with `Deprecation` (RFC 8594): HTTP date after which the operation may be removed, at least six months after the deprecation.",
        "schema": {
          "type": "string"
        },
        "example": "Wed, 30 Jun 2027 00:00:00 GMT"
      }
    }
  }
}
