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

# Unipile: Handle Received Invitation

> Accepts or declines a connection invitation the customer’s account received. Includes SDK V2 examples, input constraints, response fields, and Deepline cost.

Accepts or declines a connection invitation the customer’s account received.

> [!NOTE]
>
> Tool ID: `unipile_handle_received_invitation`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'unipile_handle_received_invitation',
  {
    "invitation_id": "invitation_123",
    "provider": "LINKEDIN",
    "shared_secret": "example",
    "account_id": "123456789",
    "action": "accept"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute unipile_handle_received_invitation --input '{
  "invitation_id": "invitation_123",
  "provider": "LINKEDIN",
  "shared_secret": "example",
  "account_id": "123456789",
  "action": "accept"
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "object": "UserInvitationHandled",
    "status": "ACCEPTED"
  }
}
```

Use `deepline describe unipile_handle_received_invitation --json` for the latest machine-readable contract.

## Input reference

Accept or decline a connection invitation.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.invitation_id` | `string` | Yes | — | The invitation ID. |
| `payload.provider` | `"LINKEDIN" \| "INSTAGRAM"` | Yes | — | Allowed: `LINKEDIN`, `INSTAGRAM`. |
| `payload.shared_secret` | `string` | No | — | This token provided by Linkedin is mandatory to handle received invitations. It can be retrieved along with each invitation using the List all invitations received route. Minimum length: 1. |
| `payload.account_id` | `string` | Yes | — | A unique identifier. Minimum length: 1. |
| `payload.action` | `"accept" \| "decline"` | Yes | — | Allowed: `accept`, `decline`. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Accept or decline a connection invitation.",
    "properties": {
      "invitation_id": {
        "type": "string",
        "description": "The invitation ID."
      },
      "provider": {
        "type": "string",
        "enum": [
          "LINKEDIN",
          "INSTAGRAM"
        ]
      },
      "shared_secret": {
        "type": "string",
        "description": "This token provided by Linkedin is mandatory to handle received invitations. It can be retrieved along with each invitation using the List all invitations received route.",
        "minLength": 1
      },
      "account_id": {
        "type": "string",
        "description": "A unique identifier.",
        "minLength": 1
      },
      "action": {
        "type": "string",
        "enum": [
          "accept",
          "decline"
        ]
      }
    },
    "required": [
      "invitation_id",
      "provider",
      "account_id",
      "action"
    ],
    "anyOf": [
      {
        "type": "object",
        "properties": {
          "invitation_id": {
            "type": "string",
            "description": "The invitation ID."
          },
          "provider": {
            "type": "string",
            "enum": [
              "LINKEDIN"
            ]
          },
          "shared_secret": {
            "type": "string",
            "description": "This token provided by Linkedin is mandatory to handle received invitations. It can be retrieved along with each invitation using the List all invitations received route.",
            "minLength": 1
          },
          "account_id": {
            "type": "string",
            "description": "A unique identifier.",
            "minLength": 1
          },
          "action": {
            "type": "string",
            "enum": [
              "accept",
              "decline"
            ]
          }
        },
        "required": [
          "invitation_id",
          "provider",
          "shared_secret",
          "account_id",
          "action"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "properties": {
          "invitation_id": {
            "type": "string",
            "description": "The invitation ID."
          },
          "provider": {
            "type": "string",
            "enum": [
              "INSTAGRAM"
            ]
          },
          "account_id": {
            "type": "string",
            "description": "A unique identifier.",
            "minLength": 1
          },
          "action": {
            "type": "string",
            "enum": [
              "accept",
              "decline"
            ]
          }
        },
        "required": [
          "invitation_id",
          "provider",
          "account_id",
          "action"
        ],
        "additionalProperties": false
      }
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Provider response payload. |
| `result.data.object` | `"UserInvitationHandled"` | Yes | — | Allowed: `UserInvitationHandled`. |
| `result.data.status` | `"ACCEPTED" \| "DECLINED"` | Yes | — | — |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "UserInvitationHandled"
            ]
          },
          "status": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "ACCEPTED"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "DECLINED"
                ]
              }
            ]
          }
        },
        "required": [
          "object",
          "status"
        ],
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Unipile provider guide](https://deepline.com/docs/providers/unipile/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


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