> ## 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

# Hosted Auth Link

> Create a hosted authorization link for connecting a LinkedIn account.

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.

Reference price: \$0.000001 USD per successful request.

## Example

```bash REST theme={null}
curl -X POST "https://api.aisa.one/apis/v1/unipile/hosted/link" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type": "create", "providers": ["LINKEDIN"], "api_url": "https://api68.unipile.com:19823", "expiresOn": "2026-12-31T23:59:59.999Z", "name": "your-internal-user-id", "notify_url": "https://example.com/hooks/unipile", "success_redirect_url": "https://example.com/connected", "failure_redirect_url": "https://example.com/failed"}'
```

Path parameters and required query parameters are documented in the operation reference.


## OpenAPI

````yaml openapi/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.