# ignoreInvitation

Ignore an incoming connection, company-follow, or newsletter-subscription invitation.

This method ignores an incoming invitation by type and target URL.

```typescript
try {
  const workflow = await linkedapi.ignoreInvitation.execute({
    invitationType: "newsletterSubscribe",
    newsletterUrl: "https://www.linkedin.com/newsletters/example-1234567890",
  });

  const { errors } = await linkedapi.ignoreInvitation.result(
    workflow.workflowId,
  );

  // The list of possible execution errors is below
  if (errors && errors.length > 0) {
    console.warn("Workflow completed with execution errors:");
    for (const error of errors) {
      console.warn(` - Type: ${error.type}, Message: ${error.message}`);
    }
  } else {
    console.log("Invitation ignored successfully.");
  }
} catch (e) {
  // A list of all critical errors can be found here:
  // https://linkedapi.io/sdks/handling-results-and-errors/#handling-critical-errors
  if (e instanceof LinkedApiError) {
    console.error(`Critical Error - Type: ${e.type}, Message: ${e.message}`);
  } else {
    console.error("An unexpected, non-API error occurred:", e);
  }
}
```

```python
from linkedapi import IgnoreInvitationParams, LinkedApiError

try:
    workflow = linkedapi.ignore_invitation.execute(
        IgnoreInvitationParams(
            invitation_type="newsletterSubscribe",
            newsletter_url="https://www.linkedin.com/newsletters/example-1234567890",
        )
    )

    result = linkedapi.ignore_invitation.result(workflow.workflow_id)
    errors = result.errors

    # The list of possible execution errors is below
    if errors:
        print("Workflow completed with execution errors:")
        for error in errors:
            print(f" - Type: {error.type}, Message: {error.message}")
    else:
        print("Invitation ignored successfully.")
except LinkedApiError as e:
    # A list of all critical errors can be found here:
    # https://linkedapi.io/sdks/handling-results-and-errors/#handling-critical-errors
    print(f"Critical Error - Type: {e.type}, Message: {e.message}")
except Exception as error:
    print("An unexpected, non-API error occurred:", error)
```

## Params

- `invitationType` – required invitation type: `connect`, `companyFollow`, or `newsletterSubscribe`.
- `personUrl` – required only for `connect`.
- `companyUrl` – required only for `companyFollow`.
- `newsletterUrl` – required only for `newsletterSubscribe`.

Provide exactly one URL matching `invitationType`.

## Data

The method doesn't return any data.

## Errors

- `noPendingRequest` – there is no matching pending invitation for the supplied type and URL.
