> ## Documentation Index
> Fetch the complete documentation index at: https://aisa.one/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# 托管授权链接

> 创建托管授权链接，用于接入 LinkedIn 账号。

返回一个 HostedAuthUrl，把终端用户引导到 Unipile 托管页完成 LinkedIn 登录，凭证不会经过你的系统。**托管模式（推荐）：不传 `notify_url`**，AISA 全程代管——轮询 `GET /apis/v1/unipile/me/accounts` 直到账号出现（用户完成登录后通常几秒内），无需自建任何 webhook。**自管模式：传入你自己的 `notify_url`**，流程完成后 Unipile 会向它 POST 事件 `{"status":"CREATION_SUCCESS","account_id":"…","name":"…"}`——请保存 account\_id，它是其余所有端点的必需标识（自管模式下没有账号列表端点可重新查询，托管模式用户直接读 `me/accounts`）。你设置的 `name` 会原样回传，用它把账号映射到你自己的用户。请在 30 秒内返回 200，否则事件会重试 5 次；建议在回调端点校验共享密钥头。链接会在 Unipile 每日重启时失效（无论 `expiresOn` 设成什么），每次用户要连接时都新生成一条。注意：同一 LinkedIn 账号重新授权会生成新的 account\_id，旧绑定在断开前会一直保留在列表中。

参考价格：每次成功请求 \$0.000001 USD。


## OpenAPI

````yaml openapi/zh/unipile.json POST /apis/v1/unipile/hosted/link
openapi: 3.1.0
info:
  title: Unipile LinkedIn API
  version: 1.0.0
  description: >-
    LinkedIn data and messaging through your connected accounts: profiles,
    companies, chats, posts, network, structured search, and Recruiter job-slot
    credits. Bring your own LinkedIn account (connect once through the hosted
    authorization link), then read and act through one AIsa credential.
servers:
  - url: https://api.aisa.one
security:
  - bearerAuth: []
tags:
  - name: Accounts
    description: Connected-account discovery and binding liveness.
  - name: Profiles
    description: Member and company profiles.
  - name: Messaging
    description: Conversations, messages, and attachments.
  - name: Posts
    description: Member posts and their comments.
  - name: Network
    description: Connections and invitations.
  - name: Search
    description: Structured LinkedIn search and its parameter helper.
  - name: Recruiter
    description: Recruiter contract quota endpoints.
paths:
  /apis/v1/unipile/hosted/link:
    post:
      tags:
        - Accounts
      summary: Hosted Auth Link
      description: >-
        Returns a HostedAuthUrl that you send the end user to. They complete the
        LinkedIn sign-in on Unipile's hosted page, so no credentials ever touch
        your system. **Managed mode (recommended): omit `notify_url`** and AISA
        handles everything — poll `GET /apis/v1/unipile/me/accounts` until the
        account appears (usually within seconds of the user finishing the
        wizard); no webhook infrastructure needed on your side. **Self-hosted
        mode: pass your own `notify_url`** and Unipile POSTs
        `{"status":"CREATION_SUCCESS","account_id":"…","name":"…"}` to it when
        the flow completes — store that account_id, it is the identifier every
        other endpoint requires, and with your own webhook there is no listing
        endpoint to re-discover it (managed-mode users read `me/accounts`
        instead). The `name` you set here is echoed back in self-hosted mode, so
        use it to map the account to your own user. Reply 200 within 30 seconds
        or the event is retried five times; consider verifying a shared-secret
        header on your endpoint. Links expire on Unipile's daily restart
        regardless of `expiresOn`, so generate a fresh link each time a user
        wants to connect. Note: re-authorizing the same LinkedIn account creates
        a new account_id; earlier bindings remain listed until disconnected.
        $0.000001 per request.
      operationId: post_unipile_apis_v1_unipile_hosted_link
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - type
                - providers
                - api_url
                - expiresOn
              properties:
                type:
                  type: string
                  description: >-
                    `create` connects a new account, `reconnect`
                    re-authenticates an existing one.
                  enum:
                    - create
                    - reconnect
                providers:
                  type: array
                  description: >-
                    Provider list, for example `["LINKEDIN"]`. Only used with
                    `type=create`.
                  items:
                    type: string
                api_url:
                  type: string
                  description: >-
                    The Unipile server URL of this AIsa binding, for example
                    `https://api68.unipile.com:19823`. Use the value documented
                    here; a generic Unipile URL will not match the binding.
                expiresOn:
                  type: string
                  description: >-
                    ISO 8601 UTC expiry, for example `2026-12-31T23:59:59.999Z`.
                    Required by upstream, even though links also die on
                    Unipile's daily restart.
                name:
                  type: string
                  description: >-
                    Label echoed back in events so you can match the account to
                    your own user.
                notify_url:
                  type: string
                  description: Callback notified once the connection completes.
                success_redirect_url:
                  type: string
                  description: Browser redirect after a successful connection.
                failure_redirect_url:
                  type: string
                  description: Browser redirect after a failed connection.
                reconnect_account:
                  type: string
                  description: >-
                    Account id to re-authenticate. Required when `type` is
                    `reconnect`.
                bypass_success_screen:
                  type: boolean
                  description: >-
                    Skip Unipile's hosted success screen before the browser
                    follows `success_redirect_url`.
                disabled_features:
                  type: array
                  description: >-
                    Provider features to disable on the connected account:
                    `linkedin_recruiter`, `linkedin_sales_navigator`, or
                    `linkedin_organizations_mailboxes`.
                  items:
                    type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    enum:
                      - HostedAuthUrl
                  url:
                    type: string
                    description: Hosted authorization URL to send the user to.
        '401':
          description: Missing or invalid API key.
        '402':
          description: Insufficient balance.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.