Source: https://leadping.ai/docs/api-reference/invitations/get

# Get

## Endpoint

```http
GET https://api.leadping.ai/invitations
```

## Authorizations

### Authorization

`string` · `header` · **required**

Authorization header using the Bearer scheme. Accepted values are Leadping user JWT access tokens and WorkOS organization API keys beginning with `sk_`.

## Query Parameters

### token

`string`

## Request Examples

### cURL

```bash
curl --request GET \
  --url https://api.leadping.ai/invitations \
  --header 'Authorization: Bearer <token>'
```

### Python

```python
import requests

url = "https://api.leadping.ai/invitations"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://api.leadping.ai/invitations");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.GetAsync(request);

Console.WriteLine("{0}", response.Content);
```

### Java

```java
HttpResponse<String> response = Unirest.get("https://api.leadping.ai/invitations")
  .header("Authorization", "Bearer <token>")
  .asString();
```

### JavaScript

```javascript
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.leadping.ai/invitations', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Go

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.leadping.ai/invitations"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### PHP

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.leadping.ai/invitations",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

## Responses

### 200 — OK

The response is an array of organization invitations.

Available content types:

- `text/plain`
- `application/json`
- `text/json`

```json
[
  {
    "id": "<string>",
    "organization": {
      "id": "<string>",
      "name": "<string>"
    },
    "email": "jsmith@example.com",
    "role": "Account Admin",
    "status": "Declined",
    "createdAt": "2023-11-07T05:31:56Z",
    "expiresAt": "2023-11-07T05:31:56Z",
    "sentAt": "2023-11-07T05:31:56Z",
    "resentAt": "2023-11-07T05:31:56Z",
    "acceptedAt": "2023-11-07T05:31:56Z",
    "revokedAt": "2023-11-07T05:31:56Z",
    "sendFailureReason": "<string>",
    "licenseBillingStatus": "<string>",
    "licenseQuantity": 123,
    "licenseRenewalDate": "2023-11-07T05:31:56Z",
    "licenseActivatedAt": "2023-11-07T05:31:56Z",
    "licenseReleasedAt": "2023-11-07T05:31:56Z"
  }
]
```

#### Response fields

##### id

`string`

Unique Leadping identifier for this organization invitation.

##### organization

`object`

Provides a compact API reference to another resource using its stable identifier and human-readable display name.

###### organization.id

`string` · **required**

Stable unique identifier of the referenced resource.

###### organization.name

`string` · **required**

Human-readable display name of the referenced resource.

##### email

`string<email>`

The email address associated with this organization invitation.

##### role

`enum<string>`

Identifies an organization member's access level and permission scope within Leadping.

Available options:

- `Account Admin`
- `Owner`
- `Admin`
- `Agent`

##### status

`enum<string>`

Describes the lifecycle of an organization membership invitation from issuance through acceptance, expiration, or revocation.

Available options:

- `Declined`
- `Awaiting confirmation`
- `Pending`
- `Accepted`
- `Expired`
- `Revoked`
- `Resent`
- `Failed to send`

##### createdAt

`string<date-time>`

UTC timestamp for created at on this organization invitation.

##### expiresAt

`string<date-time>`

UTC timestamp for expires at on this organization invitation.

##### sentAt

`null | string<date-time>`

UTC timestamp for sent at on this organization invitation.

##### resentAt

`null | string<date-time>`

UTC timestamp for resent at on this organization invitation.

##### acceptedAt

`null | string<date-time>`

UTC timestamp for accepted at on this organization invitation.

##### revokedAt

`null | string<date-time>`

UTC timestamp for revoked at on this organization invitation.

##### sendFailureReason

`null | string`

The human-readable send failure reason explaining this organization invitation.

##### licenseBillingStatus

`null | string`

The billing status for the paid license created by this invitation.

##### licenseQuantity

`null | integer<int64>`

The quantity on the shared organization user license subscription item after this change.

##### licenseRenewalDate

`null | string<date-time>`

The renewal date used for proration of this license.

##### licenseActivatedAt

`null | string<date-time>`

The date and time this invitation's paid license was created.

##### licenseReleasedAt

`null | string<date-time>`

The date and time this invitation's paid license was released.

### 401 — Unauthorized

Authentication credentials are missing or invalid.

```json
{
  "type": "about:blank",
  "title": "Unauthorized",
  "status": 401,
  "detail": "The request could not be completed."
}
```

### 403 — Forbidden

The authenticated user or organization does not have permission to perform this operation.

```json
{
  "type": "about:blank",
  "title": "Forbidden",
  "status": 403,
  "detail": "The request could not be completed."
}
```

### 429 — Too Many Requests

The API rate limit for this account or client has been exceeded.

The response includes a `Retry-After` header containing the number of seconds to wait before retrying the request.

```json
{
  "type": "about:blank",
  "title": "Too Many Requests",
  "status": 429,
  "detail": "The request could not be completed."
}
```
