# CopyCredential Method

## Description

Copies a cloud-provider credential, within a project, or from one project to another.

## HTTP Request

`POST https://api.skeddly.com/api/Credentials/Copy`

## Body

The body is a JSON structure with the following properties.

### credentialId

Credential ID of the source credential to be copied. This credential can be in the same project or different project from `projectid`.

Type: `string`

Required: Yes

### nameOverride

Name of the new credential. The name of the source credential will be used if omitted.

Type: `string`

Required: No

### projectId

Project ID of the project into which the new copy will be contained.

Type: `string`

Required: Yes

## Returns

A [Credential](/data-types/credential-object.md) object.

## &#x20;Sample Request

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

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

{
    "projectId": "proj-12345678",
    "credentialId": "cred-12345678",
    "nameOverride": "Copy of My Credential"
}
```

{% endtab %}

{% tab title="Bash" %}

```bash
curl -X POST "https://api.skeddly.com/api/Credentials/Copy" \
  -H "Authorization: AccessKey <api key>" \
89012:role/Skeddly" \
  -d projectId=proj-12345678 \
  -d credentialId=cred-12345678 \
  -d name="Copy of 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": "Copy of My Credential",
    "projectId": "proj-12345678",
    "status": "active"
}
```


---

# Agent Instructions: 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:

```
GET https://docs.skeddly.com/resources/credentials/createcredential-method-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
