---
title: "API: createCredential"
slug: "api-createcredential"
updated: 2025-01-07T16:13:21Z
published: 2025-01-07T16:13:21Z
canonical: "support.smarteru.com/api-createcredential"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.smarteru.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API: createCredential

- Starting June 1, 2022, SmarterU will require all API calls to POST to HTTPS. Any POST to HTTP will result in the SU:01 error (i.e., No POST data detected.).
- If you are viewing the help in a language other than English, please change your language to English before copying and pasting any code. All API attributes and functions are in English.
- Tags are required unless specified.

## Description

The createCredential method adds a [global action](/v1/docs/actions).

[Actions](/v1/docs/actions) were previously referred to as *credentials*.

## Who Has Access

The following users have access to the createCredential method:

- Users with the [Manage Learning Plans, Certifications, and Requirements](/v1/docs/account-permission-manage-learning-plans-certifications-and-requirements) account permission.
- [Administrators and owners](/v1/docs/user-profile-information#access-level).

## API Call XML Package

```plaintext
<SmarterU>
   <AccountAPI><![CDATA[]]></AccountAPI>
   <UserAPI><![CDATA[]]></UserAPI>
   <Method>createCredential</Method>
   <Parameters>
      <Credential>
         <Name></Name>
         <Status></Status>
         <Description></Description>
         <AllowsAttachments></AllowsAttachments>
         <Expires></Expires>
         <DaysGood></DaysGood>
         <ExpirationDate></ExpirationDate>
         <RecallDays></RecallDays>
         <VisibleToLearners></VisibleToLearners>

         <AddedPrerequisites>
            <LearningModules></LearningModules>
            <Credentials></Credentials>
         </AddedPrerequisites>

         <RequiresConfirmation></RequiresConfirmation>
         <ConfirmationAttachments></ConfirmationAttachments>
         <ConfirmationNotification></ConfirmationNotification>

         <Permissions>
            <Types>
               <Type></Type>
            </Types>
         </Permissions>

         <Tags2>
            <Tag2>
               <TagID><![CDATA[]]></TagID>
                  - OR -
               <TagName><![CDATA[]]></TagName>
               <TagValues><![CDATA[]]></TagValues>
            </Tag2>
         </Tags2>

         <TrainingCost>
            <Trainer>
               <TrainerID></TrainerID>
                  - OR -
               <TrainerEmail><![CDATA[]]></TrainerEmail>
                  - OR -
               <TrainerEmployeeID><![CDATA[]]></TrainerEmployeeID>
            </Trainer>
            <LearnerHours></LearnerHours>
            <TrainerHours></TrainerHours>
            <ExtraCostAmount></ExtraCostAmount>
            <ExtraCostDescription><![CDATA[]]></ExtraCostDescription>
         </TrainingCost>

      </Credential>
   </Parameters>
</SmarterU>
```

## Credential Tag Group

The Credential tag group is a container for the action's details.

```plaintext
<Credential>
   <Name></Name>
   <Status></Status>
   <Description></Description>
   <AllowsAttachments></AllowsAttachments>
   <Expires></Expires>
   <DaysGood></DaysGood>
   <ExpirationDate></ExpirationDate>
   <RecallDays></RecallDays>
   <VisibleToLearners></VisibleToLearners>

   <AddedPrerequisites>
      <LearningModules></LearningModules>
      <Credentials></Credentials>
   </AddedPrerequisites>

   <RequiresConfirmation></RequiresConfirmation>
   <ConfirmationAttachments></ConfirmationAttachments>
   <ConfirmationNotification></ConfirmationNotification>

   <Permissions>
      <Types>
         <Type></Type>
      </Types>
   </Permissions>

   <Tags2>
      <Tag2>
         <TagID><![CDATA[]]></TagID>
            - OR -
         <TagName><![CDATA[]]></TagName>
         <TagValues><![CDATA[]]></TagValues>
      </Tag2>
   </Tags2>

   <TrainingCost>
      <Trainer>
         <TrainerID></TrainerID>
            - OR -
         <TrainerEmail><![CDATA[]]></TrainerEmail>
            - OR -
         <TrainerEmployeeID><![CDATA[]]></TrainerEmployeeID>
      </Trainer>
      <LearnerHours></LearnerHours>
      <TrainerHours></TrainerHours>
      <ExtraCostAmount></ExtraCostAmount>
      <ExtraCostDescription><![CDATA[]]></ExtraCostDescription>
   </TrainingCost>

</Credential>
```

The Credential tag may contain the following.

### **Name**

The [action's name](/v1/docs/action-main#name).

### **Status**

The [action's status](/v1/docs/action-main#status). Acceptable values are *Active* and *Inactive*.

### **Description**

The [description of the action](/v1/docs/action-main#description).

### **AllowsAttachments** (optional)

This is only used when the [VisibleToLearners tag](/v1/docs/api-createcredential#visibletolearners-optional) is set to *1*.

Indicates whether learners must upload an attachment with the action in order for it to be accepted. Acceptable values are:

- *Yes* - Learners may upload a file with the action.
- *No* - Learner do not have to upload a file in order for the action to be confirmed.
- *Required* - Learners must upload a file with the action in order for the action to be confirmed.

### **Expires** (optional)

Indicates whether the [action expires](https://support.smarteru.com/v1/docs/action-expiration#expires). Acceptable values are:

- *0*  - The action doesn't expire.
- *1* - The action expires.

### **DaysGood** (optional)

This tag is only used when the [Expires tag](/v1/docs/api-createcredential#expires-optional) is set to *1* and you want the action to expire after the specified number of days. The [number of days the action is valid](/v1/docs/action-expiration#this-action-is-valid-for).

### **ExpirationDate** (optional)

This tag is only used when the [Expires tag](/v1/docs/api-createcredential#expires-optional) is set to *1* and you want the action to expire on a specific date. The [date the action will expire](https://support.smarteru.com/docs/action-expiration#this-action-is-valid-until) in D-MMM format.

### **RecallDays** (optional)

This tag is only used when the [Expires tag](/v1/docs/api-createcredential#expires-optional) is set to *1*. The [number of days prior to the action's expiration when the status will change to *Warning*](/v1/docs/action-expiration#warning-period-should-start).

### **VisibleToLearners** (optional)

Indicates whether the [action is visible to learners](https://help.smarteru.com/action-main-settings$setting_visible_to_learners). Acceptable values are:

- *0*  - The action isn't visible to learners.
- *1* - The action is visible to learners.

### **AddedPrerequisites**

A container for the [action's prerequisites](/v1/docs/action-prerequisites). The tag may contain the following.

| **Tag** | **Description** |
| --- | --- |
| **LearningModules** | The prerequisite course's system-generated identifier. To specify multiple courses, separate each with a comma. |
| **Credentials** | The prerequisite action's system-generated identifier. To specify multiple actions, separate each with a comma. |

### **RequiresConfirmation** (optional)

Indicates [whether a user other than the learner must confirm the action](https://support.smarteru.com/v1/docs/action-confirmation#requires-confirmation) before its status can be set to Accepted. Acceptable values are:

- *0* - The action doesn't require confirmation.
- *1* - The action requires confirmation.

### **ConfirmationAttachments**

This tag is only used when the [RequiresConfirmation tag](/v1/docs/api-createcredential#requiresconfirmation-optional) is set to *1*.

Indicates whether the user confirming the action must [upload an attachment with the action in order for it to be confirmed](/v1/docs/action-confirmation#allow-confirmation-attachments). Acceptable values are:

- *Yes* - The user confirming the action may upload a file with the action.
- *No* - The user confirming the action does not have to upload a file in order for the action to be confirmed.
- *Required* - The user confirming the action must upload a file with the action in order for the action to be confirmed.

### **ConfirmationNotification**

This tag is only used when the [RequiresConfirmation tag](/v1/docs/api-createcredential#requiresconfirmation-optional) is set to *1*.

Indicates whether the Action Confirmation Notification email will be sent to the selected users. Acceptable values are:

- *0*  - The email isn't sent.
- *1*  - The email is sent.

### **Permissions**

The Permissions tag is a container for the [user types who are able to confirm the action](https://support.smarteru.com/v1/docs/action-confirmation#requires-confirmation-by). Each user type is contained in a Types tag and may contain the following.

| Tag | Description |
| --- | --- |
| **Type** | The type of user who is able to confirm the action. Acceptable values are: - *GM* - Users with the Group Manager group permission. - *SUP* - The learner's supervisor(s). - *MGU* - Users with the Manage Group Users group permission. |

### Tags2 (optional)

A container for the action's tags. Refer to [Tags2 Tag Group](/v1/docs/api-createcredential#tags2-tag-group).

### TrainingCost (optional)

A container for the action's training cost. Refer to [TrainingCost Tag Group](/v1/docs/api-createcredential#trainingcost-tag-group).

## Tags2 Tag Group

The Tags2 tag group is a container for the [action's tags](/v1/docs/action-tags).

```plaintext
<Tags2>
   <Tag2>
      <TagID><![CDATA[]]></TagID>
         - OR -
      <TagName><![CDATA[]]></TagName>
      <TagValues><![CDATA[]]></TagValues>
   </Tag2>
</Tags2>
```

Each tag is contained in a Tag2 tag and may contain the following.

### TagID

To obtain a tag's ID:

1. Navigate to the [Tag Management Dashboard](https://support.smarteru.com/docs/tag-management-dashboard).
2. Right click on a tag.
3. Click **Inspect** (or Inspect Element, in some browsers). This displays the Developer Tools in your browser. The tag's ID will be located within the code.

![](https://cdn.document360.io/7efaadab-fef6-4186-806a-2ca14c9ce9ea/Images/Documentation/Tag%20ID%2020211115.png)

If you do not see the code, you may need to view a different tab within your Developer Tools.

### TagName

The [tag's name](https://support.smarteru.com/docs/tag-main#name). The tag must already exist within your SmarterU account. This tag is mutually exclusive with the [TagID](/v1/docs/api-createcredential#tagid) tag.

### TagValues

A comma-separated list of [values for the tag](/v1/docs/tag-pre-defined-values). The allowed values are controlled by the tag's settings.

## TrainingCost Tag Group

The TrainingCost tag group is a container for the [action's training cost](/v1/docs/action-training-cost).

```plaintext
<TrainingCost>
   <Trainer>
      <TrainerID></TrainerID>
         - OR -
      <TrainerEmail><![CDATA[]]></TrainerEmail>
         - OR -
      <TrainerEmployeeID><![CDATA[]]></TrainerEmployeeID>
   </Trainer>
   <LearnerHours></LearnerHours>
   <TrainerHours></TrainerHours>
   <ExtraCostAmount></ExtraCostAmount>
   <ExtraCostDescription><![CDATA[]]></ExtraCostDescription>
</TrainingCost>
```

The TrainingCost tag group may contain the following.

### Trainer

A container for specifying the action's trainer. The trainer must already exist in SmarterU.

The Trainer tag must contain one of the following.

| Tag | Description |
| --- | --- |
| **TrainerID** | The trainer's system-generated identifier. |
| **TrainerEmail** | The trainer's email address. |
| **TrainerEmployeeID** | The trainer's employee ID. |

### LearnerHours

The number of hours the learner spends completing this action.

### TrainerHours

The number of hours the selected trainer spends on this action.

### ExtraCostAmount

The amount of any additional cost associated with this action.

### ExtraCostDescription

A description for any additional cost associated with this action.

## **API Response XML Package**

The [API response XML package](/v1/docs/api-response-xml-package) will always include a Result, Info, and [Errors](/v1/docs/api-createcredential#error-codes) tag.

```plaintext
<SmarterU>
   <Result></Result>
   <Info>
      <Credential><![CDATA[]]></Credential>
      <CredentialID></CredentialID>
   </Info>

   <Errors>
      <Error>
         <ErrorID></ErrorID>
         <ErrorMessage></ErrorMessage>
      </Error>
   </Errors>
</SmarterU>
```

The response may also contain the following.

### Credential

The [action's name](https://support.smarteru.com/docs/action-main#name).

### CredentialID

The action's system-generated identifier.

### Example API Response XML Package

Below is an example of an API response XML package.

```plaintext
<SmarterU>
   <Result>Success</Result>
   <Info>
      <Credential><![CDATA[In-person Interview]]></Credential>
      <CredentialID></CredentialID>
   </Info>

   <Errors>
   </Errors>
</SmarterU>
```

## Error Codes

| Error Code | Message |
| --- | --- |
| CC:01 | The name provided is invalid. |
| CC:02 | The status provided is invalid. |
| CC:03 | The description provided is invalid. |
| CC:04 | The allow attachments is invalid. |
| CC:05 | The expires provided is invalid. |
| CC:06 | The days good is invalid. |
| CC:07 | The visible to learner provided is invalid. |
| CC:08 | The learning modules provided is invalid. |
| CC:09 | The credentials provided is invalid. |
| CC:10 | The added prerequisites provided is invalid. |
| CC:11 | The removed prerequisites provided is invalid. |
| CC:12 | The learning modules provided is invalid. |
| CC:13 | The credentials provided is invalid. |
| CC:14 | The requires confirmation provided is invalid. |
| CC:15 | The confirmation attachments provided is invalid. |
| CC:16 | The confirmation notification provided is invalid. |
| CC:17 | The permissions provided is invalid. |
| CC:18 | One or more permission types provided are not valid. Only GM, MGU and SUP are allowed values. |
| CC:19 | One or more Learning Modules provided are not valid. |
| CC:20 | One or more Credentials provided are not valid. |
| CC:21 | Credential name cannot be used. |
| CC:22 | Credential ID cannot be used. |
| CC:23 | The required permissions are not met to call the createCredential method. |
| CC:24 | Type not specified. |
| CC:25 | Permissions are required when requires confirmation is 1. |
| CC:26 | Days good should be greater than recall days. |
| CC:27 | The allows attachments provided is not valid. Only NO, YES or REQUIRED are allowed values. |
| CC:28 | The learning modules provided is invalid. |
| CC:29 | The confirmation attachments provided is not valid. Only NO, YES or REQUIRED are allowed values. |
| CC:30 | The required permissions are not met to call the createCredential method. |
| CC:31 | The status provided is not valid. Only ACTIVE or INACTIVE are allowed values. |
| CC:32 | One or more of the credential provided are not valid. Credentials cannot be added more than once. |
| CC:33 | The recall days provided is invalid. |
| CC:34 | Either DaysGood or ExpirationDate can be provided. |
| CC:36 | One or more tags do not exist in the provided account. |
| CC:37 | All tags provided must have at least one value. |
| CC:38 | Values must be from the pre-defined list specified for the tag. |
| CC:39 | The training cost provided is invalid. |
| CC:40 | The trainer provided is invalid. |
| CC:41 | The trainer ID provided is invalid. |
| CC:42 | The trainer email provided is invalid. |
| CC:43 | The trainer employee ID provided is invalid. |
| CC:44 | The learner hours provided is invalid. |
| CC:45 | The trainer hours provided is invalid. |
| CC:46 | The extra cost amount provided is invalid. |
| CC:47 | The extra cost description provided is invalid. |
| CC:48 | The trainer does not exist. |

## Related

- [Actions](/actions.md)
- [Adding an Action](/adding-an-action.md)
- [API: getCredential](/api-getcredential.md)
- [API: listCredentials](/api-listcredentials.md)
- [API: updateCredential](/api-updatecredential.md)
