# retrievePendingRequests

This method allows you to retrieve pending connection requests sent from your account.

```typescript
try {
  const workflow = await linkedapi.retrievePendingRequests.execute();

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

  // The list of possible execution errors is below
  if (errors && errors.length > 0) {
    console.warn('Workflow completed with execution errors:');
    errors.forEach(error => {
      console.warn(` - Type: ${error.type}, Message: ${error.message}`);
    });
  }

  // The structure of the 'data' object is below
  if (data) {
    console.log('Pending requests count:', data.requests.length);
    data.forEach(request => {
      console.log(`Request to: ${request.name} (${request.personUrl})`);
      console.log(`Sent: ${request.sentTime}`);
    });
  }
} 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 LinkedApiError

try:
    workflow = linkedapi.retrieve_pending_requests.execute()

    result = linkedapi.retrieve_pending_requests.result(workflow.workflow_id)
    data = result.data
    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}")

    # The structure of the 'data' object is below
    if data:
        print("Pending requests count:", len(data))
        for request in data:
            print(f"Request to: {request.name} ({request.public_url})")
            print(f"Sent: {request.sent_time}")
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

The method doesn't require any parameters.

## Data

Array of pending requests. Each pending request contains:

- `name` – full name of the person.
- `publicUrl` –  [public](/faq/what-are-hashed-url-and-public-url) LinkedIn URL of the person.
- `headline` – headline of the person.
- `sentTime` – time since the connection request was sent (e.g., "1 month ago").

## Errors

The method has no execution errors (`errors` is always `[]`).
