Auth API reference

Auth API · Credentials

post/v1/apps/{app_id}/credentialsAuth

Create a new M2M client

Path parameters

app_id*string

Id of the app.

Headers

Idempotency-Keystring

Optional Stripe-style idempotency key. Same key + same body → cached response. Same key + different body → 409 IDEMPOTENCY_KEY_REUSE. 24h TTL. Non-replayable artefacts (plaintext M2M secret) make this strongly recommended for IaC retries.

Request body

name*string

Client display name

Example: "CI Pipeline"

Response · 201 M2M client created. Plaintext secret is returned ONCE in this response.

id*string

Unique identifier of the M2M client.

client_id*string

The M2M client id (used as `client_id` in the client-credentials grant).

Example: "m2m_a1b2c3d4..."

client_secret*string

Plaintext client secret. Returned exactly once.

name*string

Name of the M2M client.

created_at*string · date-time

When the M2M client was created (ISO 8601).

Example

Request

POST https://api.auth.productcraft.co/v1/apps/{app_id}/credentials
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "name": "CI Pipeline"
}

Response

{
  "id": "string",
  "client_id": "m2m_a1b2c3d4...",
  "client_secret": "string",
  "name": "string",
  "created_at": "2026-01-01T00:00:00.000Z"
}