# Change an own second factor

> Description, default and status of an own second factor - with a session only.

- Effect: Write - Changes the account. Agents ask first.
- Idempotent: yes
- Stability: beta
- REST: `POST https://api.manitu.de/v1/access/tfa/set`
- Page: /reference/access/tfa/set/

**Changes the account. Agents say what will happen and wait for an explicit yes before calling it.**

## REST

`POST https://api.manitu.de/v1/access/tfa/set`

### Authentication

One of `X-API-Key`, `Authorization: Bearer …` - never more than one in a request.

### Request body

JSON; unknown fields are refused.

Send at least 2 field(s).

- `tfa_id` (integer | string, required) - The factor, from access/tfa/list. (pattern `"^[1-9][0-9]*$"`; minimum `1`)
- `description` (string | null) - (maxLength `1024`)
- `is_default` (boolean)
- `status` (string) - inactive: kept, but not asked for at sign-in. (one of `"active"`, `"inactive"`)

### Response

In `data`; the rest of the body as on every call.

- `tfa_id` (integer, required)
- `type` (string, required) - oath-totp: a code from an authenticator app; fido-u2f: a security key. (one of `"oath-totp"`, `"fido-u2f"`)
- `status` (string, required) - inactive: kept, but not asked for at sign-in. (one of `"active"`, `"inactive"`)
- `description` (string | null, required) - What the customer wrote about it (his description), null if nothing - not its name or user name.
- `is_default` (boolean, required) - The one the sign-in asks for first.
- `created_at` (string | null, required) - (format `date-time`)

### Statuses

- `200` Success.
- `400` The request does not match the declared input schema.
- `401` No credential was presented, or it was not recognised.
- `403` The credential is not permitted to use this operation.
- `500` The server failed. Nothing about the request was wrong. Whether a change took effect is not known - check before trying it again.
- `503` The channel this operation forwards through is unavailable.

### Example

```sh
curl -X POST 'https://api.manitu.de/v1/access/tfa/set' \
  -H 'X-API-Key: $API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"tfa_id":12345}'
```

## Example result

```json
{
  "tfa_id": 12345,
  "type": "oath-totp",
  "status": "active",
  "description": "Example",
  "is_default": true,
  "created_at": "2026-10-23T12:00:00+02:00"
}
```
