# /api/provisioning/instances/readiness (dashboard)

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

Source: https://docs.minds.sh/docs/api/platform/reference/dashboard--api-provisioning-instances-readiness



This is the **dashboard** service route. Its origin and authentication are described in [Platform API overview](/docs/api/platform) and [Authentication](/docs/api/platform/authentication). A path shared by another service is a different endpoint.

| Property                       | Contract                                                                       |
| ------------------------------ | ------------------------------------------------------------------------------ |
| Methods                        | GET                                                                            |
| Path                           | `/api/provisioning/instances/readiness`                                        |
| Path parameters                | None                                                                           |
| Query parameters read in route | `endpoint`                                                                     |
| Headers read in route          | No additional direct header reads; authentication helpers may read credentials |

## Authentication and access [#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 [#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 [#get]

```typescript
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 [#response-and-error-branches]

Literal HTTP statuses in the route: 202, 400. Shared management error classes are defined in [Errors and responses](/docs/api/platform/errors).

```typescript
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`.

```typescript
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`.

```typescript
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`.

```typescript
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 [#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`.
