---
title: "Issue a replacement credential"
method: POST
path: "/oauth-applications/{clientId}/credentials"
tags: ["OAuth applications"]
---

# Issue a replacement credential

`POST /oauth-applications/{clientId}/credentials`

## Request

- Base URL: `https://api.session.services`
- URL: `https://api.session.services/oauth-applications/{clientId}/credentials`
- Auth: API key in header `x-tenant-id`

Issues a second credential so the website can roll over without downtime. Revoke the old one once it is out of use.

## Path parameters

- `clientId` string, required: Immutable OAuth client identifier.

## Request body

- object: Reference to one Team website application at a known revision. A stale revision is rejected.
  - `teamId` string, required: Unique team identifier
  - `revision` integer, required: Optimistic concurrency token. Send the value you read.

## Response `200`

OK

- object: One-time credential issuance response. Must not be logged or cached.
  - `application` object, required: A Team-owned website login application. Credential secrets are never included.
    - `clientId` string, required: Immutable OAuth client identifier.
    - `teamId` string, required: Unique team identifier
    - `tenantId` string, required: Tenant this application belongs to.
    - `name` string, required: Operator-facing name for this website.
    - `redirectUris` string[], required: Exact HTTPS callback URLs. HTTP is allowed only for non-production loopback.
    - `enabled` boolean, required: Disabled applications stop authenticating immediately.
    - `revision` integer, required: Optimistic concurrency token. Send the value you read.
    - `credentials` object[], required
      - `id` string, required: Opaque credential identifier. It reveals nothing about the secret.
      - `expiresAt` integer: Credential expiry as Unix milliseconds. Omitted for credentials that do not expire.
  - `clientSecret` string, required: New credential. Display once and store only on the website server.

## Other responses

- `400`: 400
- `401`: 401
- `403`: 403
- `404`: 404
- `409`: 409
- `412`: 412
- `422`: 422
- `429`: 429
- `500`: 500
- `501`: 501
- `503`: 503

## Changes

- **2026-11-09** `38649d1c1ac7`: 3 breaking, 3 warning, 1 info
  - for the `path` request parameter `clientId`, the minLength was increased from `0` to `1`
  - added the pattern `^tem_[0-9a-z]{26}$` to the request property `teamId`
  - the `revision` request property type changed from `number` to `integer`
  - the `revision` request property's exclusiveMinimum was set to `0.00`
  - …3 more
- **2026-11-09** `24b4e38e7054`: 9 breaking, 4 info
  - the `application/name` response property's maxLength was unset from `100` for the response status `200`
  - the `application/redirectUris/items/` response property's maxLength was unset from `2048` for the response status `200`
  - the `application/redirectUris` response property's minItems was decreased from `1` to `0` for the response status `200`
  - the `application/clientId` response property's minLength was decreased from `1` to `0` for the response status `200`
  - …9 more
- **2026-09-21** `2b2f16550f6d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/session/apis/session-services-api/changes/oauth-applications/:clientId/credentials/post.md)

---

[API](https://skmtc.dev/session/apis/session-services-api.md) - [All operations](https://skmtc.dev/session/apis/session-services-api/llms.txt) - [OpenAPI document](https://skmtc.dev/session/apis/session-services-api/revisions/9346dc3eea56?raw)
