---
title: "Set a consumer's token settings"
method: PUT
path: "/apiops/projects/{projectName}/consumers/{consumerKey}/token-settings"
tags: ["Consumer"]
---

# Set a consumer's token settings

`PUT /apiops/projects/{projectName}/consumers/{consumerKey}/token-settings`

## Request

- Base URL: `http://167.86.118.166:32080`
- URL: `http://167.86.118.166:32080/apiops/projects/{projectName}/consumers/{consumerKey}/token-settings`
- Auth: none declared
- TypeScript: <https://skmtc.dev/apinizer/apis/apinizer-management-apis/docs/apiops/projects/:projectName/consumers/:consumerKey/token-settings/put.ts> (a function with typed inputs; its response is checked against the schema)

Sets the token settings the body carries (a null field keeps its stored value), switches the consumer to secret-manager authentication and redeploys it.

## Path parameters

- `projectName` string, required
- `consumerKey` string, required

## Request body

- TokenSettingsDTO: Token settings for credential
  - `grantType` 'CLIENT_CREDENTIALS' | 'PASSWORD': Grant type for authentication
  - `tokenNeverExpires` boolean: Whether token never expires
  - `tokenExpiresInAmount` integer: Token expiration amount
  - `tokenExpiresInUnit` 'MILLI_SECONDS' | 'SECONDS' | 'MINUTES' | 'HOURS' | 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS': Token expiration unit
  - `refreshTokenAllowed` boolean: Whether refresh token is allowed
  - `refreshTokenCount` integer: Refresh token count
  - `refreshTokenExpiresInAmount` integer: Refresh token expiration amount
  - `refreshTokenExpiresInUnit` 'MILLI_SECONDS' | 'SECONDS' | 'MINUTES' | 'HOURS' | 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS': Refresh token expiration unit
  - `allowUrlParameters` boolean: Whether URL parameters are allowed
  - `jwtSignatureAlgorithm` string: JWT signature algorithm
  - `deletePrevious` boolean: Whether to delete previous tokens

## Response `200`

OK

- ApiOpsMutationResponseApiOpsResponseConsumer
  - `status` 'SUCCESS' | 'FAILURE'
  - `resourceVersion` integer
  - `runtimeDeployment` ApiOpsRuntimeDeploymentDTO
    - `state` 'IN_SYNC' | 'DEGRADED'
    - `environments` Environment[]
      - `name` string
      - `acknowledged` boolean
      - `detail` string
  - `result` ApiOpsResponseConsumer
    - `consumerKey` string
    - `username` string
    - `fullName` string
    - `email` string
    - `description` string
    - `enabled` boolean
    - `organizationCode` string
    - `expireDate` string, date-time
    - `trafficLogDisabled` boolean
    - `ipList` string[]
    - `roleNames` string[]
    - `metadata` CredentialMetadataDTO[]
      - `key` string
      - `value` string
      - `secret` boolean
      - `includeInJwt` boolean
      - `includeInTokenResponse` boolean
      - `jwtClaimName` string

---

[API](https://skmtc.dev/apinizer/apis/apinizer-management-apis.md) - [All operations](https://skmtc.dev/apinizer/apis/apinizer-management-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/apinizer/apis/apinizer-management-apis/revisions/e083046b24cd?raw)
