{
  "openapi": "3.1.0",
  "info": {
    "title": "OpenTweet API",
    "version": "1.1.0",
    "description": "Post, schedule, and manage X (Twitter) content from your code or an AI agent. One API key, no X developer account, no OAuth. The same call can cross-post to Bluesky, which issues no API keys at all: OpenTweet connects over atproto OAuth, so there is nothing to apply for and no password or App Password is ever pasted in. It can also post to a LinkedIn personal profile connected with one LinkedIn sign-in. See https://opentweet.io/docs for guides and https://opentweet.io/docs/cross-posting for the cross-posting rules.",
    "contact": { "name": "OpenTweet", "url": "https://opentweet.io/docs" }
  },
  "servers": [{ "url": "https://opentweet.io/api/v1", "description": "Production" }],
  "security": [{ "bearerAuth": [] }],
  "tags": [
    { "name": "Posts", "description": "Create, schedule, and manage tweets and threads" },
    { "name": "Articles", "description": "Long-form X Articles" },
    { "name": "Accounts", "description": "Account and connected X profiles" },
    { "name": "Cross-posting", "description": "Where a post goes: X, Bluesky, LinkedIn, or any mix" },
    { "name": "Media", "description": "Upload media for posts" },
    { "name": "Analytics", "description": "Posting analytics" }
  ],
  "paths": {
    "/posts": {
      "get": {
        "tags": ["Posts"],
        "summary": "List posts",
        "description": "List your tweets, optionally filtered by status.",
        "parameters": [
          { "name": "status", "in": "query", "schema": { "type": "string", "enum": ["draft", "scheduled", "posted", "failed"] } },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "default": 20, "maximum": 100 } },
          { "name": "x_account_id", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": { "200": { "description": "A list of posts", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PostList" } } } } }
      },
      "post": {
        "tags": ["Posts"],
        "summary": "Create a tweet, thread, or scheduled post",
        "description": "Creates a post on X, Bluesky, LinkedIn, or any mix. Use `platforms` to name the networks. Omitting `platforms` does NOT mean X only: an unspecified post follows the account's auto cross-post setting, and with that setting on it goes to every connected platform. Call GET /cross-posting to see where an unspecified post would land before you send one.",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePost" } } } },
        "responses": {
          "201": { "description": "Post created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Post" } } } },
          "400": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "401": { "description": "Missing or invalid API key" }
        }
      }
    },
    "/posts/{id}": {
      "get": {
        "tags": ["Posts"],
        "summary": "Get a post",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "description": "The post", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Post" } } } }, "404": { "description": "Not found" } }
      },
      "delete": {
        "tags": ["Posts"],
        "summary": "Delete a post",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "description": "Deleted" } }
      }
    },
    "/posts/{id}/publish": {
      "post": {
        "tags": ["Posts"],
        "summary": "Publish a draft or scheduled post immediately",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "description": "Published" } }
      }
    },
    "/posts/batch-schedule": {
      "post": {
        "tags": ["Posts"],
        "summary": "Schedule up to 50 posts in one call",
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": {
            "type": "object",
            "required": ["schedules"],
            "properties": { "schedules": { "type": "array", "maxItems": 50, "items": {
              "type": "object",
              "required": ["post_id", "scheduled_date"],
              "properties": { "post_id": { "type": "string" }, "scheduled_date": { "type": "string", "format": "date-time" } }
            } } }
          } } }
        },
        "responses": { "200": { "description": "Scheduled" } }
      }
    },
    "/posts/import-csv": {
      "post": {
        "tags": ["Posts"],
        "summary": "Turn a CSV into posts with AI, scheduled from each row's date and time",
        "description": "Each row becomes a post written from the prompt. With schedule, rows with a future date and time (one cell like 2027-10-21 18:26, or date and time columns) are scheduled at it; other posts are drafts. Up to 50 rows per request, 1 AI generation per started 25 rows.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": { "schema": {
              "type": "object",
              "required": ["csv", "prompt"],
              "properties": {
                "csv": { "type": "string", "description": "CSV text with a header row, up to 50 data rows" },
                "prompt": { "type": "string", "minLength": 3, "maxLength": 2000, "description": "How the AI should turn each row into a post" },
                "schedule": {
                  "description": "true finds the date (and time) columns; or name them. Omit to create drafts only.",
                  "oneOf": [
                    { "type": "boolean", "enum": [true] },
                    { "type": "object", "required": ["date_column"], "properties": { "date_column": { "type": "string" }, "time_column": { "type": "string" }, "order": { "type": "string", "enum": ["dmy", "mdy"] } } }
                  ]
                },
                "timezone": { "type": "string", "description": "IANA timezone for times in the file. Default: the account timezone, else UTC" },
                "group_name": { "type": "string" },
                "x_account_id": { "type": "string" }
              }
            } },
            "multipart/form-data": { "schema": {
              "type": "object",
              "required": ["file", "prompt"],
              "properties": {
                "file": { "type": "string", "format": "binary" },
                "prompt": { "type": "string" },
                "schedule": { "type": "string", "description": "\"true\" or the schedule object as JSON" },
                "timezone": { "type": "string" },
                "group_name": { "type": "string" },
                "x_account_id": { "type": "string" }
              }
            } }
          }
        },
        "responses": {
          "201": { "description": "Posts created; each has status draft or scheduled, plus a schedule summary when schedule was sent" },
          "400": { "description": "Invalid CSV, prompt or schedule" },
          "403": { "description": "Subscription required, X not connected, queue full or today's limit reached" },
          "429": { "description": "Daily AI generation limit reached" },
          "502": { "description": "The AI could not write posts" }
        }
      }
    },
    "/articles": {
      "get": {
        "tags": ["Articles"],
        "summary": "List X Articles",
        "description": "List your long-form X Articles, newest first.",
        "parameters": [
          { "name": "status", "in": "query", "schema": { "type": "string", "enum": ["draft", "scheduled", "publishing", "published", "failed"] } },
          { "name": "page", "in": "query", "schema": { "type": "integer", "default": 1 } },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "default": 20, "maximum": 100 } },
          { "name": "x_account_id", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": { "200": { "description": "List of articles", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ArticleList" } } } } }
      },
      "post": {
        "tags": ["Articles"],
        "summary": "Create a long-form X Article",
        "description": "Creates an article from markdown. With no scheduled_date and no publish_now it is saved as a draft. Requires a paid plan (Pro, Advanced, or Agency); trials are excluded. Publishing also requires the connected X account to have X Premium.",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateArticle" } } } },
        "responses": {
          "201": { "description": "Article created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ArticleEnvelope" } } } },
          "403": { "description": "Plan does not include Articles", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "502": { "description": "publish_now was set and X rejected the article", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      }
    },
    "/articles/{id}": {
      "get": {
        "tags": ["Articles"],
        "summary": "Get an article",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "description": "The article", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ArticleEnvelope" } } } } }
      },
      "put": {
        "tags": ["Articles"],
        "summary": "Update a draft, scheduled, or failed article",
        "description": "Every field is optional. Send scheduled_date to schedule or reschedule, or null to unschedule back to draft. Updating a failed article clears the failure. Published articles cannot be edited.",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateArticle" } } } },
        "responses": {
          "200": { "description": "Article updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ArticleEnvelope" } } } },
          "400": { "description": "Article is already published", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "409": { "description": "Article is publishing or still being written by AI", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      },
      "delete": {
        "tags": ["Articles"],
        "summary": "Delete an article",
        "description": "Removes the article from OpenTweet. An already published article stays on X.",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "description": "Deleted" } }
      }
    },
    "/articles/{id}/publish": {
      "post": {
        "tags": ["Articles"],
        "summary": "Publish an article to X immediately",
        "description": "Publishes a draft, scheduled, or failed article right now. No request body.",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": {
          "200": { "description": "Published", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ArticleEnvelope" } } } },
          "400": { "description": "Article is already published", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "403": { "description": "Plan does not include Articles", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "409": { "description": "Article is already being published", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "502": { "description": "X rejected the article, for example the account is not eligible for Articles", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      }
    },
    "/accounts": {
      "get": { "tags": ["Accounts"], "summary": "List connected X accounts", "responses": { "200": { "description": "Connected accounts" } } }
    },
    "/cross-posting": {
      "get": {
        "tags": ["Cross-posting"],
        "summary": "Where a post would go, and what each network accepts",
        "description": "Reports the account's auto cross-post setting, the networks a post that omits `platforms` would be attempted on, the subset that will actually land, and each network's current limits. The setting is account-level and can change without your code changing, so read this rather than assuming. If your integration cares where a post lands, send `platforms` explicitly on every create.",
        "responses": {
          "200": { "description": "Cross-posting state", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CrossPosting" } } } },
          "401": { "description": "Missing or invalid API key" }
        }
      }
    },
    "/me": {
      "get": { "tags": ["Accounts"], "summary": "Get account status", "description": "Subscription plan, daily limits, post counts, connected accounts.", "responses": { "200": { "description": "Account status" }, "401": { "description": "Missing or invalid API key" } } }
    },
    "/upload": {
      "post": {
        "tags": ["Media"],
        "summary": "Upload media",
        "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "file": { "type": "string", "format": "binary" } } } } } },
        "responses": { "200": { "description": "Returns a media URL for use in media_urls" } }
      }
    },
    "/analytics/overview": {
      "get": { "tags": ["Analytics"], "summary": "Posting analytics overview", "responses": { "200": { "description": "Stats, streaks, trends" } } }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "ot_ API key", "description": "Your OpenTweet API key (prefix ot_). Create one at https://opentweet.io/developer." }
    },
    "schemas": {
      "CreatePost": {
        "type": "object",
        "required": ["text"],
        "properties": {
          "text": { "type": "string", "description": "Post text. For threads, use thread_tweets instead. Each network applies its own limit at publish time: X allows 280 characters, or 25,000 on Premium, counted as weighted characters where a URL costs 23. Bluesky allows 300, counted as graphemes. LinkedIn allows 3,000, counted in UTF-16 code units, and a thread goes to LinkedIn as one combined post. A post over one network's limit is skipped there with a stated reason and still goes out everywhere it fits. Nothing is truncated." },
          "scheduled_date": { "type": "string", "format": "date-time", "description": "ISO 8601. Mutually exclusive with publish_now. Omit both to save a draft." },
          "publish_now": { "type": "boolean", "description": "Publish immediately. Mutually exclusive with scheduled_date." },
          "is_thread": { "type": "boolean" },
          "thread_tweets": { "type": "array", "items": { "type": "string" }, "description": "Tweets in the thread when is_thread is true." },
          "media_urls": { "type": "array", "items": { "type": "string" }, "description": "URLs returned by /upload." },
          "category": { "type": "string" },
          "x_account_id": { "type": "string", "description": "Target a specific connected X account (Advanced and Agency plans). Omit to use the primary X account." },
          "bluesky_account_id": { "type": "string", "description": "Target a specific connected Bluesky account. Omit to use the primary Bluesky account." },
          "linkedin_account_id": { "type": "string", "description": "Target a specific connected LinkedIn account. Omit to use the primary LinkedIn account." },
          "platforms": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/Platform" },
            "description": "Which networks this post goes to. Any non-empty subset of [\"x\", \"bluesky\", \"linkedin\"]; unknown ids are dropped rather than erroring. An explicit value is always honoured exactly and is never expanded, so [\"x\"] posts to X only even while auto cross-post is on. Omitting the field is NOT the same as [\"x\"]: an unspecified post follows the account's auto cross-post setting, which when on sends it to every connected platform. In a bulk create (a body with a `posts` array) this can be set per post, or once at the top level to apply to every post in the batch, the same way x_account_id works."
          }
        }
      },
      "Platform": {
        "type": "string",
        "enum": ["x", "bluesky", "linkedin"],
        "description": "A network id. Bluesky needs no API key or developer account: OpenTweet connects over atproto OAuth, no password or App Password is ever pasted in, and self-hosted Bluesky servers work because the server is resolved from the handle. LinkedIn connects with one LinkedIn sign-in in the dashboard and posts to the member's personal profile; the sign-in lasts 60 days."
      },
      "PostResult": {
        "type": "object",
        "description": "The outcome on one network. Delivery to each network is independent, so a partial outcome is normal and is not an error. Read status per entry rather than the top-level posted boolean, which is true when any target published.",
        "properties": {
          "platform": { "$ref": "#/components/schemas/Platform" },
          "account_id": { "type": "string", "nullable": true, "description": "Which connected account it went out as." },
          "status": { "type": "string", "enum": ["published", "failed", "skipped"] },
          "post_id": { "type": "string", "nullable": true, "description": "The native id: the tweet id on X, the atproto record key on Bluesky, the post URN on LinkedIn (for example urn:li:share:7300000000000000000)." },
          "uri": { "type": "string", "nullable": true, "description": "Bluesky only. The at:// URI of the record, needed to reply to or delete it." },
          "cid": { "type": "string", "nullable": true, "description": "Bluesky only. The content hash of the record." },
          "url": { "type": "string", "nullable": true, "description": "Permalink to the published post." },
          "part_ids": { "type": "array", "items": { "type": "string" }, "description": "The id of every part of a thread, in order. A single post carries one entry, and so does a LinkedIn result, because a thread goes to LinkedIn as one post." },
          "error": { "type": "string", "nullable": true, "description": "Present when status is failed." },
          "skip_reason": { "type": "string", "nullable": true, "description": "Present when status is skipped, for example \"This post is 412 characters, over the 300 Bluesky allows.\"" },
          "attempted_at": { "type": "string", "format": "date-time", "nullable": true }
        }
      },
      "Post": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "text": { "type": "string" },
          "status": { "type": "string", "enum": ["draft", "scheduled", "posted", "failed"] },
          "scheduled_date": { "type": "string", "format": "date-time", "nullable": true },
          "is_thread": { "type": "boolean" },
          "x_post_id": { "type": "string", "nullable": true },
          "platforms": { "type": "array", "items": { "$ref": "#/components/schemas/Platform" }, "description": "The networks this post targets. Defaults to [\"x\"] for posts created before cross-posting existed." },
          "bluesky_account_id": { "type": "string", "nullable": true },
          "linkedin_account_id": { "type": "string", "nullable": true },
          "results": { "type": "array", "items": { "$ref": "#/components/schemas/PostResult" }, "description": "One entry per network the post targeted, populated once it has been published. Empty until then." }
        }
      },
      "CreateArticle": {
        "type": "object",
        "required": ["title", "content_markdown"],
        "properties": {
          "title": { "type": "string", "description": "The article headline." },
          "content_markdown": { "type": "string", "description": "The article body as markdown. This is the source of truth and is converted to X's article format at publish time. Headings, lists, blockquotes, bold, italic, strikethrough, links, and static images are supported. X has no code block type yet, so fenced code survives as plain text. Only static images embed; GIF and video URLs fall back to links." },
          "cover_image_url": { "type": "string", "description": "Optional cover image URL. Must be a static image." },
          "scheduled_date": { "type": "string", "format": "date-time", "description": "Publish at this time. Mutually exclusive with publish_now. Omit both to save a draft." },
          "publish_now": { "type": "boolean", "description": "Publish to X immediately. Mutually exclusive with scheduled_date. The call blocks until X answers and returns 502 if X rejects the article." },
          "x_account_id": { "type": "string", "description": "Which connected X account publishes it. Defaults to the active one." }
        }
      },
      "UpdateArticle": {
        "type": "object",
        "description": "All fields optional. Only the fields you send are changed.",
        "properties": {
          "title": { "type": "string" },
          "content_markdown": { "type": "string" },
          "cover_image_url": { "type": "string", "nullable": true },
          "scheduled_date": { "type": "string", "format": "date-time", "nullable": true, "description": "Sets or moves the schedule. Send null to unschedule back to draft." },
          "x_account_id": { "type": "string", "nullable": true }
        }
      },
      "Article": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "title": { "type": "string" },
          "content_markdown": { "type": "string" },
          "cover_image_url": { "type": "string", "nullable": true },
          "status": { "type": "string", "enum": ["draft", "scheduled", "publishing", "published", "failed"] },
          "scheduled_date": { "type": "string", "format": "date-time", "nullable": true },
          "published_date": { "type": "string", "format": "date-time", "nullable": true },
          "x_article_id": { "type": "string", "nullable": true },
          "x_post_id": { "type": "string", "nullable": true },
          "article_url": { "type": "string", "nullable": true, "description": "The live X URL, populated once published." },
          "failed_reason": { "type": "string", "nullable": true, "description": "X's own error when status is failed. A scheduled article that fails sends no email or webhook, so poll status=failed if an agent publishes unattended." },
          "x_account_id": { "type": "string", "nullable": true },
          "generating": { "type": "boolean", "description": "True while AI is still writing the draft. Updates are rejected with 409 until it finishes." },
          "generation_error": { "type": "string", "nullable": true },
          "created_at": { "type": "string", "format": "date-time" },
          "updated_at": { "type": "string", "format": "date-time" }
        }
      },
      "ArticleEnvelope": {
        "type": "object",
        "properties": { "article": { "$ref": "#/components/schemas/Article" } }
      },
      "ArticleList": {
        "type": "object",
        "properties": {
          "articles": { "type": "array", "items": { "$ref": "#/components/schemas/Article" } },
          "pagination": {
            "type": "object",
            "properties": {
              "page": { "type": "integer" },
              "limit": { "type": "integer" },
              "total_count": { "type": "integer" },
              "total_pages": { "type": "integer" },
              "has_more": { "type": "boolean" }
            }
          }
        }
      },
      "CrossPosting": {
        "type": "object",
        "properties": {
          "auto_cross_post": { "type": "boolean", "description": "On: a post with no platforms field goes to every connected platform. Off: it goes to X only. Either way, a post that does pass platforms is honoured exactly." },
          "default_targets": { "type": "array", "items": { "$ref": "#/components/schemas/Platform" }, "description": "Where a post that omits platforms would be attempted right now. This is the resolver's live answer, so read it rather than recomputing it from the setting." },
          "deliverable_targets": { "type": "array", "items": { "$ref": "#/components/schemas/Platform" }, "description": "The subset of default_targets with a working account, so where such a post will actually land. A network in default_targets but not here will be attempted and will fail until the user reconnects it. Reporting that network as working is the mistake this field exists to prevent." },
          "platforms": { "type": "array", "items": { "$ref": "#/components/schemas/PlatformStatus" } }
        }
      },
      "PlatformStatus": {
        "type": "object",
        "properties": {
          "platform": { "$ref": "#/components/schemas/Platform" },
          "label": { "type": "string", "description": "Display name, for example \"Bluesky\"." },
          "connected": { "type": "boolean", "description": "An account row exists. Not the same question as usable." },
          "usable": { "type": "boolean", "description": "We believe we can publish to it right now. An account whose grant has gone stale is connected: true and usable: false, so a client that reads only connected shows a green tick over a network that is about to fail." },
          "needs_reconnect": { "type": "boolean", "description": "The user has to reconnect this network before it can publish again." },
          "accounts": { "type": "array", "items": { "$ref": "#/components/schemas/PlatformAccount" } },
          "limits": { "oneOf": [{ "$ref": "#/components/schemas/PlatformLimits" }, { "type": "null" }] }
        }
      },
      "PlatformAccount": {
        "type": "object",
        "properties": {
          "account_id": { "type": "string", "description": "Pass to x_account_id, bluesky_account_id or linkedin_account_id when creating a post." },
          "remote_id": { "type": "string", "nullable": true, "description": "The network's own id: the X user id, the atproto DID on Bluesky, or the member URN on LinkedIn." },
          "handle": { "type": "string", "nullable": true },
          "display_name": { "type": "string", "nullable": true },
          "avatar_url": { "type": "string", "nullable": true },
          "is_primary": { "type": "boolean", "description": "Used when a create omits the account id for this network." },
          "disconnected": { "type": "boolean" }
        }
      },
      "PlatformLimits": {
        "type": "object",
        "description": "Per network, and there is no shared counter, which is why each network reports its own. A post over one of these is skipped on that network with a stated reason and still goes out everywhere it fits.",
        "properties": {
          "max_text_length": { "type": "integer", "description": "280 on X, 25000 on X Premium, 300 on Bluesky, 3000 on LinkedIn." },
          "text_unit": { "type": "string", "enum": ["weighted", "grapheme", "codeunit"], "description": "X counts weighted characters, where a URL costs 23 regardless of length. Bluesky counts graphemes, so an emoji or an accented letter costs one. LinkedIn is counted in UTF-16 code units, so an emoji costs two." },
          "max_text_bytes": { "type": "integer", "nullable": true },
          "max_images": { "type": "integer", "description": "4 on X and Bluesky, 20 on LinkedIn." },
          "max_image_bytes": { "type": "integer", "description": "2097152 (2MB) on Bluesky." },
          "max_videos": { "type": "integer", "description": "0 on Bluesky and LinkedIn. Video cross-posting to either is not supported." },
          "max_video_bytes": { "type": "integer" },
          "allows_mixed_media": { "type": "boolean" },
          "max_thread_parts": { "type": "integer", "description": "Threads cross-post as real reply chains, and every part is subject to its own network's limit." },
          "max_alt_text_length": { "type": "integer", "nullable": true, "description": "Alt text is carried to both networks." }
        }
      },
      "PostList": {
        "type": "object",
        "properties": { "posts": { "type": "array", "items": { "$ref": "#/components/schemas/Post" } }, "total": { "type": "integer" } }
      },
      "Error": {
        "type": "object",
        "properties": { "error": { "type": "string" }, "code": { "type": "string" }, "details": { "type": "string" } }
      }
    }
  }
}
