API referencePlatform APIEndpoint reference
GUIDE & REFERENCE

/api/provisioning/instances/readiness (dashboard)

Source-derived dashboard endpoint contract, authentication, request validation, responses, and errors.

This is the dashboard service route. Its origin and authentication are described in Platform API overview and Authentication. A path shared by another service is a different endpoint.

PropertyContract
MethodsGET
Path/api/provisioning/instances/readiness
Path parametersNone
Query parameters read in routeendpoint
Headers read in routeNo additional direct header reads; authentication helpers may read credentials

Authentication and access

No explicit authentication check in this route module. Imported handlers or deployment middleware may impose additional controls; this inventory does not assert public deployment access.

Method behavior

The handler excerpt preserves field validation, response envelopes, cookie changes, and exception branches. Values returned by service helpers retain their named response type above; for passthrough routes, the upstream response is authoritative.

GET

export async function GET(request: NextRequest) {
  const endpoint = request.nextUrl.searchParams.get('endpoint');
  const target = normalizeMindsEndpoint(endpoint);
  if (!target) {
    return NextResponse.json(
      { error: { code: 'INVALID_ENDPOINT', message: 'Readiness checks require a minds.sh HTTPS endpoint.' } },
      { status: 400 }
    );
  }

  const readinessUrl = new URL(READINESS_PATH, target);
  try {
    const response = await fetch(readinessUrl, {
      headers: { accept: 'application/json' },
      cache: 'no-store',
    });

    if (response.ok) {
      return NextResponse.json(
        { status: 'ready' },
        { headers: { 'cache-control': 'private, no-cache, no-store, must-revalidate' } }
      );
    }

    return NextResponse.json(
      { status: 'pending', upstreamStatus: response.status },
      {
        status: 202,
        headers: { 'cache-control': 'private, no-cache, no-store, must-revalidate' },
      }
    );
  } catch (error) {
    return NextResponse.json(
      {
        status: 'pending',
        message: error instanceof Error ? error.message : 'Readiness check failed',
      },
      {
        status: 202,
        headers: { 'cache-control': 'private, no-cache, no-store, must-revalidate' },
      }
    );
  }
}

Source: minds-ui/apps/app/app/api/provisioning/instances/readiness/route.ts:8.

Response and error branches

Literal HTTP statuses in the route: 202, 400. Shared management error classes are defined in Errors and responses.

NextResponse.json(
      { error: { code: 'INVALID_ENDPOINT', message: 'Readiness checks require a minds.sh HTTPS endpoint.' } },
      { status: 400 }
    )

Source: minds-ui/apps/app/app/api/provisioning/instances/readiness/route.ts:12.

NextResponse.json(
        { status: 'ready' },
        { headers: { 'cache-control': 'private, no-cache, no-store, must-revalidate' } }
      )

Source: minds-ui/apps/app/app/api/provisioning/instances/readiness/route.ts:26.

NextResponse.json(
      { status: 'pending', upstreamStatus: response.status },
      {
        status: 202,
        headers: { 'cache-control': 'private, no-cache, no-store, must-revalidate' },
      }
    )

Source: minds-ui/apps/app/app/api/provisioning/instances/readiness/route.ts:32.

NextResponse.json(
      {
        status: 'pending',
        message: error instanceof Error ? error.message : 'Readiness check failed',
      },
      {
        status: 202,
        headers: { 'cache-control': 'private, no-cache, no-store, must-revalidate' },
      }
    )

Source: minds-ui/apps/app/app/api/provisioning/instances/readiness/route.ts:40.

Evidence

Generated from the local source snapshot on 2026-09-12. This page documents implemented code and does not certify a deployed service, permissions configuration, or successful provider operation.

Source file: minds-ui/apps/app/app/api/provisioning/instances/readiness/route.ts. SHA-256: 02872476f289994dde61a27069c8c144d3a51e4a9ea460a509283fdb29bc0547.

On this page