{
  "openapi": "3.1.0",
  "info": {
    "title": "MANQR Community API",
    "version": "2.0.0",
    "summary": "Read-only public API for the nail designs people share in the MANQR Community.",
    "description": "Browse, search and look up public nail and hand designs made with MANQR, the 3D nail design app for iPhone and iPad. No authentication: every operation here works without a key or session. Responses are JSON and may be cached for 30 seconds (see Cache-Control). The endpoints are not metered per client; keep to a few requests per second and back off on 429 or 5xx. Signed-in endpoints (sharing, likes, follows, reports) belong to the MANQR apps and are not part of this public API. Human-readable guide: https://manqr.me/docs/",
    "contact": {
      "name": "MANQR support",
      "email": "support@manqr.app",
      "url": "https://manqr.me/contact/"
    },
    "termsOfService": "https://manqr.me/agb/"
  },
  "externalDocs": {
    "description": "MANQR API documentation",
    "url": "https://manqr.me/docs/"
  },
  "servers": [
    { "url": "https://v2.api.manqr.me", "description": "Production" }
  ],
  "security": [],
  "tags": [
    { "name": "Community", "description": "Public nail and hand designs shared from the MANQR apps." }
  ],
  "paths": {
    "/api/community/posts": {
      "get": {
        "tags": ["Community"],
        "operationId": "listCommunityPosts",
        "summary": "List public designs",
        "description": "Returns one page of public Community designs, newest first or most liked first. Pass `next_cursor` from the previous page as `cursor` to get the next page; `next_cursor` is null on the last page.",
        "parameters": [
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "`new` = newest first, `popular` = most liked first.",
            "schema": { "type": "string", "enum": ["new", "popular"], "default": "new" }
          },
          { "$ref": "#/components/parameters/Cursor" },
          { "$ref": "#/components/parameters/Limit" }
        ],
        "responses": {
          "200": {
            "description": "One page of designs.",
            "headers": { "Cache-Control": { "$ref": "#/components/headers/CacheControl" } },
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PostPage" } } }
          },
          "400": { "$ref": "#/components/responses/BadRequest" }
        }
      }
    },
    "/api/community/posts/{id}": {
      "get": {
        "tags": ["Community"],
        "operationId": "getCommunityPost",
        "summary": "Get one design",
        "description": "Returns a single public design by its id, the id in a share link `https://manqr.me/d/<id>`. Hidden, removed and unknown designs answer 404.",
        "parameters": [{ "$ref": "#/components/parameters/PostId" }],
        "responses": {
          "200": {
            "description": "The design.",
            "headers": { "Cache-Control": { "$ref": "#/components/headers/CacheControl" } },
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Post" } } }
          },
          "404": { "$ref": "#/components/responses/NotFound" }
        }
      }
    },
    "/api/community/posts/{id}/linked": {
      "get": {
        "tags": ["Community"],
        "operationId": "listLinkedCommunityPosts",
        "summary": "List designs linked to a design",
        "description": "Returns the public designs linked with this one (a link made from either design counts), newest first, without pagination.",
        "parameters": [{ "$ref": "#/components/parameters/PostId" }],
        "responses": {
          "200": {
            "description": "The linked designs.",
            "headers": { "Cache-Control": { "$ref": "#/components/headers/CacheControl" } },
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PostList" } } }
          },
          "404": { "$ref": "#/components/responses/NotFound" }
        }
      }
    },
    "/api/community/posts/{id}/remixes": {
      "get": {
        "tags": ["Community"],
        "operationId": "listCommunityPostRemixes",
        "summary": "List remixes of a design",
        "description": "Returns one page of public designs that were remixed from this design, newest first.",
        "parameters": [
          { "$ref": "#/components/parameters/PostId" },
          { "$ref": "#/components/parameters/Cursor" },
          { "$ref": "#/components/parameters/Limit" }
        ],
        "responses": {
          "200": {
            "description": "One page of remixes.",
            "headers": { "Cache-Control": { "$ref": "#/components/headers/CacheControl" } },
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PostPage" } } }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "404": { "$ref": "#/components/responses/NotFound" }
        }
      }
    },
    "/api/community/search": {
      "get": {
        "tags": ["Community"],
        "operationId": "searchCommunity",
        "summary": "Search designs and creators",
        "description": "Case-insensitive substring search over design titles and creator usernames. The first page (no `cursor`) also returns up to 10 matching creators; later pages return an empty `users` array. Pages hold up to 24 designs, newest first.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Search text, 2 to 50 characters.",
            "schema": { "type": "string", "minLength": 2, "maxLength": 50 }
          },
          { "$ref": "#/components/parameters/Cursor" }
        ],
        "responses": {
          "200": {
            "description": "Matching creators and one page of matching designs.",
            "headers": { "Cache-Control": { "$ref": "#/components/headers/CacheControl" } },
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SearchResult" } } }
          },
          "400": { "$ref": "#/components/responses/BadRequest" }
        }
      }
    },
    "/api/community/users/{username}": {
      "get": {
        "tags": ["Community"],
        "operationId": "getCommunityUser",
        "summary": "Get a creator profile",
        "description": "Returns a creator's public profile: avatar, number of public designs, followers and accounts followed.",
        "parameters": [{ "$ref": "#/components/parameters/Username" }],
        "responses": {
          "200": {
            "description": "The profile.",
            "headers": { "Cache-Control": { "$ref": "#/components/headers/CacheControl" } },
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserProfile" } } }
          },
          "404": { "$ref": "#/components/responses/NotFound" }
        }
      }
    },
    "/api/community/users/{username}/posts": {
      "get": {
        "tags": ["Community"],
        "operationId": "listCommunityUserPosts",
        "summary": "List a creator's designs",
        "description": "Returns one page of a creator's public designs, newest first.",
        "parameters": [
          { "$ref": "#/components/parameters/Username" },
          { "$ref": "#/components/parameters/Cursor" },
          { "$ref": "#/components/parameters/Limit" }
        ],
        "responses": {
          "200": {
            "description": "One page of the creator's designs.",
            "headers": { "Cache-Control": { "$ref": "#/components/headers/CacheControl" } },
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PostPage" } } }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "404": { "$ref": "#/components/responses/NotFound" }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "PostId": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "Design id, as in `https://manqr.me/d/<id>`.",
        "schema": { "type": "string", "pattern": "^[A-Za-z0-9_-]{1,32}$" }
      },
      "Username": {
        "name": "username",
        "in": "path",
        "required": true,
        "description": "Creator username, without the leading @.",
        "schema": { "type": "string", "minLength": 1 }
      },
      "Cursor": {
        "name": "cursor",
        "in": "query",
        "required": false,
        "description": "Opaque `next_cursor` from the previous page. Omit for the first page.",
        "schema": { "type": "string", "maxLength": 200 }
      },
      "Limit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "description": "Designs per page.",
        "schema": { "type": "integer", "minimum": 1, "maximum": 48, "default": 24 }
      }
    },
    "headers": {
      "CacheControl": {
        "description": "`public, max-age=30, stale-while-revalidate=120` for anonymous requests.",
        "schema": { "type": "string" }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "A query parameter is missing or out of range.",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
      },
      "NotFound": {
        "description": "No public design or creator with that id or username (`code` is `POST_NOT_FOUND` or `USER_NOT_FOUND`).",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "description": "Error body. Switch on `code` when present, never on `message`.",
        "required": ["error", "message"],
        "properties": {
          "error": { "type": "string", "description": "HTTP reason phrase, e.g. `Not Found`." },
          "message": { "type": "string", "description": "Human-readable explanation." },
          "code": { "type": "string", "description": "Machine-readable error code, e.g. `POST_NOT_FOUND`." }
        }
      },
      "AvatarConfig": {
        "type": "object",
        "description": "The creator's avatar as a configuration object (colors and part types) that the MANQR apps render. Use `avatar_url` for a ready-made SVG.",
        "additionalProperties": true
      },
      "Author": {
        "type": "object",
        "required": ["username", "avatar_json", "avatar_url"],
        "properties": {
          "username": { "type": "string", "description": "Creator username, without the leading @." },
          "avatar_json": { "anyOf": [{ "$ref": "#/components/schemas/AvatarConfig" }, { "type": "null" }] },
          "avatar_url": { "type": ["string", "null"], "format": "uri", "description": "Absolute URL of the avatar as SVG." },
          "official": { "type": "boolean", "description": "True for the official MANQR account, whose posts are the official designs." }
        }
      },
      "RemixOf": {
        "type": "object",
        "description": "The design this one was remixed from.",
        "required": ["id", "title", "author"],
        "properties": {
          "id": { "type": "string" },
          "title": { "type": ["string", "null"] },
          "author": {
            "type": "object",
            "required": ["username", "avatar_url"],
            "properties": {
              "username": { "type": "string" },
              "avatar_url": { "type": ["string", "null"], "format": "uri" },
              "official": { "type": "boolean" }
            }
          }
        }
      },
      "Post": {
        "type": "object",
        "description": "A public design. The page for people is `https://manqr.me/d/<id>`.",
        "required": ["id", "design_type", "title", "preview_url", "allow_remix", "like_count", "remix_count", "created_at", "author", "background", "uses_premium", "remix_of", "liked_by_me", "is_mine"],
        "properties": {
          "id": { "type": "string", "description": "Design id." },
          "design_type": { "type": "string", "enum": ["nail", "hand"], "description": "A single nail or a whole hand." },
          "title": { "type": ["string", "null"], "description": "Title chosen by the creator, null when untitled." },
          "preview_url": { "type": "string", "format": "uri", "description": "Absolute URL of the preview image (WebP). Public and immutable." },
          "allow_remix": { "type": "boolean", "description": "Whether the creator lets others remix the design in the app." },
          "like_count": { "type": "integer", "minimum": 0 },
          "remix_count": { "type": "integer", "minimum": 0 },
          "created_at": { "type": "string", "format": "date-time" },
          "author": { "$ref": "#/components/schemas/Author" },
          "background": { "type": ["object", "null"], "additionalProperties": true, "description": "Backdrop chosen by the creator, as an opaque spec the apps render. Null when none." },
          "uses_premium": { "type": "boolean", "description": "The design uses MANQR Premium features, so only Premium members can remix it." },
          "remix_of": { "anyOf": [{ "$ref": "#/components/schemas/RemixOf" }, { "type": "null" }] },
          "liked_by_me": { "type": ["boolean", "null"], "description": "Always null without a session." },
          "is_mine": { "type": "boolean", "description": "Always false without a session." },
          "code": { "type": ["string", "null"], "description": "Design code that adds this design in the MANQR app. Only returned by getCommunityPost; null when the design has no code, for example because the creator turned remixing off." }
        }
      },
      "PostPage": {
        "type": "object",
        "required": ["posts", "next_cursor"],
        "properties": {
          "posts": { "type": "array", "items": { "$ref": "#/components/schemas/Post" } },
          "next_cursor": { "type": ["string", "null"], "description": "Pass as `cursor` for the next page. Null on the last page." }
        }
      },
      "PostList": {
        "type": "object",
        "required": ["posts"],
        "properties": {
          "posts": { "type": "array", "items": { "$ref": "#/components/schemas/Post" } }
        }
      },
      "UserSummary": {
        "type": "object",
        "required": ["username", "avatar_url", "avatar_json", "follower_count", "is_following"],
        "properties": {
          "username": { "type": "string" },
          "avatar_url": { "type": ["string", "null"], "format": "uri" },
          "avatar_json": { "anyOf": [{ "$ref": "#/components/schemas/AvatarConfig" }, { "type": "null" }] },
          "official": { "type": "boolean" },
          "follower_count": { "type": "integer", "minimum": 0 },
          "is_following": { "type": ["boolean", "null"], "description": "Always null without a session." }
        }
      },
      "UserProfile": {
        "type": "object",
        "required": ["username", "avatar_url", "avatar_json", "post_count", "follower_count", "following_count", "is_following", "is_me"],
        "properties": {
          "username": { "type": "string" },
          "avatar_url": { "type": ["string", "null"], "format": "uri" },
          "avatar_json": { "anyOf": [{ "$ref": "#/components/schemas/AvatarConfig" }, { "type": "null" }] },
          "official": { "type": "boolean" },
          "post_count": { "type": "integer", "minimum": 0, "description": "Number of public designs." },
          "follower_count": { "type": "integer", "minimum": 0 },
          "following_count": { "type": "integer", "minimum": 0 },
          "is_following": { "type": ["boolean", "null"], "description": "Always null without a session." },
          "is_me": { "type": "boolean", "description": "Always false without a session." }
        }
      },
      "SearchResult": {
        "type": "object",
        "required": ["users", "posts", "next_cursor"],
        "properties": {
          "users": { "type": "array", "maxItems": 10, "items": { "$ref": "#/components/schemas/UserSummary" } },
          "posts": { "type": "array", "items": { "$ref": "#/components/schemas/Post" } },
          "next_cursor": { "type": ["string", "null"] }
        }
      }
    }
  }
}
