---
title: "Generate client id and secret"
method: POST
path: "/auth/clients"
tags: ["auth"]
---

# Generate client id and secret

`POST /auth/clients`

## Request

- Base URL: `https://api.lumahealth.io/api/v2`
- URL: `https://api.lumahealth.io/api/v2/auth/clients`
- Auth: HTTP bearer

This endpoint allows our users to generate clientId and clientSecrets that can be used  for machine-to-machine communication without the need of a username / password. Since  clientId / clientSecret never expires, it is usefull in running automation process / scripts etc. A user can only have one clientId/clientSecret at any given time.

## Request body

- object
  - `clientName` string, required: Name of the client

## Response `200`

Returns a clientId and clientSecret

- object
  - `clientId` string, required
  - `clientSecret` string, required

## Other responses

- `400`: If the request parameter - clientName - is malformed/invalid or missing. We will also return 400 if the operation fails.
- `406`: If a clientId/clientSecret pair has already been generated.

---

[API](https://skmtc.dev/lumahealth/apis/rest-service.md) - [All operations](https://skmtc.dev/lumahealth/apis/rest-service/llms.txt) - [OpenAPI document](https://skmtc.dev/lumahealth/apis/rest-service/revisions/f19aeba84a26?raw)
