---
title: "Issue an OAuth client to a service account (returns the client secret once)"
method: POST
path: "/api/rest/v1/service-accounts/{serviceAccountId}/credentials/oauth-clients"
tags: ["Credentials"]
---

# Issue an OAuth client to a service account (returns the client secret once)

`POST /api/rest/v1/service-accounts/{serviceAccountId}/credentials/oauth-clients`

## Request

- Base URL: `https://app.componecat.ai`
- URL: `https://app.componecat.ai/api/rest/v1/service-accounts/{serviceAccountId}/credentials/oauth-clients`
- Auth: none required

## Path parameters

- `serviceAccountId` string, uuid, required

## Request body

- CreateOAuthClientRequest: Request body for issuing an OAuth client. The owning service account comes from the route.
  - `name` string, required
  - `scopes` CredentialScopeRequest[], required
    - `resource` string, required
    - `access` string, required
    - `canCreate` boolean, nullable, required
  - `expiresInDays` union, required
    - integer
    - string, int32

## Response `201`

Created

- CreatedOAuthClientResource: The issued OAuth client returned by the REST create endpoint; the secret is shown only once. The credential is subsequently addressable at `…/credentials/{id}`.
  - `id` string, uuid, required
  - `clientId` string, required
  - `clientSecret` string, required
  - `name` string, required
  - `expiresAt` string, date-time, required

## Other responses

- `404`: Not Found

---

[API](https://skmtc.dev/componecat/apis/componecat-rest-api.md) · [All operations](https://skmtc.dev/componecat/apis/componecat-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/componecat/apis/componecat-rest-api/revisions/6c53d4984720?raw)
