> For the complete documentation index, see [llms.txt](https://docs.skeddly.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.skeddly.com/resources/credentials/modifycredential-method.md).

# 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](/data-types/amazoniamaccesskeyparameters-object.md) object.

Required: Conditional

### amazonIamRole

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

Type: [AmazonIamRoleParameters](/data-types/amazoniamroleparameters-object.md) 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](/data-types/googleserviceaccountkeyparameters-object.md) object.

Required: Conditional

### name

Updated friendly name for the credential.

Type: `string`

Required: No

## Returns

A [Credential](/data-types/credential-object.md) 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"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.skeddly.com/resources/credentials/modifycredential-method.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
