Auth API reference

Auth API · Apps

get/v1/apps/{app_id}/sign-in-tests/{test_id}Auth

Get a sign-in test and its result.

Poll this after opening `start_url`. `state` turns `succeeded` (with `outcome` and `identity`) or `failed` (with `error.fix`). A test that is never finished turns `failed` with code `expired` 15 minutes after it was created.

Path parameters

app_id*string

Id of the app.

test_id*string · uuid

Id of the test.

Response · 200

id*string · uuid

Unique identifier of the sign-in test.

Example: "6f1c2b8e-3a4d-4e5f-8a9b-0c1d2e3f4a5b"

app_id*string · uuid

The Auth app the sign-in test belongs to.

Example: "0b6f3c7e-6a43-4c55-9d4b-2a9a7f5b1c11"

method*object

`oauth` (sign in at a provider in a popup) or `password` (checks the sign-up and sign-in rules and sends the test emails).

Example: "oauth"

provider*string

The provider tested (`oauth` tests), or `null`. The sign-in provider: `apple`, `google`, `github`, `microsoft`, or `oidc-<key>` for an OpenID Connect provider you added (the key is 1 to 32 lowercase letters, digits or hyphens that you choose, for example `oidc-okta`).

Example: "google"

state*object

`pending`: waiting for the sign-in at the provider (open `start_url`). `succeeded`: the sign-in would work; see `outcome` and `identity`. `failed`: see `error` for the fix. A test that is never finished becomes `failed` with code `expired`.

Example: "pending"

outcome*object

What a real sign-in would have done: sign in an existing user, or create a new one. The test itself never creates or links an account.

Example: "would_create"

identity*object

Who signed in during the test, once it completes; `null` before that.

error*object

Why the test failed, or `null`.

email_delivery*object

Succeeded `password` / `otp` tests: whether the email went out. A `password` test passes even when it did not, because real sign-up and sign-in do not need it; `notice` says why and how to turn it on. Null for `oauth` tests and failed tests.

start_url*string · uri

OAuth tests only: open this in a popup to sign in at the provider. Works once, until `expires_at`. Null once used, for password and email-code tests, and when the test already failed its checks.

Example: "https://api.auth.productcraft.co/acme/v1/auth/oauth/google/authorize?return_to=https%3A%2F%2Fconsole.productcraft.co%2Fauth%2Fsign-in-test%2Fcallback&sign_in_test=6f1c2b8e-3a4d-4e5f-8a9b-0c1d2e3f4a5b"

callback_host*string · hostname

The custom domain the test runs on (`custom_domain: true`), or null for the canonical host. The start link is on this host and the provider is sent its callback URL, `https://<callback_host>/v1/auth/oauth/<provider>/callback`.

Example: "auth.acme.com"

expires_at*string · date-time

The start link works until then (10 minutes).

created_at*string · date-time

When the sign-in test was created (ISO 8601).

completed_at*string · date-time

When the test completed (ISO 8601), or `null` while it runs.

Example

Request

GET https://api.auth.productcraft.co/v1/apps/{app_id}/sign-in-tests/{test_id}
Authorization: Bearer YOUR_TOKEN

Response

{
  "id": "6f1c2b8e-3a4d-4e5f-8a9b-0c1d2e3f4a5b",
  "app_id": "0b6f3c7e-6a43-4c55-9d4b-2a9a7f5b1c11",
  "method": "oauth",
  "provider": "google",
  "state": "pending",
  "outcome": "would_create",
  "identity": {},
  "error": {},
  "email_delivery": {},
  "start_url": "https://api.auth.productcraft.co/acme/v1/auth/oauth/google/authorize?return_to=https%3A%2F%2Fconsole.productcraft.co%2Fauth%2Fsign-in-test%2Fcallback&sign_in_test=6f1c2b8e-3a4d-4e5f-8a9b-0c1d2e3f4a5b",
  "callback_host": "auth.acme.com",
  "expires_at": "2026-01-01T00:00:00.000Z",
  "created_at": "2026-01-01T00:00:00.000Z",
  "completed_at": "2026-01-01T00:00:00.000Z"
}