# Get credential

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

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

Return a credential with the specified ID.

**Authentication:** NYLAS_API_KEY

## Parameters

### Path parameters

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

## Responses

### 200 - Returns the credential with the specified ID.

- `request_id` (string) - The request ID.
- `data` (object)
  - `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.

### 400 - Bad Request

- `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

### 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

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://api.us.nylas.com/v3/connectors/<CONNECTOR>/creds/<CREDENTIAL_ID>' \
  --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 credential = await nylas.connectors.credentials.find({
  provider: "google",
  credentialsId: "<CREDENTIAL_ID>",
});

console.log("Credential:", credential);

```

### Python SDK

```python
from nylas import Client

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

credential = nylas.connectors.credentials.find(
    provider="google",
    credential_id="<CREDENTIAL_ID>",
)

print("Credential:", credential)

```

### Java SDK

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

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

    Response<Credential> credential = nylas.connectors().credentials()
        .find(AuthProvider.GOOGLE, "<CREDENTIAL_ID>");

    System.out.println("Credential: " + credential.getData());
  }
}

```

### Kotlin SDK

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

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

  val credential = nylas.connectors().credentials().find(AuthProvider.GOOGLE, "<CREDENTIAL_ID>")

  println("Credential: ${credential.data}")
}

```
