{
  "openapi": "3.1.0",
  "info": {
    "title": "Lempile Instagram API",
    "version": "1.0.0",
    "description": "Instagram direct messages, profiles, followers, posts, comments and likes from your own connected Instagram accounts, each in its own browser with its own IP. Paths, fields, status codes and error types are Unipile's (v1); what Lempile doesn't do answers `501 errors/feature_not_implemented`."
  },
  "servers": [
    {
      "url": "https://api.lempile.com",
      "description": "Lempile production API. Paths start with /api/v1, as on Unipile."
    }
  ],
  "tags": [
    {
      "name": "Accounts",
      "description": "Connecting Instagram accounts (API, checkpoints, hosted links), reading and removing them."
    },
    {
      "name": "Chats and messages",
      "description": "The inbox: chats, messages, files, reactions, starting a chat."
    },
    {
      "name": "Attendees",
      "description": "The people the account has chats with."
    },
    {
      "name": "Users",
      "description": "Profiles, followers and following, follows, follow requests, the account's own profile."
    },
    {
      "name": "Posts",
      "description": "Posts and reels, comments, likes, creating a feed post."
    },
    {
      "name": "Webhooks",
      "description": "Messaging and account status events, sent to your address."
    },
    {
      "name": "Write receipts",
      "description": "What became of a write, by its Idempotency-Key."
    }
  ],
  "paths": {
    "/api/v1/accounts": {
      "get": {
        "operationId": "Instagram_listAccounts",
        "summary": "List accounts",
        "tags": ["Accounts"],
        "description": "The workspace's connected accounts, every network together. An Instagram account has `provider: \"instagram\"`; one Instagram restricted shows `restriction` (why, and since when). Read from Lempile's database: no browser opens.\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The accounts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountList"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "Instagram_connectAccount",
        "summary": "Connect an account",
        "tags": ["Accounts"],
        "description": "Signs an Instagram account in with its username and password, in its own new browser behind its own Lempile IP. Answers within 60 seconds: `AccountCreated`, or `202 Checkpoint` when Instagram asks for a code or an approval first (answer it with `POST /accounts/checkpoint`), or is still signing in (`CONNECTING`: read the account until it's `OK`). A sign-in waits 5 minutes for its checkpoints. `username` may also be the account's email or phone number.\n\nOnly username and password sign in: a `sessionid` cookie answers `501`, because Instagram ends a session that moves to a new device and IP. Instagram is in early access: a workspace that isn't open for it yet gets `403 errors/feature_not_subscribed` (write to support@lempile.com).\n\nScope: `accounts.write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["provider", "username", "password"],
                "properties": {
                  "provider": {
                    "const": "INSTAGRAM"
                  },
                  "username": {
                    "type": "string",
                    "description": "The Instagram username."
                  },
                  "password": {
                    "type": "string",
                    "format": "password",
                    "description": "The account's password. Used for this sign-in only."
                  }
                }
              },
              "example": {
                "provider": "INSTAGRAM",
                "username": "janedemo",
                "password": "…"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Signed in.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountCreated"
                },
                "example": {
                  "object": "AccountCreated",
                  "account_id": "00000000-0000-4000-8000-0000000000c1"
                }
              }
            }
          },
          "202": {
            "description": "Instagram asks for something first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Checkpoint"
                },
                "example": {
                  "object": "Checkpoint",
                  "account_id": "00000000-0000-4000-8000-0000000000c1",
                  "checkpoint": {
                    "type": "OTP",
                    "source": "EMAIL",
                    "can_try_another_way": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again. `errors/invalid_credentials`: Instagram refused the username or password.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "`errors/feature_not_subscribed` (Instagram isn't open to this workspace yet), `errors/password_reset_required` (Instagram wants a new password), `errors/action_required` (something done on Instagram itself) or `errors/insufficient_permissions` (the key lacks the scope).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "`errors/already_exists`: the account is already connected in this workspace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "425": {
            "description": "`errors/auth_in_progress`: a sign-in of this account is still running; it carries the checkpoint when Instagram asked for one.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: Instagram asks to wait (`retry_after`).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: Lempile can't start the sign-in right now (no free IP for a new account, or its browser server is busy). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/checkpoint": {
      "post": {
        "operationId": "Instagram_solveCheckpoint",
        "summary": "Answer a checkpoint",
        "tags": ["Accounts"],
        "description": "Gives Instagram what a `Checkpoint` asked for: the code it sent (`OTP` and `2FA`: 4 to 8 digits), or `TRY_ANOTHER_WAY` (Instagram's \"Try another way\": another kind of check). Answers `AccountCreated`, or another `Checkpoint` when Instagram asks for one more thing. A sign-in waits 5 minutes for its checkpoints; after that, `408`: start again with `POST /accounts`.\n\nScope: `accounts.write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["provider", "account_id", "code"],
                "properties": {
                  "provider": {
                    "const": "INSTAGRAM"
                  },
                  "account_id": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string",
                    "description": "The code, or `TRY_ANOTHER_WAY`."
                  }
                }
              },
              "example": {
                "provider": "INSTAGRAM",
                "account_id": "00000000-0000-4000-8000-0000000000c1",
                "code": "482913"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Signed in.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountCreated"
                }
              }
            }
          },
          "202": {
            "description": "One more checkpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Checkpoint"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again. `errors/invalid_checkpoint_solution`: a wrong code; send the right one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "408": {
            "description": "`errors/request_timeout`: the sign-in waited 5 minutes for its checkpoints. Start again with `POST /accounts`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "`errors/checkpoint_switching_not_available`: Instagram offers no other way.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/checkpoint/resend": {
      "post": {
        "operationId": "Instagram_resendCheckpoint",
        "summary": "Send the code again",
        "tags": ["Accounts"],
        "description": "Asks Instagram to send the checkpoint's code again, as its own \"Send again\" does.\n\nScope: `accounts.write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["provider", "account_id"],
                "properties": {
                  "provider": {
                    "const": "INSTAGRAM"
                  },
                  "account_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sent again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckpointResend"
                },
                "example": {
                  "object": "CheckpointResend",
                  "account_id": "00000000-0000-4000-8000-0000000000c1",
                  "success": true
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}": {
      "get": {
        "operationId": "Instagram_getAccount",
        "summary": "Retrieve an account",
        "tags": ["Accounts"],
        "description": "One account, in Unipile's `Account`. `sources[].status` is `OK` (signed in and ready), `CONNECTING` (signing in), `CREDENTIALS` (Instagram signed it out: connect it again) or `ERROR` (Lempile can't reach its browser or IP right now). No browser opens.\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Lempile id, Instagram user id or username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          }
        ],
        "responses": {
          "200": {
            "description": "The account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                },
                "example": {
                  "object": "Account",
                  "type": "INSTAGRAM",
                  "id": "00000000-0000-4000-8000-0000000000c1",
                  "name": "janedemo",
                  "created_at": "2026-11-25T18:20:41.000Z",
                  "sources": [
                    {
                      "id": "instagram_browser_session",
                      "status": "OK"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "Instagram_reconnectAccount",
        "summary": "Reconnect an account",
        "tags": ["Accounts"],
        "description": "Signs an account that shows `CREDENTIALS` in again, with the same body as `POST /accounts`. Answers `AccountReconnected` or a `Checkpoint`. The account keeps its id and its IP. Instagram is in early access: a workspace that isn't open for it yet gets `403 errors/feature_not_subscribed` (write to support@lempile.com).\n\nScope: `accounts.write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Lempile id, Instagram user id or username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["provider", "username", "password"],
                "properties": {
                  "provider": {
                    "const": "INSTAGRAM"
                  },
                  "username": {
                    "type": "string",
                    "description": "The Instagram username."
                  },
                  "password": {
                    "type": "string",
                    "format": "password",
                    "description": "The account's password. Used for this sign-in only."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signed in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountReconnected"
                }
              }
            }
          },
          "202": {
            "description": "Instagram asks for something first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Checkpoint"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again. `errors/invalid_credentials`: Instagram refused the username or password.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "`errors/feature_not_subscribed` (Instagram isn't open to this workspace yet), `errors/password_reset_required` (Instagram wants a new password), `errors/action_required` (something done on Instagram itself) or `errors/insufficient_permissions` (the key lacks the scope).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "425": {
            "description": "`errors/auth_in_progress`: a sign-in of this account is still running; it carries the checkpoint when Instagram asked for one.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: Instagram asks to wait (`retry_after`).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: Lempile can't start the sign-in right now (no free IP for a new account, or its browser server is busy). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "Instagram_deleteAccount",
        "summary": "Remove an account",
        "tags": ["Accounts"],
        "description": "Removes the account from Lempile. The Instagram account itself is untouched.\n\nScope: `accounts.write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Lempile id, Instagram user id or username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          }
        ],
        "responses": {
          "200": {
            "description": "Removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountDeleted"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/hosted/accounts/link": {
      "post": {
        "operationId": "Instagram_createHostedLink",
        "summary": "Create a hosted link",
        "tags": ["Accounts"],
        "description": "A link to Lempile's own sign-in page, for someone else to connect their Instagram account (with Instagram's code when it asks). The new account joins the key's workspace. A link lasts 24 hours at most; treat it as a secret. `\"type\": \"reconnect\"` with `reconnect_account` signs an existing account in again. Instagram is in early access: a workspace that isn't open for it yet gets `403 errors/feature_not_subscribed` (write to support@lempile.com).\n\nScope: `accounts.write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["type", "providers", "expiresOn"],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": ["create", "reconnect"]
                  },
                  "providers": {
                    "type": "array",
                    "items": {
                      "const": "INSTAGRAM"
                    }
                  },
                  "api_url": {
                    "type": "string",
                    "description": "Your base URL, as Unipile asks for it."
                  },
                  "expiresOn": {
                    "type": "string",
                    "format": "date-time",
                    "description": "At most 24 hours from now."
                  },
                  "reconnect_account": {
                    "type": "string",
                    "description": "With `type: \"reconnect\"`: the account's id."
                  }
                }
              },
              "example": {
                "type": "create",
                "providers": ["INSTAGRAM"],
                "api_url": "https://api.lempile.com/api/v1",
                "expiresOn": "2026-11-26T18:00:00.000Z"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The link.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostedAuthUrl"
                },
                "example": {
                  "object": "HostedAuthUrl",
                  "url": "https://lempile.com/connect/instagram?token=…"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/chats": {
      "get": {
        "operationId": "Instagram_listChats",
        "summary": "List chats",
        "tags": ["Chats and messages"],
        "description": "The account's Instagram inbox, newest activity first. A message request the account received has `folder: [\"PENDING\"]`. Opens no conversation, so nobody sees \"Seen\".\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 250 (default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The previous page's `cursor`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "unread",
            "in": "query",
            "required": false,
            "description": "Not yet: `501`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Not yet: `501`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Not yet: `501`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The chats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatList"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "Instagram_startChat",
        "summary": "Start a chat",
        "tags": ["Chats and messages"],
        "description": "Sends a first message to one person. When a chat with them already exists, the message goes there. Someone who doesn't follow the account gets a message request: until they accept, Instagram allows one message, text only. `quote_id`, `linkedin`, `subject` and `video_message` answer `400`.\n\nPaced per account: 3 minutes between new chats, 20 a day.\n\nScope: `accounts.write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1–200 characters of `A-Z a-z 0-9 . _ : -`, scoped to your workspace. The same key with the same request replays the first answer; see Write receipts. A dry run needs none.",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "example": "answer-jane-1"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["account_id", "attendees_ids"],
                "properties": {
                  "account_id": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 1000,
                    "description": "Up to 1,000 characters (Instagram's own limit). Needed unless there are files."
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "`true`: everything up to the last step, nothing sent: `200` with `not_sent: true`. Not paced, no receipt. When the write is already so (already liked, already following), `checks` holds `{ \"check\": \"already\", \"already\": true }`."
                  },
                  "attendees_ids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 1,
                    "items": {
                      "type": "string"
                    },
                    "description": "One person: their `provider_messaging_id` (as Unipile asks), `provider_id`, username, `@username` or profile link. Two or more (a group): `501`."
                  }
                }
              },
              "example": {
                "account_id": "00000000-0000-4000-8000-0000000000c1",
                "attendees_ids": ["sam.example"],
                "text": "Hi Sam, thanks for the follow."
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": ["account_id", "attendees_ids"],
                "properties": {
                  "account_id": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 1000,
                    "description": "Up to 1,000 characters (Instagram's own limit). Needed unless there are files."
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    },
                    "description": "`multipart/form-data` only: JPEG or PNG pictures (8 MB each), MP4 or MOV videos (25 MB), voice notes as M4A, AAC or MP3 (10 MB). 10 files and 25 MB at most in all. Any other type: `415`."
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "`true`: everything up to the last step, nothing sent: `200` with `not_sent: true`. Not paced, no receipt. When the write is already so (already liked, already following), `checks` holds `{ \"check\": \"already\", \"already\": true }`."
                  },
                  "attendees_ids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 1,
                    "items": {
                      "type": "string"
                    },
                    "description": "One person: their `provider_messaging_id` (as Unipile asks), `provider_id`, username, `@username` or profile link. Two or more (a group): `501`."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatStarted"
                },
                "example": {
                  "object": "ChatStarted",
                  "chat_id": "340282366841710301244276026398105347911",
                  "message_id": "340282366841710301244276026398105347911_cAAAAB3xYz9wQkLmNo"
                }
              }
            }
          },
          "200": {
            "description": "A dry run: nothing typed or sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DryRun"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "`errors/in_progress`: the same key is still running, or its outcome isn't known yet.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "`errors/idempotency_key_reused`, `errors/invalid_recipient` (no Instagram account by that name or id), `errors/user_unreachable` (Instagram won't let the account message this person) or `errors/cant_send_message` (a message request is waiting for their answer: until they accept, one text message only). Nothing was sent.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "`errors/service_unavailable`: the browser's answer was lost after the write started. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't confirm within 140 seconds. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "415": {
            "description": "`errors/unsupported_media_type`: a file Instagram doesn't take. Nothing was sent.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/chats/{chat_id}": {
      "get": {
        "operationId": "Instagram_getChat",
        "summary": "Retrieve a chat",
        "tags": ["Chats and messages"],
        "description": "One `Chat`, with its latest message as `lastMessage` (or `null`). Opens the conversation only when the inbox can't answer (`marks_seen: true` when it opened messages the account hadn't seen).\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "chat_id",
            "in": "path",
            "required": true,
            "description": "The chat's id (the number in `instagram.com/direct/t/<id>/`), or that link.",
            "schema": {
              "type": "string"
            },
            "example": "340282366841710301244276026398105347911"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          }
        ],
        "responses": {
          "200": {
            "description": "The chat.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Chat"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/chats/{chat_id}/messages": {
      "get": {
        "operationId": "Instagram_listChatMessages",
        "summary": "List a chat's messages",
        "tags": ["Chats and messages"],
        "description": "Newest first. Opens the conversation only when the inbox can't answer (`marks_seen: true` when it opened messages the account hadn't seen).\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "chat_id",
            "in": "path",
            "required": true,
            "description": "The chat's id (the number in `instagram.com/direct/t/<id>/`), or that link.",
            "schema": {
              "type": "string"
            },
            "example": "340282366841710301244276026398105347911"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 250 (default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The previous page's `cursor`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Not yet: `501`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Not yet: `501`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sender_id",
            "in": "query",
            "required": false,
            "description": "Not yet: `501`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The messages.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageList"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "Instagram_sendMessage",
        "summary": "Send a message",
        "tags": ["Chats and messages"],
        "description": "Sends a message in the chat, in the account's own browser, then reads it back from the chat so `message_id` is the message as Instagram has it. `quote_id` answers one of the chat's messages, as Instagram's Reply does. A voice note goes in `attachments` or `voice_message`. `mentions`, `thread_id`, `typing_duration` and `video_message` (LinkedIn's or WhatsApp's) answer `400`.\n\nPaced per account: 20 seconds between messages in chats, 80 a day.\n\nScope: `accounts.write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "chat_id",
            "in": "path",
            "required": true,
            "description": "The chat's id (the number in `instagram.com/direct/t/<id>/`), or that link.",
            "schema": {
              "type": "string"
            },
            "example": "340282366841710301244276026398105347911"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1–200 characters of `A-Z a-z 0-9 . _ : -`, scoped to your workspace. The same key with the same request replays the first answer; see Write receipts. A dry run needs none.",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "example": "answer-jane-1"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["account_id"],
                "properties": {
                  "account_id": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 1000,
                    "description": "Up to 1,000 characters (Instagram's own limit). Needed unless there are files."
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "`true`: everything up to the last step, nothing sent: `200` with `not_sent: true`. Not paced, no receipt. When the write is already so (already liked, already following), `checks` holds `{ \"check\": \"already\", \"already\": true }`."
                  },
                  "quote_id": {
                    "type": "string",
                    "description": "A message id of this chat: the message answers it."
                  },
                  "voice_message": {
                    "type": "string",
                    "format": "binary",
                    "description": "`multipart/form-data` only: a voice note (M4A, AAC or MP3, 10 MB)."
                  }
                }
              },
              "example": {
                "account_id": "00000000-0000-4000-8000-0000000000c1",
                "text": "Thanks, talk tomorrow."
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": ["account_id"],
                "properties": {
                  "account_id": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 1000,
                    "description": "Up to 1,000 characters (Instagram's own limit). Needed unless there are files."
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    },
                    "description": "`multipart/form-data` only: JPEG or PNG pictures (8 MB each), MP4 or MOV videos (25 MB), voice notes as M4A, AAC or MP3 (10 MB). 10 files and 25 MB at most in all. Any other type: `415`."
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "`true`: everything up to the last step, nothing sent: `200` with `not_sent: true`. Not paced, no receipt. When the write is already so (already liked, already following), `checks` holds `{ \"check\": \"already\", \"already\": true }`."
                  },
                  "quote_id": {
                    "type": "string",
                    "description": "A message id of this chat: the message answers it."
                  },
                  "voice_message": {
                    "type": "string",
                    "format": "binary",
                    "description": "`multipart/form-data` only: a voice note (M4A, AAC or MP3, 10 MB)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageSent"
                },
                "example": {
                  "object": "MessageSent",
                  "message_id": "340282366841710301244276026398105347911_cAAAAB3xYz9wQkLmNo"
                }
              }
            }
          },
          "200": {
            "description": "A dry run: nothing typed or sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DryRun"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "`errors/in_progress`: the same key is still running, or its outcome isn't known yet.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "`errors/idempotency_key_reused`, `errors/invalid_recipient` (no Instagram account by that name or id), `errors/user_unreachable` (Instagram won't let the account message this person) or `errors/cant_send_message` (a message request is waiting for their answer: until they accept, one text message only). Nothing was sent.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "`errors/service_unavailable`: the browser's answer was lost after the write started. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't confirm within 140 seconds. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "415": {
            "description": "`errors/unsupported_media_type`: a file Instagram doesn't take. Nothing was sent.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/chats/{chat_id}/attendees": {
      "get": {
        "operationId": "Instagram_listChatAttendees",
        "summary": "List a chat's attendees",
        "tags": ["Chats and messages"],
        "description": "The people in the chat. Opens the conversation only when the inbox can't answer (`marks_seen: true` when it opened messages the account hadn't seen).\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "chat_id",
            "in": "path",
            "required": true,
            "description": "The chat's id (the number in `instagram.com/direct/t/<id>/`), or that link.",
            "schema": {
              "type": "string"
            },
            "example": "340282366841710301244276026398105347911"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          }
        ],
        "responses": {
          "200": {
            "description": "The attendees.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatAttendeeList"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/chats/{chat_id}/sync": {
      "get": {
        "operationId": "Instagram_syncChat",
        "summary": "Read a chat again",
        "tags": ["Chats and messages"],
        "description": "Reads the chat from Instagram now and answers when done (`SYNC_DONE`); a chat Instagram no longer has answers `CHAT_DELETED`, as on Unipile. Opens the conversation only when the inbox can't answer (`marks_seen: true` when it opened messages the account hadn't seen).\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "chat_id",
            "in": "path",
            "required": true,
            "description": "The chat's id (the number in `instagram.com/direct/t/<id>/`), or that link.",
            "schema": {
              "type": "string"
            },
            "example": "340282366841710301244276026398105347911"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          }
        ],
        "responses": {
          "200": {
            "description": "Read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatHistorySync"
                },
                "example": {
                  "object": "ChatHistorySync",
                  "chat_id": "340282366841710301244276026398105347911",
                  "status": "SYNC_DONE"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/messages": {
      "get": {
        "operationId": "Instagram_listMessages",
        "summary": "List messages",
        "tags": ["Chats and messages"],
        "description": "The messages of the newest chats, newest first. Opens the conversation only when the inbox can't answer (`marks_seen: true` when it opened messages the account hadn't seen).\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 250 (default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The messages.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageList"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/messages/{message_id}": {
      "get": {
        "operationId": "Instagram_getMessage",
        "summary": "Retrieve a message",
        "tags": ["Chats and messages"],
        "description": "One `Message`, looked for among its chat's newest 300 messages; an older one answers `404`. Opens the conversation only when the inbox can't answer (`marks_seen: true` when it opened messages the account hadn't seen).\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "description": "`<chat id>_<Instagram's message id>`, as the API answers it.",
            "schema": {
              "type": "string"
            },
            "example": "340282366841710301244276026398105347911_cAAAAB3xYz9wQkLmNo"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          }
        ],
        "responses": {
          "200": {
            "description": "The message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/messages/{message_id}/attachments/{attachment_id}": {
      "get": {
        "operationId": "Instagram_getAttachment",
        "summary": "Retrieve an attachment",
        "tags": ["Chats and messages"],
        "description": "The file itself, read in the account's own session, with its own content type. Opens the conversation only when the inbox can't answer (`marks_seen: true` when it opened messages the account hadn't seen).\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "description": "`<chat id>_<Instagram's message id>`, as the API answers it.",
            "schema": {
              "type": "string"
            },
            "example": "340282366841710301244276026398105347911_cAAAAB3xYz9wQkLmNo"
          },
          {
            "name": "attachment_id",
            "in": "path",
            "required": true,
            "description": "`<message provider_id>_<position>`, from 0.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          }
        ],
        "responses": {
          "200": {
            "description": "The file.",
            "content": {
              "*/*": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/messages/{message_id}/reaction": {
      "post": {
        "operationId": "Instagram_addMessageReaction",
        "summary": "React to a message",
        "tags": ["Chats and messages"],
        "description": "Instagram keeps one reaction per person on a message: a new one replaces the account's last. Opens the conversation. Paced per account: 60 a day.\n\nScope: `accounts.write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "description": "`<chat id>_<Instagram's message id>`, as the API answers it.",
            "schema": {
              "type": "string"
            },
            "example": "340282366841710301244276026398105347911_cAAAAB3xYz9wQkLmNo"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. Sent without one, Lempile makes one and answers it in the same header, so the write still has a receipt.",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "example": "answer-jane-1"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["account_id", "reaction"],
                "properties": {
                  "account_id": {
                    "type": "string"
                  },
                  "reaction": {
                    "type": "string",
                    "description": "An emoji."
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "`true`: everything up to the last step, nothing sent: `200` with `not_sent: true`. Not paced, no receipt. When the write is already so (already liked, already following), `checks` holds `{ \"check\": \"already\", \"already\": true }`."
                  }
                }
              },
              "example": {
                "account_id": "00000000-0000-4000-8000-0000000000c1",
                "reaction": "❤️"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reacted (or a dry run).",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/MessageReactionAdded"
                    },
                    {
                      "$ref": "#/components/schemas/DryRun"
                    }
                  ]
                },
                "example": {
                  "object": "MessageReactionAdded",
                  "success": true
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "`errors/in_progress`: the same key is still running, or its outcome isn't known yet.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "`errors/idempotency_key_reused`: the key was used for another request. Nothing was sent.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "`errors/service_unavailable`: the browser's answer was lost after the write started. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't confirm within 140 seconds. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "Instagram_removeMessageReaction",
        "summary": "Remove a reaction",
        "tags": ["Chats and messages"],
        "description": "Takes the account's reaction off the message (same body as adding one).\n\nScope: `accounts.write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "description": "`<chat id>_<Instagram's message id>`, as the API answers it.",
            "schema": {
              "type": "string"
            },
            "example": "340282366841710301244276026398105347911_cAAAAB3xYz9wQkLmNo"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. Sent without one, Lempile makes one and answers it in the same header, so the write still has a receipt.",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "example": "answer-jane-1"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["account_id", "reaction"],
                "properties": {
                  "account_id": {
                    "type": "string"
                  },
                  "reaction": {
                    "type": "string",
                    "description": "An emoji."
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "`true`: everything up to the last step, nothing sent: `200` with `not_sent: true`. Not paced, no receipt. When the write is already so (already liked, already following), `checks` holds `{ \"check\": \"already\", \"already\": true }`."
                  }
                }
              },
              "example": {
                "account_id": "00000000-0000-4000-8000-0000000000c1",
                "reaction": "❤️"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Removed (or a dry run).",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/MessageReactionRemoved"
                    },
                    {
                      "$ref": "#/components/schemas/DryRun"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "`errors/in_progress`: the same key is still running, or its outcome isn't known yet.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "`errors/idempotency_key_reused`: the key was used for another request. Nothing was sent.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "`errors/service_unavailable`: the browser's answer was lost after the write started. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't confirm within 140 seconds. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/chat_attendees": {
      "get": {
        "operationId": "Instagram_listAttendees",
        "summary": "List attendees",
        "tags": ["Attendees"],
        "description": "Everyone the account has a chat with. Opens the conversation only when the inbox can't answer (`marks_seen: true` when it opened messages the account hadn't seen).\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 250 (default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The previous page's `cursor`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The attendees.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatAttendeeList"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/chat_attendees/{attendee_id}": {
      "get": {
        "operationId": "Instagram_getAttendee",
        "summary": "Retrieve an attendee",
        "tags": ["Attendees"],
        "description": "One `ChatAttendee`. Opens the conversation only when the inbox can't answer (`marks_seen: true` when it opened messages the account hadn't seen).\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "attendee_id",
            "in": "path",
            "required": true,
            "description": "The person's `provider_id`.",
            "schema": {
              "type": "string"
            },
            "example": "48210937561"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          }
        ],
        "responses": {
          "200": {
            "description": "The attendee.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatAttendee"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/chat_attendees/{attendee_id}/picture": {
      "get": {
        "operationId": "Instagram_getAttendeePicture",
        "summary": "Retrieve an attendee's picture",
        "tags": ["Attendees"],
        "description": "Their profile picture, as an image. Opens the conversation only when the inbox can't answer (`marks_seen: true` when it opened messages the account hadn't seen).\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "attendee_id",
            "in": "path",
            "required": true,
            "description": "The person's `provider_id`.",
            "schema": {
              "type": "string"
            },
            "example": "48210937561"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          }
        ],
        "responses": {
          "200": {
            "description": "The picture.",
            "content": {
              "image/*": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/chat_attendees/{attendee_id}/chats": {
      "get": {
        "operationId": "Instagram_listAttendeeChats",
        "summary": "List an attendee's chats",
        "tags": ["Attendees"],
        "description": "A `ChatList`: the account's one-to-one chat with them. Opens the conversation only when the inbox can't answer (`marks_seen: true` when it opened messages the account hadn't seen).\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "attendee_id",
            "in": "path",
            "required": true,
            "description": "The person's `provider_id`.",
            "schema": {
              "type": "string"
            },
            "example": "48210937561"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          }
        ],
        "responses": {
          "200": {
            "description": "The chat.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatList"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/chat_attendees/{attendee_id}/messages": {
      "get": {
        "operationId": "Instagram_listAttendeeMessages",
        "summary": "List an attendee's messages",
        "tags": ["Attendees"],
        "description": "A `MessageList`: the messages of the account's chat with them. Opens the conversation only when the inbox can't answer (`marks_seen: true` when it opened messages the account hadn't seen).\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "attendee_id",
            "in": "path",
            "required": true,
            "description": "The person's `provider_id`.",
            "schema": {
              "type": "string"
            },
            "example": "48210937561"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 250 (default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The previous page's `cursor`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The messages.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageList"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/me": {
      "get": {
        "operationId": "Instagram_getOwnProfile",
        "summary": "Retrieve the account's own profile",
        "tags": ["Users"],
        "description": "The account's own Instagram profile: the `UserProfile` fields, with `object: \"AccountOwnerProfile\"`.\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          }
        ],
        "responses": {
          "200": {
            "description": "The profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountOwnerProfile"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/me/edit": {
      "patch": {
        "operationId": "Instagram_editProfile",
        "summary": "Edit the profile",
        "tags": ["Users"],
        "description": "Changes the account's bio, its picture or both, through Instagram's own Edit profile page. Only those two change here, as on Unipile: LinkedIn's fields (`headline`, `location`, `experience`…) answer `400`. `POST` works too.\n\nScope: `accounts.write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. Sent without one, Lempile makes one and answers it in the same header, so the write still has a receipt.",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "example": "answer-jane-1"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": ["type", "account_id"],
                "properties": {
                  "type": {
                    "const": "INSTAGRAM"
                  },
                  "account_id": {
                    "type": "string"
                  },
                  "summary": {
                    "type": "string",
                    "maxLength": 150,
                    "description": "The bio, 150 characters at most."
                  },
                  "picture": {
                    "type": "string",
                    "format": "binary",
                    "description": "A JPEG or PNG, 8 MB at most. One that isn't square is cropped to a centred square, as Instagram's own uploader does."
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "`true`: everything up to the last step, nothing sent: `200` with `not_sent: true`. Not paced, no receipt. When the write is already so (already liked, already following), `checks` holds `{ \"check\": \"already\", \"already\": true }`."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved (or a dry run).",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ProfileEdited"
                    },
                    {
                      "$ref": "#/components/schemas/DryRun"
                    }
                  ]
                },
                "example": {
                  "object": "ProfileEdited"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "`errors/in_progress`: the same key is still running, or its outcome isn't known yet.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "`errors/idempotency_key_reused`: the key was used for another request. Nothing was sent.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "`errors/service_unavailable`: the browser's answer was lost after the write started. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't confirm within 140 seconds. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "415": {
            "description": "`errors/unsupported_media_type`: the picture isn't a JPEG or PNG. Nothing was changed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/followers": {
      "get": {
        "operationId": "Instagram_listFollowers",
        "summary": "List followers",
        "tags": ["Users"],
        "description": "Someone's followers (without `user_id`, the account's own). 25 a page at most, as on Unipile: a `limit` from 26 to 250 gets 25, more answers `400`. Instagram can give fewer, and for a verified account a small fixed sample with no next page. A private account's followers can only be read when the account follows it.\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          },
          {
            "name": "user_id",
            "in": "query",
            "required": false,
            "description": "The person: `provider_id`, username, `@username` or profile link. Without it, the account itself.",
            "schema": {
              "type": "string"
            },
            "example": "sam.example"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 250 (default 25). 26 to 250 gets 25.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The previous page's `cursor`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Followers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserFollowersList"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/following": {
      "get": {
        "operationId": "Instagram_listFollowing",
        "summary": "List following",
        "tags": ["Users"],
        "description": "Whom someone follows (without `user_id`, the account itself), with the same items as followers. `limit` is 25 by default and goes up to 1,000, as on Unipile (more answers `400`); one page holds 100 at most, and `cursor` reads on.\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          },
          {
            "name": "user_id",
            "in": "query",
            "required": false,
            "description": "The person: `provider_id`, username, `@username` or profile link. Without it, the account itself.",
            "schema": {
              "type": "string"
            },
            "example": "sam.example"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 1000 (default 25). 101 to 1,000 gets 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The previous page's `cursor`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Following.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserFollowersList"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/invite": {
      "post": {
        "operationId": "Instagram_follow",
        "summary": "Follow someone",
        "tags": ["Users"],
        "description": "Follows one person (Unipile's \"invitation\"). Following a private account sends a follow request: they decide. `invitation_id` is the person's `provider_id`.\n\nPaced per account: follows and unfollows 2 minutes apart, 20 a day.\n\nScope: `accounts.write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1–200 characters of `A-Z a-z 0-9 . _ : -`, scoped to your workspace. The same key with the same request replays the first answer; see Write receipts. A dry run needs none.",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "example": "answer-jane-1"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["account_id", "provider_id"],
                "properties": {
                  "account_id": {
                    "type": "string"
                  },
                  "provider_id": {
                    "type": "string",
                    "description": "The person's `provider_id` or username. Their `provider_messaging_id` doesn't work here (as on Unipile)."
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "`true`: everything up to the last step, nothing sent: `200` with `not_sent: true`. Not paced, no receipt. When the write is already so (already liked, already following), `checks` holds `{ \"check\": \"already\", \"already\": true }`."
                  }
                }
              },
              "example": {
                "account_id": "00000000-0000-4000-8000-0000000000c1",
                "provider_id": "sam.example"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Followed, or a follow request sent (or a dry run).",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/UserInvitationSent"
                    },
                    {
                      "$ref": "#/components/schemas/DryRun"
                    }
                  ]
                },
                "example": {
                  "object": "UserInvitationSent",
                  "invitation_id": "48210937561"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "`errors/in_progress`: the same key is still running, or its outcome isn't known yet.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "`errors/idempotency_key_reused`: the key was used for another request. Nothing was sent.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "`errors/service_unavailable`: the browser's answer was lost after the write started. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't confirm within 140 seconds. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/invite/sent/{invitation_id}": {
      "delete": {
        "operationId": "Instagram_unfollow",
        "summary": "Unfollow someone",
        "tags": ["Users"],
        "description": "Unfollows, or takes back a follow request not yet accepted. Paced with follows.\n\nScope: `accounts.write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "invitation_id",
            "in": "path",
            "required": true,
            "description": "The person's `provider_id`.",
            "schema": {
              "type": "string"
            },
            "example": "48210937561"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1–200 characters of `A-Z a-z 0-9 . _ : -`, scoped to your workspace. The same key with the same request replays the first answer; see Write receipts. A dry run needs none.",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "example": "answer-jane-1"
          }
        ],
        "responses": {
          "200": {
            "description": "Unfollowed (or a dry run).",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/InvitationCanceled"
                    },
                    {
                      "$ref": "#/components/schemas/DryRun"
                    }
                  ]
                },
                "example": {
                  "object": "InvitationCanceled"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "`errors/in_progress`: the same key is still running, or its outcome isn't known yet.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "`errors/idempotency_key_reused`: the key was used for another request. Nothing was sent.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "`errors/service_unavailable`: the browser's answer was lost after the write started. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't confirm within 140 seconds. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/invite/received": {
      "get": {
        "operationId": "Instagram_listFollowRequests",
        "summary": "List follow requests",
        "tags": ["Users"],
        "description": "The follow requests a private account received. Each request's `id` is the person's `provider_id`.\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 100 (default 10).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The previous page's `cursor`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Follow requests.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationList"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/invite/received/{invitation_id}": {
      "post": {
        "operationId": "Instagram_answerFollowRequest",
        "summary": "Answer a follow request",
        "tags": ["Users"],
        "description": "Accepts or declines one follow request.\n\nScope: `accounts.write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "invitation_id",
            "in": "path",
            "required": true,
            "description": "The person's `provider_id`.",
            "schema": {
              "type": "string"
            },
            "example": "48210937561"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. Sent without one, Lempile makes one and answers it in the same header, so the write still has a receipt.",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "example": "answer-jane-1"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["provider", "account_id", "action"],
                "properties": {
                  "provider": {
                    "const": "INSTAGRAM"
                  },
                  "account_id": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string",
                    "enum": ["accept", "decline"]
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "`true`: everything up to the last step, nothing sent: `200` with `not_sent: true`. Not paced, no receipt. When the write is already so (already liked, already following), `checks` holds `{ \"check\": \"already\", \"already\": true }`."
                  }
                }
              },
              "example": {
                "provider": "INSTAGRAM",
                "account_id": "00000000-0000-4000-8000-0000000000c1",
                "action": "accept"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answered (or a dry run).",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/UserInvitationHandled"
                    },
                    {
                      "$ref": "#/components/schemas/DryRun"
                    }
                  ]
                },
                "example": {
                  "object": "UserInvitationHandled",
                  "status": "ACCEPTED"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "`errors/in_progress`: the same key is still running, or its outcome isn't known yet.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "`errors/idempotency_key_reused`: the key was used for another request. Nothing was sent.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "`errors/service_unavailable`: the browser's answer was lost after the write started. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't confirm within 140 seconds. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/{identifier}": {
      "get": {
        "operationId": "Instagram_getUser",
        "summary": "Retrieve a profile",
        "tags": ["Users"],
        "description": "One Instagram profile in Unipile's `UserProfile`. Each read opens the profile in the account's browser. Instagram doesn't tell people who viewed their profile.\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "The person's username, `@username`, profile link or `provider_id`. A numeric id works once the account has seen that person (in a chat, a follower list, a profile read); otherwise `400` asks for the username.",
            "schema": {
              "type": "string"
            },
            "example": "sam.example"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          }
        ],
        "responses": {
          "200": {
            "description": "The profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserProfile"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/{identifier}/posts": {
      "get": {
        "operationId": "Instagram_listUserPosts",
        "summary": "List a profile's posts",
        "tags": ["Posts"],
        "description": "A person's posts and reels, newest first, as the profile shows them. A private account's posts can only be read when the account follows it.\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "The person's username, `@username`, profile link or `provider_id`. A numeric id works once the account has seen that person (in a chat, a follower list, a profile read); otherwise `400` asks for the username.",
            "schema": {
              "type": "string"
            },
            "example": "sam.example"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 100 (default 10).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The previous page's `cursor`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Posts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostList"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/posts": {
      "post": {
        "operationId": "Instagram_createPost",
        "summary": "Create a post",
        "tags": ["Posts"],
        "description": "Publishes a feed post through Instagram's own Create: 1 to 10 pictures or videos and a caption. `201` once Instagram shows the post; `202` with `status: \"PROCESSING\"` when Instagram is still processing it (a video, often): read the account's posts a little later. A long video can take longer than the 140 seconds a request waits: send `Prefer: respond-async` to get `202` as soon as Lempile starts the post (`post_id: null`, the key in the `Idempotency-Key` header), then read `GET /writes/{key}` until it is `done` or `failed`. A story (`post_type: \"story\"`) or a `video_thumbnail` answers `501`: Instagram's web can't make them.\n\nPaced per account: 3 posts a day.\n\nScope: `accounts.write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1–200 characters of `A-Z a-z 0-9 . _ : -`, scoped to your workspace. The same key with the same request replays the first answer; see Write receipts. A dry run needs none.",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "example": "answer-jane-1"
          },
          {
            "name": "Prefer",
            "in": "header",
            "required": false,
            "description": "`respond-async`: answer `202` as soon as Lempile starts the post, without waiting for Instagram; the answer carries `Preference-Applied: respond-async` and a `Location` header pointing at its receipt. Follow `GET /writes/{key}`. Without it, the request waits up to 140 seconds as usual.",
            "schema": {
              "type": "string"
            },
            "example": "respond-async"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": ["account_id", "attachments"],
                "properties": {
                  "account_id": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 2200,
                    "description": "The caption (Instagram's limit). `@username` mentions someone."
                  },
                  "attachments": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 10,
                    "items": {
                      "type": "string",
                      "format": "binary"
                    },
                    "description": "JPEG or PNG pictures (8 MB each), MP4 or MOV videos (50 MB). 10 files and 50 MB at most in all."
                  },
                  "location": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "A place to tag. The best match is used; no match leaves the post untagged."
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "`true`: everything up to the last step, nothing sent: `200` with `not_sent: true`. Not paced, no receipt. When the write is already so (already liked, already following), `checks` holds `{ \"check\": \"already\", \"already\": true }`."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Published.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostCreated"
                },
                "example": {
                  "object": "PostCreated",
                  "post_id": "3502987465123457001",
                  "status": "PUBLISHED"
                }
              }
            }
          },
          "202": {
            "description": "Instagram is still processing it, or Lempile started it after `Prefer: respond-async` (`post_id: null`): read `GET /writes/{key}`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostCreated"
                },
                "example": {
                  "object": "PostCreated",
                  "post_id": null,
                  "provider": "INSTAGRAM",
                  "status": "PROCESSING"
                }
              }
            }
          },
          "200": {
            "description": "A dry run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DryRun"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "`errors/in_progress`: the same key is still running, or its outcome isn't known yet.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "`errors/idempotency_key_reused`: the key was used for another request. Nothing was sent.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "`errors/service_unavailable`: the browser's answer was lost after the write started. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't confirm within 140 seconds. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "415": {
            "description": "`errors/unsupported_media_type`: a file Instagram doesn't take. Nothing was sent.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/posts/reaction": {
      "post": {
        "operationId": "Instagram_likePost",
        "summary": "Like a post",
        "tags": ["Posts"],
        "description": "Likes a post, or a comment with `comment_id`. `like` is the only reaction Instagram has.\n\nPaced per account: 30 seconds apart, 60 a day.\n\nScope: `accounts.write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. Sent without one, Lempile makes one and answers it in the same header, so the write still has a receipt.",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "example": "answer-jane-1"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["account_id", "post_id"],
                "properties": {
                  "account_id": {
                    "type": "string"
                  },
                  "post_id": {
                    "type": "string",
                    "description": "The post's `provider_id`, shortcode or link."
                  },
                  "reaction_type": {
                    "type": "string",
                    "enum": ["like"],
                    "default": "like"
                  },
                  "comment_id": {
                    "type": "string",
                    "description": "A comment's `provider_id`: that comment is liked."
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "`true`: everything up to the last step, nothing sent: `200` with `not_sent: true`. Not paced, no receipt. When the write is already so (already liked, already following), `checks` holds `{ \"check\": \"already\", \"already\": true }`."
                  }
                }
              },
              "example": {
                "account_id": "00000000-0000-4000-8000-0000000000c1",
                "post_id": "3502987465123456789",
                "reaction_type": "like"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Liked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReactionAdded"
                },
                "example": {
                  "object": "ReactionAdded"
                }
              }
            }
          },
          "200": {
            "description": "A dry run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DryRun"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "`errors/in_progress`: the same key is still running, or its outcome isn't known yet.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "`errors/idempotency_key_reused`: the key was used for another request. Nothing was sent.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "`errors/service_unavailable`: the browser's answer was lost after the write started. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't confirm within 140 seconds. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/posts/{post_id}": {
      "get": {
        "operationId": "Instagram_getPost",
        "summary": "Retrieve a post",
        "tags": ["Posts"],
        "description": "One `Post`.\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "post_id",
            "in": "path",
            "required": true,
            "description": "The post's `provider_id` (Instagram's media id), its shortcode or its link (`https://www.instagram.com/p/<shortcode>/`, or `/reel/<shortcode>/`).",
            "schema": {
              "type": "string"
            },
            "example": "DBx1yZaN0pQ"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          }
        ],
        "responses": {
          "200": {
            "description": "The post.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/posts/{post_id}/comments": {
      "get": {
        "operationId": "Instagram_listComments",
        "summary": "List comments",
        "tags": ["Posts"],
        "description": "A post's comments, in the order the post's page loads them; with `comment_id`, that comment's replies. `sort_by=MOST_RELEVANT` answers `501`: Instagram's web picks its own order.\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "post_id",
            "in": "path",
            "required": true,
            "description": "The post's `provider_id` (Instagram's media id), its shortcode or its link (`https://www.instagram.com/p/<shortcode>/`, or `/reel/<shortcode>/`).",
            "schema": {
              "type": "string"
            },
            "example": "3502987465123456789"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 100 (default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The previous page's `cursor`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "comment_id",
            "in": "query",
            "required": false,
            "description": "A comment's `provider_id`: its replies come back instead.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "`MOST_RELEVANT`: `501`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Comments.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommentList"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "Instagram_sendComment",
        "summary": "Comment on a post",
        "tags": ["Posts"],
        "description": "Types the comment in the post's own comment box. `@username` mentions the person; `comment_id` answers that comment instead. A dry run types the comment and clears it: Instagram shows nobody a comment being typed.\n\nPaced per account: 2 minutes apart, 20 a day.\n\nScope: `accounts.write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "post_id",
            "in": "path",
            "required": true,
            "description": "The post's `provider_id` (Instagram's media id), its shortcode or its link (`https://www.instagram.com/p/<shortcode>/`, or `/reel/<shortcode>/`).",
            "schema": {
              "type": "string"
            },
            "example": "3502987465123456789"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1–200 characters of `A-Z a-z 0-9 . _ : -`, scoped to your workspace. The same key with the same request replays the first answer; see Write receipts. A dry run needs none.",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "example": "answer-jane-1"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["account_id", "text"],
                "properties": {
                  "account_id": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1250
                  },
                  "comment_id": {
                    "type": "string",
                    "description": "A comment's `provider_id`: the comment answers it."
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "`true`: everything up to the last step, nothing sent: `200` with `not_sent: true`. Not paced, no receipt. When the write is already so (already liked, already following), `checks` holds `{ \"check\": \"already\", \"already\": true }`."
                  }
                }
              },
              "example": {
                "account_id": "00000000-0000-4000-8000-0000000000c1",
                "text": "Lovely work, @sam.example"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Commented.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommentSent"
                },
                "example": {
                  "object": "CommentSent",
                  "comment_id": "18034567890123999"
                }
              }
            }
          },
          "200": {
            "description": "A dry run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DryRun"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "`errors/in_progress`: the same key is still running, or its outcome isn't known yet.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "`errors/idempotency_key_reused`: the key was used for another request. Nothing was sent.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "`errors/service_unavailable`: the browser's answer was lost after the write started. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't confirm within 140 seconds. Not sure: read the receipt before sending again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/posts/{post_id}/reactions": {
      "get": {
        "operationId": "Instagram_listLikes",
        "summary": "List likes",
        "tags": ["Posts"],
        "description": "Who liked a post (with `comment_id`, a comment), as the likes list loads.\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "post_id",
            "in": "path",
            "required": true,
            "description": "The post's `provider_id` (Instagram's media id), its shortcode or its link (`https://www.instagram.com/p/<shortcode>/`, or `/reel/<shortcode>/`).",
            "schema": {
              "type": "string"
            },
            "example": "3502987465123456789"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "The connected Instagram account: its Lempile id (a UUID), its Instagram user id or its username.",
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-0000000000c1"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 100 (default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The previous page's `cursor`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "comment_id",
            "in": "query",
            "required": false,
            "description": "A comment's `provider_id`: who liked it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Likes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostReactionList"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`errors/too_many_requests`: the account's pace (`code`: `too_fast`, `daily_limit` or `hourly_limit`; wait until `retry_at`), or Instagram's own \"Try again later\" (`retry_after: 86400`: wait a day before writing from the account again). Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "501": {
            "description": "`errors/feature_not_implemented`: a field or option Lempile doesn't do for Instagram (`detail` says which), or an account of another network. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`errors/service_unavailable`: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "504": {
            "description": "`errors/request_timeout`: Instagram didn't answer within 100 seconds. A read changed nothing: try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks": {
      "post": {
        "operationId": "Instagram_createWebhook",
        "summary": "Register a webhook",
        "tags": ["Webhooks"],
        "description": "Lempile calls `request_url` when something happens on an Instagram account. `messaging`: `message_received`, `message_read`, `message_reaction`, read from each account's inbox about every 10 minutes (not between 23:00 and 07:00 in the account's own time zone). `account_status`: the workspace's accounts, Instagram's included: connected, signed out, stopped by a security check, suspended, reconnected or removed (`AccountStatus.message` as Unipile, plus Lempile's `status`, `previous_status` and `reason`). The answer's `secret` signs every call (`X-Lempile-Signature`); it's shown this once.\n\nScope: `accounts.write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["request_url", "source"],
                "properties": {
                  "request_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "An `https://` address on the public internet (no IP address, `localhost` or internal name)."
                  },
                  "source": {
                    "type": "string",
                    "enum": ["messaging", "account_status"]
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "The events to send. A `messaging` webhook without `events` gets `message_received` only, as on Unipile. An `account_status` webhook takes Unipile's names (`creation_success`, `reconnected`, `ok`, `connecting`, `credentials`, `deleted`) or Lempile's (`account.status.disconnected`…); without `events` it gets all of them."
                  },
                  "account_ids": {
                    "type": "array",
                    "maxItems": 50,
                    "items": {
                      "type": "string"
                    },
                    "description": "`messaging` only: the workspace's Instagram accounts, by their Lempile id. Without it, every Instagram account of the workspace."
                  },
                  "format": {
                    "type": "string",
                    "enum": ["json", "form"],
                    "default": "json",
                    "description": "`messaging` only."
                  },
                  "data": {
                    "type": "array",
                    "maxItems": 40,
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    },
                    "description": "`messaging` only: the payload then holds only these keys, each under its new `name`."
                  },
                  "enabled": {
                    "type": "boolean",
                    "default": true,
                    "description": "`messaging` only."
                  },
                  "name": {
                    "type": "string",
                    "description": "Your name for it, sent as `webhook_name`."
                  },
                  "headers": {
                    "type": "array",
                    "maxItems": 10,
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "value": {
                          "type": "string"
                        }
                      }
                    },
                    "description": "Headers added to every call."
                  }
                }
              },
              "example": {
                "request_url": "https://hooks.example.com/instagram",
                "name": "inbox",
                "source": "messaging",
                "events": ["message_received", "message_reaction"],
                "account_ids": ["00000000-0000-4000-8000-0000000000c1"]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Registered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookCreated"
                },
                "example": {
                  "object": "WebhookCreated",
                  "webhook_id": "8c0b6a7e-3f52-4d1e-9a40-2b7c5d9e1f03",
                  "secret": "whsec_…"
                }
              }
            }
          },
          "400": {
            "description": "`errors/invalid_parameters`: a field Lempile won't take; `detail` names it. Nothing was opened.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "Instagram_listWebhooks",
        "summary": "List webhooks",
        "tags": ["Webhooks"],
        "description": "The workspace's webhooks, header values masked. A `messaging` one also shows `account_ids` (each `{ id, name, type }`), `format`, `data` and `type: \"AUTO\"`.\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Webhooks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookList"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/{webhook_id}": {
      "delete": {
        "operationId": "Instagram_deleteWebhook",
        "summary": "Delete a webhook",
        "tags": ["Webhooks"],
        "description": "Removes one webhook.\n\nScope: `accounts.write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeleted"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`errors/resource_not_found`: no such account in this workspace, or no such chat, message, person or post.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/writes/{key}": {
      "get": {
        "operationId": "Instagram_getWrite",
        "summary": "Retrieve a write receipt",
        "tags": ["Write receipts"],
        "description": "What became of one write, by its `Idempotency-Key`. `state` is `done` (sent: `response` is the answer), `failed` (nothing was sent: `response` is the problem), `pending` (still running, or not sure; `response` is `null`) or `none` (no write with that key: a dry run, for example). The browser's answer is kept 48 hours, also after the request stopped waiting.\n\nAfter a not-sure post, Lempile checks the account's own profile itself: the post is there (`done`, with its `post_id`), or two complete reads of the profile, 15 and 30 minutes after the post, find nothing new (`failed`, `422 errors/not_sent`: it can be sent again). While it checks, for 90 minutes at most, the receipt is `pending` with a `detail` and `check_ends_by`. When the check can't tell, it stays `pending`: check on Instagram, then mark it not sent if it isn't there.\n\nScope: `accounts.read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "description": "The write's Idempotency-Key.",
            "schema": {
              "type": "string"
            },
            "example": "answer-jane-1"
          }
        ],
        "responses": {
          "200": {
            "description": "The receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WriteStatus"
                },
                "example": {
                  "object": "WriteStatus",
                  "key": "answer-jane-1",
                  "state": "done",
                  "status": 201,
                  "response": {
                    "object": "MessageSent",
                    "message_id": "340282366841710301244276026398105347911_cAAAAB3xYz9wQkLmNo"
                  }
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/writes/{key}/not-sent": {
      "post": {
        "operationId": "Instagram_releaseWrite",
        "summary": "Mark a write not sent",
        "tags": ["Write receipts"],
        "description": "After you checked on Instagram that a pending write isn't there: it becomes `failed`, its key can be sent again, and it stops counting toward the pace. A write Lempile has as sent stays sent (`409`).\n\nScope: `accounts.write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "description": "The write's Idempotency-Key.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Marked not sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WriteStatus"
                }
              }
            }
          },
          "404": {
            "description": "No write with this key.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Sent, too recent, still running, or Lempile is still checking the account's profile for the post: the answer has `check_ends_by` and a `Retry-After` header. Also for a post Lempile can't speak for yet (it restarted during the post), up to 2 hours after it: read the receipt again after `Retry-After`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "A missing or invalid API key answers `{ \"error\": \"unauthorized\", \"message\" }`. `errors/disconnected_account` (problem JSON): Instagram signed the account out; connect it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "unauthorized",
                  "message": "…"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`subscription_required` (in `error`): the workspace has no active trial or subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                },
                "example": {
                  "error": "subscription_required",
                  "message": "…"
                }
              }
            }
          },
          "403": {
            "description": "`errors/insufficient_permissions` (the key lacks the scope), `errors/account_restricted` (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or `errors/action_required` (the account waits for something done on Instagram itself; `account_status` and `reason` say what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-KEY"
      }
    },
    "schemas": {
      "ErrorBody": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": ["error"]
      },
      "Problem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "example": "errors/too_many_requests"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string",
            "description": "What happened, in words, and whether anything was done."
          },
          "code": {
            "type": "string",
            "description": "On a `429`: `too_fast`, `daily_limit` or `hourly_limit`."
          },
          "retry_after": {
            "type": "integer",
            "description": "Seconds to wait."
          },
          "retry_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": ["type", "status"]
      },
      "Account": {
        "type": "object",
        "properties": {
          "object": {
            "const": "Account"
          },
          "type": {
            "const": "INSTAGRAM"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": ["OK", "CONNECTING", "CREDENTIALS", "ERROR"]
                }
              }
            }
          }
        }
      },
      "AccountList": {
        "type": "object",
        "properties": {
          "object": {
            "const": "list"
          },
          "count": {
            "type": "integer"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "provider": {
                  "type": "string",
                  "example": "instagram"
                },
                "display_name": {
                  "type": "string"
                },
                "public_identifier": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "restriction": {
                  "type": ["object", "null"],
                  "description": "Why Instagram restricted the account, and since when."
                },
                "connected_at": {
                  "type": "string"
                },
                "created_at": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "AccountCreated": {
        "type": "object",
        "properties": {
          "object": {
            "const": "AccountCreated"
          },
          "account_id": {
            "type": "string"
          }
        }
      },
      "AccountReconnected": {
        "type": "object",
        "properties": {
          "object": {
            "const": "AccountReconnected"
          },
          "account_id": {
            "type": "string"
          }
        }
      },
      "AccountDeleted": {
        "type": "object",
        "properties": {
          "object": {
            "const": "AccountDeleted"
          }
        }
      },
      "Checkpoint": {
        "type": "object",
        "properties": {
          "object": {
            "const": "Checkpoint"
          },
          "account_id": {
            "type": "string"
          },
          "checkpoint": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["OTP", "2FA", "IN_APP_VALIDATION", "CONNECTING"],
                "description": "`OTP`: a code Instagram sent (`source`: `EMAIL`, `SMS` or `WHATSAPP`). `2FA`: the account's two-factor code (`APP` or `SMS`). `IN_APP_VALIDATION`: someone approves the sign-in in the Instagram app (`number` is the number to tap there, when Instagram shows one); then read the account until it's `OK`. `CONNECTING`: Instagram is still signing in after 60 seconds; read the account until it's `OK`."
              },
              "source": {
                "type": "string"
              },
              "number": {
                "type": "string",
                "description": "`IN_APP_VALIDATION`: the number to tap in the app, when Instagram shows one."
              },
              "can_try_another_way": {
                "type": "boolean"
              }
            }
          }
        }
      },
      "CheckpointResend": {
        "type": "object",
        "properties": {
          "object": {
            "const": "CheckpointResend"
          },
          "account_id": {
            "type": "string"
          },
          "success": {
            "type": "boolean"
          }
        }
      },
      "HostedAuthUrl": {
        "type": "object",
        "properties": {
          "object": {
            "const": "HostedAuthUrl"
          },
          "url": {
            "type": "string"
          }
        }
      },
      "Chat": {
        "type": "object",
        "properties": {
          "object": {
            "const": "Chat"
          },
          "id": {
            "type": "string"
          },
          "account_id": {
            "type": "string",
            "description": "The account's Lempile id, whichever form you sent."
          },
          "account_type": {
            "const": "INSTAGRAM"
          },
          "provider_id": {
            "type": "string"
          },
          "attendee_provider_id": {
            "type": "string",
            "description": "The other person in a one-to-one chat."
          },
          "name": {
            "type": ["string", "null"]
          },
          "type": {
            "type": "integer",
            "enum": [0, 1],
            "description": "`0` one person, `1` a group."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "unread_count": {
            "type": "integer"
          },
          "archived": {
            "type": "integer",
            "enum": [0, 1]
          },
          "muted_until": {
            "type": ["string", "null"]
          },
          "read_only": {
            "type": "integer",
            "enum": [0, 1]
          },
          "folder": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": ["INBOX_INSTAGRAM_GENERAL", "PENDING"]
            },
            "description": "`PENDING` is a message request the account received."
          },
          "pinned": {
            "type": "integer",
            "enum": [0, 1]
          },
          "lastMessage": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "object": {
                    "const": "Message"
                  },
                  "id": {
                    "type": "string"
                  },
                  "message_id": {
                    "type": "string"
                  },
                  "provider_id": {
                    "type": "string",
                    "description": "Instagram's message id alone."
                  },
                  "account_id": {
                    "type": "string"
                  },
                  "chat_id": {
                    "type": "string"
                  },
                  "chat_provider_id": {
                    "type": "string"
                  },
                  "sender_id": {
                    "type": "string"
                  },
                  "sender_attendee_id": {
                    "type": "string"
                  },
                  "text": {
                    "type": ["string", "null"]
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "img",
                            "video",
                            "audio",
                            "media_share",
                            "profile"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "description": "Instagram's own link, which expires: `GET /messages/{message_id}/attachments/{attachment_id}` reads the file."
                        },
                        "voice_note": {
                          "type": "boolean"
                        },
                        "post": {
                          "type": "object"
                        },
                        "story": {
                          "type": "object"
                        }
                      }
                    }
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "is_sender": {
                    "type": "integer",
                    "enum": [0, 1],
                    "description": "`1` for the account's own messages."
                  },
                  "reactions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "value": {
                          "type": "string"
                        },
                        "sender_id": {
                          "type": "string"
                        },
                        "is_sender": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "seen": {
                    "type": "integer",
                    "enum": [0, 1]
                  },
                  "seen_by": {
                    "type": "object"
                  },
                  "hidden": {
                    "type": "integer",
                    "enum": [0, 1]
                  },
                  "deleted": {
                    "type": "integer",
                    "enum": [0, 1]
                  },
                  "edited": {
                    "type": "integer",
                    "enum": [0, 1]
                  },
                  "is_event": {
                    "type": "integer",
                    "enum": [0, 1]
                  },
                  "delivered": {
                    "type": "integer",
                    "enum": [0, 1]
                  },
                  "behavior": {
                    "type": "null"
                  },
                  "original": {
                    "type": "string"
                  },
                  "message_type": {
                    "type": ["string", "null"],
                    "enum": ["STORY_MENTION", "STORY_REPLY", null],
                    "description": "`STORY_MENTION`: they mentioned the account in their story. `STORY_REPLY`: they answered one of its stories. `null`: a plain message."
                  },
                  "marks_seen": {
                    "type": "boolean"
                  }
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "`GET /chats/{chat_id}` only."
          },
          "marks_seen": {
            "type": "boolean"
          }
        }
      },
      "ChatList": {
        "type": "object",
        "properties": {
          "object": {
            "const": "ChatList"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Chat"
            }
          },
          "cursor": {
            "type": ["string", "null"],
            "description": "Pass it back as `cursor` for the next page; `null` when there's no more."
          }
        }
      },
      "Message": {
        "type": "object",
        "properties": {
          "object": {
            "const": "Message"
          },
          "id": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          },
          "provider_id": {
            "type": "string",
            "description": "Instagram's message id alone."
          },
          "account_id": {
            "type": "string"
          },
          "chat_id": {
            "type": "string"
          },
          "chat_provider_id": {
            "type": "string"
          },
          "sender_id": {
            "type": "string"
          },
          "sender_attendee_id": {
            "type": "string"
          },
          "text": {
            "type": ["string", "null"]
          },
          "attachments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": ["img", "video", "audio", "media_share", "profile"]
                },
                "url": {
                  "type": "string",
                  "description": "Instagram's own link, which expires: `GET /messages/{message_id}/attachments/{attachment_id}` reads the file."
                },
                "voice_note": {
                  "type": "boolean"
                },
                "post": {
                  "type": "object"
                },
                "story": {
                  "type": "object"
                }
              }
            }
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "is_sender": {
            "type": "integer",
            "enum": [0, 1],
            "description": "`1` for the account's own messages."
          },
          "reactions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "value": {
                  "type": "string"
                },
                "sender_id": {
                  "type": "string"
                },
                "is_sender": {
                  "type": "boolean"
                }
              }
            }
          },
          "seen": {
            "type": "integer",
            "enum": [0, 1]
          },
          "seen_by": {
            "type": "object"
          },
          "hidden": {
            "type": "integer",
            "enum": [0, 1]
          },
          "deleted": {
            "type": "integer",
            "enum": [0, 1]
          },
          "edited": {
            "type": "integer",
            "enum": [0, 1]
          },
          "is_event": {
            "type": "integer",
            "enum": [0, 1]
          },
          "delivered": {
            "type": "integer",
            "enum": [0, 1]
          },
          "behavior": {
            "type": "null"
          },
          "original": {
            "type": "string"
          },
          "message_type": {
            "type": ["string", "null"],
            "enum": ["STORY_MENTION", "STORY_REPLY", null],
            "description": "`STORY_MENTION`: they mentioned the account in their story. `STORY_REPLY`: they answered one of its stories. `null`: a plain message."
          },
          "marks_seen": {
            "type": "boolean"
          }
        }
      },
      "MessageList": {
        "type": "object",
        "properties": {
          "object": {
            "const": "MessageList"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Message"
            }
          },
          "cursor": {
            "type": ["string", "null"],
            "description": "Pass it back as `cursor` for the next page; `null` when there's no more."
          }
        }
      },
      "MessageSent": {
        "type": "object",
        "properties": {
          "object": {
            "const": "MessageSent"
          },
          "message_id": {
            "type": "string"
          }
        }
      },
      "ChatStarted": {
        "type": "object",
        "properties": {
          "object": {
            "const": "ChatStarted"
          },
          "chat_id": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          }
        }
      },
      "MessageReactionAdded": {
        "type": "object",
        "properties": {
          "object": {
            "const": "MessageReactionAdded"
          },
          "success": {
            "type": "boolean"
          }
        }
      },
      "MessageReactionRemoved": {
        "type": "object",
        "properties": {
          "object": {
            "const": "MessageReactionRemoved"
          },
          "success": {
            "type": "boolean"
          }
        }
      },
      "ChatHistorySync": {
        "type": "object",
        "properties": {
          "object": {
            "const": "ChatHistorySync"
          },
          "chat_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": ["SYNC_DONE", "CHAT_DELETED"]
          }
        }
      },
      "ChatAttendee": {
        "type": "object",
        "properties": {
          "object": {
            "const": "ChatAttendee"
          },
          "id": {
            "type": "string",
            "description": "The person's `provider_id`."
          },
          "account_id": {
            "type": "string"
          },
          "provider_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "is_self": {
            "type": "integer",
            "enum": [0, 1]
          },
          "picture_url": {
            "type": "string"
          },
          "profile_url": {
            "type": "string"
          },
          "specifics": {
            "type": "object",
            "properties": {
              "provider": {
                "const": "INSTAGRAM"
              },
              "public_identifier": {
                "type": "string"
              },
              "relationship_status": {
                "type": "object",
                "properties": {
                  "following": {
                    "type": "boolean"
                  },
                  "followed_by": {
                    "type": "boolean"
                  },
                  "has_sent_invitation": {
                    "type": "boolean"
                  },
                  "has_received_invitation": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      },
      "ChatAttendeeList": {
        "type": "object",
        "properties": {
          "object": {
            "const": "ChatAttendeeList"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatAttendee"
            }
          },
          "cursor": {
            "type": ["string", "null"],
            "description": "Pass it back as `cursor` for the next page; `null` when there's no more."
          }
        }
      },
      "UserProfile": {
        "type": "object",
        "properties": {
          "object": {
            "const": "UserProfile"
          },
          "provider": {
            "const": "INSTAGRAM"
          },
          "provider_id": {
            "type": "string",
            "description": "Instagram's user id."
          },
          "provider_messaging_id": {
            "type": "string",
            "description": "What Unipile's `POST /chats` asks for in `attendees_ids`."
          },
          "public_identifier": {
            "type": "string",
            "description": "The username."
          },
          "full_name": {
            "type": "string"
          },
          "profile_picture_url": {
            "type": "string"
          },
          "profile_picture_url_large": {
            "type": "string"
          },
          "biography": {
            "type": "string"
          },
          "category": {
            "type": ["string", "null"]
          },
          "followers_count": {
            "type": "integer"
          },
          "mutual_followers_count": {
            "type": "integer"
          },
          "following_count": {
            "type": "integer"
          },
          "posts_count": {
            "type": "integer"
          },
          "profile_type": {
            "type": "string",
            "enum": ["PERSONNAL", "BUSINESS", "PROFESSIONNAL"],
            "description": "Spelled as Unipile spells them; `PROFESSIONNAL` is a creator account."
          },
          "is_verified": {
            "type": "boolean"
          },
          "is_private": {
            "type": "boolean"
          },
          "external_links": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "business": {
            "type": "object",
            "description": "Category, address, phone and email, when the account shows them."
          },
          "relationship_status": {
            "type": "object",
            "properties": {
              "following": {
                "type": "boolean"
              },
              "followed_by": {
                "type": "boolean"
              },
              "has_sent_invitation": {
                "type": "boolean"
              },
              "has_received_invitation": {
                "type": "boolean"
              }
            },
            "description": "The account's side: `following` (it follows them), `followed_by` (they follow it), `has_sent_invitation` (it asked to follow a private account), `has_received_invitation` (they asked to follow it)."
          }
        }
      },
      "AccountOwnerProfile": {
        "type": "object",
        "properties": {
          "object": {
            "const": "AccountOwnerProfile"
          },
          "provider": {
            "const": "INSTAGRAM"
          },
          "provider_id": {
            "type": "string",
            "description": "Instagram's user id."
          },
          "provider_messaging_id": {
            "type": "string",
            "description": "What Unipile's `POST /chats` asks for in `attendees_ids`."
          },
          "public_identifier": {
            "type": "string",
            "description": "The username."
          },
          "full_name": {
            "type": "string"
          },
          "profile_picture_url": {
            "type": "string"
          },
          "profile_picture_url_large": {
            "type": "string"
          },
          "biography": {
            "type": "string"
          },
          "category": {
            "type": ["string", "null"]
          },
          "followers_count": {
            "type": "integer"
          },
          "mutual_followers_count": {
            "type": "integer"
          },
          "following_count": {
            "type": "integer"
          },
          "posts_count": {
            "type": "integer"
          },
          "profile_type": {
            "type": "string",
            "enum": ["PERSONNAL", "BUSINESS", "PROFESSIONNAL"],
            "description": "Spelled as Unipile spells them; `PROFESSIONNAL` is a creator account."
          },
          "is_verified": {
            "type": "boolean"
          },
          "is_private": {
            "type": "boolean"
          },
          "external_links": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "business": {
            "type": "object",
            "description": "Category, address, phone and email, when the account shows them."
          },
          "relationship_status": {
            "type": "object",
            "properties": {
              "following": {
                "type": "boolean"
              },
              "followed_by": {
                "type": "boolean"
              },
              "has_sent_invitation": {
                "type": "boolean"
              },
              "has_received_invitation": {
                "type": "boolean"
              }
            },
            "description": "The account's side: `following` (it follows them), `followed_by` (they follow it), `has_sent_invitation` (it asked to follow a private account), `has_received_invitation` (they asked to follow it)."
          }
        }
      },
      "UserFollowersList": {
        "type": "object",
        "properties": {
          "object": {
            "const": "UserFollowersList"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "const": "UserFollower"
                },
                "id": {
                  "type": "string"
                },
                "messaging_id": {
                  "type": "string",
                  "description": "Always `\"\"` (Unipile no longer fills it for Instagram)."
                },
                "username": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "profile_picture_url": {
                  "type": "string"
                },
                "is_private": {
                  "type": "boolean"
                },
                "is_verified": {
                  "type": "boolean"
                }
              }
            }
          },
          "cursor": {
            "type": ["string", "null"],
            "description": "Pass it back as `cursor` for the next page; `null` when there's no more."
          }
        }
      },
      "UserInvitationSent": {
        "type": "object",
        "properties": {
          "object": {
            "const": "UserInvitationSent"
          },
          "invitation_id": {
            "type": "string",
            "description": "The person's `provider_id`."
          }
        }
      },
      "InvitationCanceled": {
        "type": "object",
        "properties": {
          "object": {
            "const": "InvitationCanceled"
          }
        }
      },
      "InvitationList": {
        "type": "object",
        "properties": {
          "object": {
            "const": "InvitationList"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The person's `provider_id`."
                }
              }
            }
          },
          "cursor": {
            "type": ["string", "null"],
            "description": "Pass it back as `cursor` for the next page; `null` when there's no more."
          }
        }
      },
      "UserInvitationHandled": {
        "type": "object",
        "properties": {
          "object": {
            "const": "UserInvitationHandled"
          },
          "status": {
            "type": "string",
            "enum": ["ACCEPTED", "DECLINED"]
          }
        }
      },
      "ProfileEdited": {
        "type": "object",
        "properties": {
          "object": {
            "const": "ProfileEdited"
          }
        }
      },
      "Post": {
        "type": "object",
        "properties": {
          "object": {
            "const": "Post"
          },
          "provider": {
            "const": "INSTAGRAM"
          },
          "provider_id": {
            "type": "string"
          },
          "has_audio": {
            "type": "boolean"
          },
          "has_liked": {
            "type": "boolean"
          },
          "like_count": {
            "type": "integer"
          },
          "comment_count": {
            "type": "integer"
          },
          "like_and_view_counts_disabled": {
            "type": "boolean"
          },
          "comments_disabled": {
            "type": "boolean"
          },
          "accessibility_caption": {
            "type": ["string", "null"]
          },
          "caption": {
            "type": "object",
            "properties": {
              "edited": {
                "type": "boolean"
              },
              "has_translation": {
                "type": "boolean"
              },
              "created_at": {
                "type": "integer",
                "description": "When it was posted, in seconds since 1970."
              },
              "text": {
                "type": "string"
              }
            }
          },
          "preview_image": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              },
              "width": {
                "type": "integer"
              },
              "height": {
                "type": "integer"
              }
            }
          },
          "video": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              },
              "width": {
                "type": "integer"
              },
              "height": {
                "type": "integer"
              }
            },
            "description": "A video or reel."
          },
          "owner": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "username": {
                "type": "string"
              },
              "profile_pic_url": {
                "type": "string"
              },
              "is_verified": {
                "type": "boolean"
              },
              "is_private": {
                "type": "boolean"
              }
            }
          },
          "location": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "lat": {
                "type": "number"
              },
              "lng": {
                "type": "number"
              }
            }
          }
        }
      },
      "PostList": {
        "type": "object",
        "properties": {
          "object": {
            "const": "PostList"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Post"
            }
          },
          "cursor": {
            "type": ["string", "null"],
            "description": "Pass it back as `cursor` for the next page; `null` when there's no more."
          },
          "paging": {
            "type": "object",
            "properties": {
              "page_count": {
                "type": "integer"
              }
            }
          }
        }
      },
      "Comment": {
        "type": "object",
        "properties": {
          "object": {
            "const": "Comment"
          },
          "id": {
            "type": "string",
            "description": "The same as `provider_id`."
          },
          "provider_id": {
            "type": "string"
          },
          "author": {
            "type": "object",
            "properties": {
              "provider_id": {
                "type": ["string", "null"],
                "description": "`null` when Instagram's page didn't show it."
              },
              "messaging_id": {
                "type": "string"
              },
              "public_identifier": {
                "type": "string"
              },
              "pk": {
                "type": "string"
              },
              "profile_pic_url": {
                "type": "string"
              },
              "is_verified": {
                "type": "boolean"
              }
            }
          },
          "text": {
            "type": "string"
          },
          "created_at": {
            "type": "integer",
            "description": "Seconds since 1970."
          },
          "is_covered": {
            "type": "boolean"
          },
          "child_comment_count": {
            "type": "integer"
          },
          "restricted_status": {
            "type": ["string", "null"]
          },
          "has_liked_comment": {
            "type": "boolean"
          },
          "giphy_media_info": {
            "type": ["object", "null"]
          },
          "parent_comment_id": {
            "type": ["string", "null"]
          },
          "comment_like_count": {
            "type": "integer"
          }
        }
      },
      "CommentList": {
        "type": "object",
        "properties": {
          "object": {
            "const": "CommentList"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Comment"
            }
          },
          "cursor": {
            "type": ["string", "null"],
            "description": "Pass it back as `cursor` for the next page; `null` when there's no more."
          },
          "total_items": {
            "type": "integer"
          },
          "paging": {
            "type": "object",
            "properties": {
              "start": {
                "type": ["integer", "null"]
              },
              "page_count": {
                "type": "integer"
              },
              "total_count": {
                "type": "integer"
              }
            }
          }
        }
      },
      "CommentSent": {
        "type": "object",
        "properties": {
          "object": {
            "const": "CommentSent"
          },
          "comment_id": {
            "type": "string"
          }
        }
      },
      "PostReactionList": {
        "type": "object",
        "properties": {
          "object": {
            "const": "PostReactionList"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "const": "PostReaction"
                },
                "value": {
                  "const": "LIKE"
                },
                "post_id": {
                  "type": "string"
                },
                "comment_id": {
                  "type": ["string", "null"],
                  "description": "The comment, when the likes are a comment's."
                },
                "author": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": ["string", "null"],
                      "description": "`null` when Instagram's page didn't show it."
                    },
                    "type": {
                      "const": "INDIVIDUAL"
                    },
                    "name": {
                      "type": "string"
                    },
                    "headline": {
                      "const": ""
                    },
                    "network_distance": {
                      "type": "null"
                    },
                    "public_identifier": {
                      "type": "string"
                    },
                    "profile_url": {
                      "type": "string"
                    },
                    "profile_picture_url": {
                      "type": "string"
                    },
                    "is_verified": {
                      "type": "boolean"
                    },
                    "is_private": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "paging": {
            "type": "object",
            "properties": {
              "cursor": {
                "type": ["string", "null"]
              },
              "start": {
                "type": ["integer", "null"]
              },
              "page_count": {
                "type": "integer"
              },
              "total_count": {
                "type": "integer"
              }
            }
          }
        }
      },
      "ReactionAdded": {
        "type": "object",
        "properties": {
          "object": {
            "const": "ReactionAdded"
          }
        }
      },
      "PostCreated": {
        "type": "object",
        "properties": {
          "object": {
            "const": "PostCreated"
          },
          "post_id": {
            "type": ["string", "null"],
            "description": "`null` only in the `202` after `Prefer: respond-async`."
          },
          "status": {
            "type": "string",
            "enum": ["PUBLISHED", "PROCESSING"]
          }
        }
      },
      "DryRun": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "description": "The write's own dry-run object, for example `MessageDryRun`."
          },
          "not_sent": {
            "const": true
          },
          "checks": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "WebhookCreated": {
        "type": "object",
        "properties": {
          "object": {
            "const": "WebhookCreated"
          },
          "webhook_id": {
            "type": "string"
          },
          "secret": {
            "type": "string",
            "description": "Signs every call. Shown this once: store it."
          }
        }
      },
      "WebhookList": {
        "type": "object",
        "properties": {
          "object": {
            "const": "WebhookList"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "WebhookDeleted": {
        "type": "object",
        "properties": {
          "object": {
            "const": "WebhookDeleted"
          }
        }
      },
      "WriteStatus": {
        "type": "object",
        "properties": {
          "object": {
            "const": "WriteStatus"
          },
          "key": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": ["none", "pending", "done", "failed"]
          },
          "status": {
            "type": "integer"
          },
          "response": {
            "type": ["object", "null"]
          },
          "detail": {
            "type": "string",
            "description": "Only while Lempile checks the account's profile for a not-sure post: its next look and when it ends."
          },
          "check_ends_by": {
            "type": "string",
            "format": "date-time",
            "description": "Only while Lempile checks the account's profile for a not-sure post: it settles the write by then at the latest."
          }
        }
      }
    }
  }
}
