# ModifyCredential Method

## Description

Updates an existing cloud-provider credential.

## HTTP Request

`PUT https://api.skeddly.com/api/Credentials/<id>`

## URL Parameters

### Id

ID of the credential.

Type: `string`

Required: Yes

## Body

The body is a JSON structure with the following properties. All body parameters are optional. Only properties being modified are required.

### amazonIamAccessKey

Parameters for the IAM access key credential. Required when `credentialType` is `amazon-access-key`.

Type: [AmazonIamAccessKeyParameters](https://docs.skeddly.com/data-types/amazoniamaccesskeyparameters-object) object.

Required: Conditional

### amazonIamRole

Parameters for the IAM role credential. Required when `credentialType` is `amazon-iam-role`.

Type: [AmazonIamRoleParameters](https://docs.skeddly.com/data-types/amazoniamroleparameters-object) object.

Required: Conditional

### cloudProviderSubTypeId

Cloud-provider sub-type ID.

Type: `string`

Valid Values:

* `amazon-standard`
* `amazon-govcloud-us`
* `amazon-china`
* `google-standard`

Required: Yes

### googleServiceAccountKey

Parameters for the Google Cloud Provider service account key credential. Required when `credentialType` is `google-service-account-key`.

Type: [GoogleServiceAccountKeyParameters](https://docs.skeddly.com/data-types/googleserviceaccountkeyparameters-object) object.

Required: Conditional

### name

Updated friendly name for the credential.

Type: `string`

Required: No

## Returns

A [Credential](https://docs.skeddly.com/data-types/credential-object) object.

## Sample Request

{% tabs %}
{% tab title="HTTP" %}

```http
PUT /api/Credentials/cred-00000001 HTTP/1.1
Host: api.skeddly.com
Authorization: AccessKey <api key>
Content-Type: application/json

{
    "amazonIamRole": {
        "externalId": "skeddly-12345678",
        "roleArn": "arn:aws:iam::123456789012:role/Skeddly"
    },
    "cloudProviderSubTypeId": "amazon-standard",
    "name": "My Credential"
}
```

{% endtab %}

{% tab title="Bash" %}

```bash
curl -X PUT "https://api.skeddly.com/api/Credentials/cred-00000001" \
  -H "Authorization: AccessKey <api key>" \
  -d amazonIamRole.externalId=skeddly-12345678 \
  -d amazonIamRole.roleArn="arn:aws:iam::123456789012:role/Skeddly" \
  -d cloudProviderSubTypeId=amazon-standard \
  -d name="My Credential"
```

{% endtab %}
{% endtabs %}

## Sample Response

```javascript
{
    "amazonIamRole": {
        "roleArn": "arn:aws:iam::123456789012:role/Skeddly",
        "externalId": "skeddly-12345678",
    },
    "cloudProviderSubTypeId": "amazon-standard",
    "createdDate": "2016-06-08T14:42:00Z",
    "credentialId": "cred-00000001",
    "credentialType": "amazon-iam-role",
    "isUsedForSnsNotifications": false,
    "lastModifiedDate": "2016-06-08T14:42:00Z",
    "lastModifiedBy": "u-00000001",
    "name": "My Credential",
    "status": "active"
}
```
