> For AI agents: [llms.txt](https://docs.trustedauth.com/llms.txt) provides a Markdown index of this documentation.

# Update a smart credential

`PUT /api/web/v1/smartcredentials/{id}`

Update the specified smart credential. Caller requires the SMARTCREDENTIALS:EDIT permission.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| id | path | Yes | string | The UUID of the smart credential to be modified. |

## Request Body

Required.

### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "cardDigitalConfigId": {
      "type": "string",
      "description": "The UUID of the Card Digital Id config of this smart credential. It can be specified in either the create or update operations.  If not set, the smart credential will not have a Card Digital Id."
    },
    "cardHolderDigitalConfigId": {
      "type": "string",
      "description": "The UUID of the Card Holder Digital Id config of this smart credential. It can be specified in either the create or update operations.  If not set, the smart credential will not have a Card Holder Digital Id."
    },
    "scDefnId": {
      "type": "string",
      "description": "The UUID of the Smart Credential Definition that defines this smart credential. It must be specified when the smart credential is created and can be updated for an existing smart credential."
    },
    "state": {
      "type": "string",
      "description": "The state of the smart credential.  Only smart credentials in the ACTIVE state can be used for authentication.",
      "enum": [
        "ACTIVE",
        "INACTIVE"
      ]
    },
    "userId": {
      "type": "string",
      "description": "The UUID of the user that owns this smart credential. This value must be specified when the smart credential is created and is read-only after that."
    },
    "variableValues": {
      "type": "array",
      "description": "When creating or modifying a smart credential, the variable values specify a list of variable values to be set.",
      "items": {
        "type": "object",
        "properties": {
          "scDefnVariable": {
            "type": "object",
            "properties": {
              "defaultValue": {
                "type": "string",
                "description": "The default value of this variable."
              },
              "displayable": {
                "type": "boolean",
                "description": "A flag indicating if values for this variable should be displayed."
              },
              "generate": {
                "type": "boolean",
                "description": "A flag indicating if the initial value for this variable should be generated."
              },
              "generateLength": {
                "type": "integer",
                "description": "A length value used when generating values for this variable.",
                "format": "int32"
              },
              "id": {
                "type": "string",
                "description": "The UUID of this SC Defn Variable."
              },
              "modifiable": {
                "type": "boolean",
                "description": "A flag indicating if values for this variable can be modified."
              },
              "name": {
                "type": "string",
                "description": "The name of this SC Defn Variable."
              },
              "order": {
                "type": "integer",
                "description": "A value that specifies the order of this variable with respect to the other variables in the SC Defn.",
                "format": "int32"
              },
              "prompt": {
                "type": "string",
                "description": "Optional prompt to be used when prompting for a value for this variable."
              },
              "required": {
                "type": "boolean",
                "description": "A flag indicating if a value is required for this variable."
              },
              "restrictionDigits": {
                "type": "string",
                "description": "A value specifying restrictions on digits appearing in values of this variable.",
                "enum": [
                  "ALLOWED",
                  "REQUIRED",
                  "NOT_ALLOWED",
                  "NOT_SET"
                ]
              },
              "restrictionLower": {
                "type": "string",
                "description": "A value specifying restrictions on lowercase characters appearing in values of this variable.",
                "enum": [
                  "ALLOWED",
                  "REQUIRED",
                  "NOT_ALLOWED",
                  "NOT_SET"
                ]
              },
              "restrictionMax": {
                "type": "integer",
                "description": "A value indicating a maximum for values of this variable. How this is enforced depends on the variable type.",
                "format": "int32"
              },
              "restrictionMin": {
                "type": "integer",
                "description": "A value indicating a minimum for values of this variable. How this is enforced depends on the variable type.",
                "format": "int32"
              },
              "restrictionRegex": {
                "type": "string",
                "description": "A value specifying a regex that values of this variable must match."
              },
              "restrictionSpecial": {
                "type": "string",
                "description": "A value specifying restrictions on special characters appearing in values of this variable.",
                "enum": [
                  "ALLOWED",
                  "REQUIRED",
                  "NOT_ALLOWED",
                  "NOT_SET"
                ]
              },
              "restrictionUpper": {
                "type": "string",
                "description": "A value specifying restrictions on uppercase characters appearing in values of this variable.",
                "enum": [
                  "ALLOWED",
                  "REQUIRED",
                  "NOT_ALLOWED",
                  "NOT_SET"
                ]
              },
              "scDefnId": {
                "type": "string",
                "description": "The UUID of the SC Defn that owns this variable definition."
              },
              "type": {
                "type": "string",
                "description": "The type of this variable.",
                "enum": [
                  "STRING",
                  "BOOLEAN",
                  "INTEGER",
                  "UUID"
                ]
              },
              "uniqueness": {
                "type": "string",
                "description": "A flag indicating if values of this variable must be unique and if so within what scope.",
                "enum": [
                  "GLOBAL",
                  "USER",
                  "NONE"
                ]
              },
              "uniquenessScopeId": {
                "type": "string",
                "description": "A value that allows a variable to be defined unique in the scope of another variable."
              }
            },
            "description": "SC Defn Variables define the details about variables defined in the SC Defn.",
            "title": "SCDefnVariable"
          },
          "scDefnVariableId": {
            "type": "string",
            "description": "The UUID of the SC Defn Variable that defines the variable."
          },
          "value": {
            "type": "string",
            "description": "The variable value."
          }
        },
        "description": "SCVariableValues store variable values for a smart credential.",
        "title": "SCVariableValue"
      }
    }
  },
  "description": "Parameters for the smart credential to be created including the UUID of the user for which the smart credential will be created.",
  "title": "SmartCredentialParms"
}
```

## Responses

### 200

Successful

### 400

Bad Request

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 401

Access denied

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 403

Forbidden

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 404

Not Found

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 409

Conflict

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

## Security

Requirements

```json
[
  {
    "AdminAPIAuthentication": [
      "SMARTCREDENTIALS:EDIT"
    ]
  }
]
```
