# List credentials

> **GET** `https://api.us.nylas.com/v3/connectors/{provider}/creds`

Source: https://developer.nylas.com/docs/reference/api/connector-credentials/get_credential_all/

List credentials for the specified provider.

**Authentication:** NYLAS_API_KEY

## Parameters

### Query parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | No | Limit the number of credentials Nylas returns. |
| `offset` | integer | No | Offset the results. |
| `sort_by` | string | No | Sort the returned credentials using the contents of the specified field. |
| `order_by` | string | No | Specify the sort order of returned credentials. |

### Path parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `provider` | string | Yes |  |

## Responses

### 200 - Returns an array of Credential objects.

- `request_id` (string) - The request ID.
- `data` (array)
  - `id` (string) **(required)** - Credential ID
  - `name` (string) **(required)** - Unique name of this credential
  - `created_at` (integer) **(required)** - Date of creation of the credential
  - `updated_at` (integer) **(required)** - Initially same as `created_at`. Can differ if the credential has been updated.
- `limit` (integer)
- `offset` (integer)

### 401 - Not Authenticated

- `request_id` (string) **(required)** - ID of the request
- `error` (object) **(required)** - Error object
  - `type` (string) - Type of error
  - `message` (string) - Informative error message
  - `provider_error` (object) - (OPTIONAL) informative error message from provider's side

### 404 - Not Found

- `request_id` (string) **(required)** - ID of the request
- `error` (object) **(required)** - Error object
  - `type` (string) - Type of error
  - `message` (string) - Informative error message
  - `provider_error` (object) - (OPTIONAL) informative error message from provider's side

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://api.us.nylas.com/v3/connectors/<CONNECTOR>/creds' \  
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <NYLAS_API_KEY>' \
```

### Node.js SDK

```javascript
import Nylas from "nylas";

const nylas = new Nylas({
  apiKey: "<NYLAS_API_KEY>",
  apiUri: "<NYLAS_API_URI>",
});

const credentials = await nylas.connectors.credentials.list({
  provider: "google",
});

console.log("Credentials:", credentials);

```

### Python SDK

```python
from nylas import Client

nylas = Client(
    "<NYLAS_API_KEY>",
    "<NYLAS_API_URI>",
)

credentials = nylas.connectors.credentials.list(
    provider="google",
    query_params={
        "limit": 50,
    },
)

print("Credentials:", credentials)

```

### Java SDK

```java
import com.nylas.NylasClient;
import com.nylas.models.AuthProvider;
import com.nylas.models.Credential;
import com.nylas.models.ListResponse;
import com.nylas.models.NylasApiError;
import com.nylas.models.NylasSdkTimeoutError;

public class ListCredentials {
  public static void main(String[] args) throws NylasSdkTimeoutError, NylasApiError {
    NylasClient nylas = new NylasClient.Builder("<NYLAS_API_KEY>").build();

    ListResponse<Credential> credentials = nylas.connectors().credentials().list(AuthProvider.GOOGLE);

    System.out.println("Credentials: " + credentials.getData());
  }
}

```

### Kotlin SDK

```kotlin
import com.nylas.NylasClient
import com.nylas.models.AuthProvider

fun main() {
  val nylas = NylasClient.Builder("<NYLAS_API_KEY>").build()

  val credentials = nylas.connectors().credentials().list(AuthProvider.GOOGLE)

  println("Credentials: ${credentials.data}")
}

```
