{
  "openapi": "3.1.0",
  "info": {
    "title": "LKDN Autopilot API",
    "version": "1.0.0",
    "description": "The client's own LinkedIn account through LKDN Autopilot. One account per key, one daily budget shared with the autopilot. Documentation: https://lkdnautopilot.com/api-doc/"
  },
  "servers": [
    {
      "url": "https://ayuhpqrbmizgsjstmcrt.supabase.co/functions/v1/public-api"
    }
  ],
  "paths": {
    "/v1/me": {
      "get": {
        "operationId": "get_me",
        "summary": "My LinkedIn profile",
        "description": "The user's own LinkedIn profile, the connection status and plan of the account, and the InMail credits left.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/usage": {
      "get": {
        "operationId": "get_usage",
        "summary": "Today's budget",
        "description": "What the account may still do today: for each action (visits, invitations, messages, InMails, comments, reactions, posts, profile reads, search results) how much was used and the limit, shared with the autopilot, plus the activity hours. Call it before planning several actions.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/people/{id}": {
      "get": {
        "operationId": "get_person",
        "summary": "Read a profile",
        "description": "Reads a LinkedIn profile without notifying the person (no \"viewed your profile\"). Costs one profile read from the daily budget.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/people/{id}/visits": {
      "post": {
        "operationId": "visit_person",
        "summary": "Visit a profile (notified)",
        "description": "Visits a profile so that the person sees the user looked at them. It acts for real on the user's own LinkedIn account and the other person is notified. It spends from the daily budget the autopilot uses too (see get_usage). Before calling it, show the user the exact text and get an explicit yes. Requires the write scope.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/people/{id}/posts": {
      "get": {
        "operationId": "list_person_posts",
        "summary": "Posts of a person",
        "description": "The recent posts of a person.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The page.next_cursor of the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/connections": {
      "get": {
        "operationId": "list_connections",
        "summary": "My connections",
        "description": "The user's first-degree connections, newest first, optionally filtered by name.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The page.next_cursor of the previous page."
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            },
            "description": "Filter by name."
          }
        ],
        "responses": {
          "200": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/invitations": {
      "get": {
        "operationId": "list_invitations",
        "summary": "Pending invitations",
        "description": "The connection requests the user sent and that are still pending, or the ones they received.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "direction",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "sent",
                "received"
              ],
              "default": "sent"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The page.next_cursor of the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "operationId": "send_invitation",
        "summary": "Send a connection request",
        "description": "Sends a LinkedIn connection request, with an optional note of at most 300 characters (not available on a free LinkedIn plan). LinkedIn allows few invitations a week: the budget is small. It acts for real on the user's own LinkedIn account and the other person is notified. It spends from the daily budget the autopilot uses too (see get_usage). Before calling it, show the user the exact text and get an explicit yes. Requires the write scope.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "person_id"
                ],
                "properties": {
                  "person_id": {
                    "type": "string",
                    "description": "A person id (per_...) or a LinkedIn public identifier."
                  },
                  "message": {
                    "type": "string",
                    "maxLength": 300,
                    "description": "Optional note; not available on a free LinkedIn plan."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/invitations/{id}": {
      "delete": {
        "operationId": "withdraw_invitation",
        "summary": "Withdraw a connection request",
        "description": "Withdraws a pending connection request the user sent (id from list_invitations). Spends one action from the daily budget. Requires the write scope.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/conversations": {
      "get": {
        "operationId": "list_conversations",
        "summary": "My conversations",
        "description": "The user's LinkedIn conversations, most recent first. The texts are read live from the account and are not stored by LKDN Autopilot.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "unread",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The page.next_cursor of the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "operationId": "start_conversation",
        "summary": "Write to a person",
        "description": "Starts a conversation with a first-degree connection, or sends an InMail (inmail: true, uses one InMail credit) to someone who is not connected. It acts for real on the user's own LinkedIn account and the other person is notified. It spends from the daily budget the autopilot uses too (see get_usage). Before calling it, show the user the exact text and get an explicit yes. Requires the write scope.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "person_id",
                  "text"
                ],
                "properties": {
                  "person_id": {
                    "type": "string",
                    "description": "A person id (per_...) or a LinkedIn public identifier."
                  },
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 8000
                  },
                  "inmail": {
                    "type": "boolean"
                  },
                  "subject": {
                    "type": "string",
                    "maxLength": 200
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/conversations/{id}": {
      "get": {
        "operationId": "get_conversation",
        "summary": "get_conversation",
        "description": "",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/conversations/{id}/messages": {
      "get": {
        "operationId": "list_messages",
        "summary": "Read a conversation",
        "description": "The messages of one conversation, newest first.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The page.next_cursor of the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "operationId": "send_message",
        "summary": "Reply in a conversation",
        "description": "Sends a message in an existing one-to-one conversation. It acts for real on the user's own LinkedIn account and the other person is notified. It spends from the daily budget the autopilot uses too (see get_usage). Before calling it, show the user the exact text and get an explicit yes. Requires the write scope.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 8000
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/posts/{id}": {
      "get": {
        "operationId": "get_post",
        "summary": "Read a post",
        "description": "One LinkedIn post: text, author and counts.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/posts/{id}/comments": {
      "get": {
        "operationId": "list_post_comments",
        "summary": "Comments of a post",
        "description": "The comments of a post.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The page.next_cursor of the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "operationId": "comment_on_post",
        "summary": "Comment on a post",
        "description": "Comments on a post, or replies to a comment (reply_to: a comment id). The author is notified. It acts for real on the user's own LinkedIn account and the other person is notified. It spends from the daily budget the autopilot uses too (see get_usage). Before calling it, show the user the exact text and get an explicit yes. Requires the write scope.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1250
                  },
                  "reply_to": {
                    "type": "string",
                    "description": "A comment id (cmt_...)."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/posts/{id}/reactions": {
      "get": {
        "operationId": "list_post_reactions",
        "summary": "Reactions to a post",
        "description": "Who reacted to a post, and how.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The page.next_cursor of the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "operationId": "react_to_post",
        "summary": "React to a post",
        "description": "Adds a reaction to a post (like, celebrate, support, love, insightful, funny). The author is notified. It acts for real on the user's own LinkedIn account and the other person is notified. It spends from the daily budget the autopilot uses too (see get_usage). Before calling it, show the user the exact text and get an explicit yes. Requires the write scope.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "like",
                      "celebrate",
                      "support",
                      "love",
                      "insightful",
                      "funny"
                    ],
                    "default": "like"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/posts": {
      "post": {
        "operationId": "publish_post",
        "summary": "Publish a post",
        "description": "Publishes a post on the user's LinkedIn profile, visible to their network. It acts for real on the user's own LinkedIn account and the other person is notified. It spends from the daily budget the autopilot uses too (see get_usage). Before calling it, show the user the exact text and get an explicit yes. Requires the write scope.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 3000
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/companies/{id}": {
      "get": {
        "operationId": "get_company",
        "summary": "Read a company page",
        "description": "A LinkedIn company page: description, industry, size, website, headquarters.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/search/filters": {
      "get": {
        "operationId": "list_search_filters",
        "summary": "Find search filter ids",
        "description": "Turns a place or an industry in words into the filter ids that search_people accepts. Always use it: search_people refuses an id that did not come from here.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "location",
                "industry"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/v1/searches": {
      "post": {
        "operationId": "search_people",
        "summary": "Search people",
        "description": "Searches LinkedIn people by keywords, job titles (as text), locations and industries (ids from find_search_filters) and connection degree. Each result costs one search result from the daily budget.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "keywords": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "titles": {
                    "type": "array",
                    "maxItems": 10,
                    "items": {
                      "type": "string",
                      "maxLength": 100
                    }
                  },
                  "locations": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "string",
                      "description": "flt_... from GET /v1/search/filters?type=location"
                    }
                  },
                  "industries": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "string",
                      "description": "flt_... from GET /v1/search/filters?type=industry"
                    }
                  },
                  "degree": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "enum": [
                        1,
                        2,
                        3
                      ]
                    }
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 25
                  },
                  "cursor": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks": {
      "get": {
        "operationId": "list_webhooks",
        "summary": "list_webhooks",
        "description": "",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "operationId": "create_webhook",
        "summary": "create_webhook",
        "description": " Requires the write scope.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "url",
                  "events"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 500
                  },
                  "events": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string",
                      "enum": [
                        "message.received",
                        "connection.accepted",
                        "invitation.sent",
                        "account.status_changed"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/{id}": {
      "delete": {
        "operationId": "delete_webhook",
        "summary": "delete_webhook",
        "description": " Requires the write scope.",
        "security": [
          {
            "bearer": []
          }
        ],
        "x-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success: {data} for one object, {data, page: {next_cursor}} for a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {},
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key lkdn_sk_..., created in the app (API e integrazioni)."
      }
    },
    "schemas": {
      "Page": {
        "type": "object",
        "properties": {
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "total_estimate": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "Problem": {
        "type": "object",
        "required": [
          "type",
          "title",
          "status",
          "code",
          "request_id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "code": {
            "type": "string",
            "enum": [
              "invalid_request",
              "invalid_cursor",
              "invalid_filter",
              "idempotency_key_required",
              "invalid_api_key",
              "insufficient_scope",
              "api_access_not_enabled",
              "subscription_inactive",
              "person_not_contactable",
              "invitation_note_not_available",
              "linkedin_feature_missing",
              "not_found",
              "route_not_found",
              "method_not_allowed",
              "linkedin_not_connected",
              "linkedin_reconnect_required",
              "linkedin_account_unavailable",
              "account_paused",
              "idempotency_in_progress",
              "already_connected",
              "already_invited",
              "idempotency_key_reused",
              "invitation_not_allowed",
              "recipient_unreachable",
              "not_first_degree",
              "inmail_not_allowed",
              "insufficient_inmail_credits",
              "comments_disabled",
              "group_conversation_not_supported",
              "action_refused",
              "invalid_webhook",
              "rate_limited",
              "daily_request_limit",
              "daily_budget_exhausted",
              "weekly_budget_exhausted",
              "action_paced",
              "outside_activity_window",
              "linkedin_rate_limited",
              "internal_error",
              "linkedin_error",
              "action_outcome_unknown",
              "api_unavailable",
              "service_not_configured",
              "linkedin_unavailable"
            ]
          },
          "request_id": {
            "type": "string"
          },
          "retry_after": {
            "type": "integer"
          }
        }
      }
    },
    "responses": {
      "Problem": {
        "description": "An RFC 9457 problem document. Codes and their statuses: invalid_request (400), invalid_cursor (400), invalid_filter (400), idempotency_key_required (400), invalid_api_key (401), insufficient_scope (403), api_access_not_enabled (403), subscription_inactive (403), person_not_contactable (403), invitation_note_not_available (403), linkedin_feature_missing (403), not_found (404), route_not_found (404), method_not_allowed (405), linkedin_not_connected (409), linkedin_reconnect_required (409), linkedin_account_unavailable (409), account_paused (409), idempotency_in_progress (409), already_connected (409), already_invited (409), idempotency_key_reused (422), invitation_not_allowed (422), recipient_unreachable (422), not_first_degree (422), inmail_not_allowed (422), insufficient_inmail_credits (422), comments_disabled (422), group_conversation_not_supported (422), action_refused (422), invalid_webhook (422), rate_limited (429), daily_request_limit (429), daily_budget_exhausted (429), weekly_budget_exhausted (429), action_paced (429), outside_activity_window (429), linkedin_rate_limited (429), internal_error (500), linkedin_error (502), action_outcome_unknown (502), api_unavailable (503), service_not_configured (503), linkedin_unavailable (503).",
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer"
            },
            "description": "On a 429 and some 503: seconds before retrying."
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      }
    }
  }
}
