# Unclaimed instances

Source: https://www.pontive.com/docs/api-reference/platform/unclaimed-instances

Base URL: `https://api.pontive.com/v1` (operations that name another server say so).

## Create an unclaimed development instance

```http
POST https://api.pontive.com/v1/unclaimed-instances
```

Create a development instance with no account: a project in Pontive's holding workspace with its Development instance, a developer secret key named keyless and an app, everything an app needs to run on the developer's machine. Public and unauthenticated: it takes no credential, and one sent is ignored. The instance is deleted with its users 7 days after it is created (expires_at) unless it is claimed into a workspace first (POST /unclaimed-instances/{instance_id}/claim-links). At most 3 per IP address (IPv6 /64) per rolling 24 hours and a ceiling per ASN (429 unclaimed_instance_limit with Retry-After); 503 unclaimed_instances_unavailable with Retry-After when the service is switched off or a global cap is reached; 403 caller_blocked for a blocked address or network. With X-Idempotency-Key, a retry within 24 hours from the same address answers the same instance, counted once, with fresh secrets: the earlier claim token, key value and client secret stop working. The region is the body's, else the one nearest the caller, echoed back. Redirect URIs are loopback only (422 redirect_uri_not_loopback); a URI without a port matches any port. With encryption_key (a public EC P-256 or OKP X25519 JWK; 422 invalid_encryption_key otherwise) the secrets come back as a compact JWE in encrypted_secrets (ECDH-ES, A256GCM, kid the key's RFC 7638 thumbprint) of {client_secret, secret_key, claim_token}, never in the clear. The secrets are answered once; never log them. The response carries Sunset and Link rel=sunset.

Operation ID: `CreateUnclaimedInstance`

### Header parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `X-Idempotency-Key` | string |  | Idempotency key: a retry within 24 hours from the same address answers the same instance |

### Request body (`application/json`): CreateUnclaimedInstanceRequest

The instance; every field is optional

### Responses

- `201` Created: CreatedUnclaimedInstance
- `400` Bad Request: ErrResponse
- `403` caller_blocked: ErrResponse
- `413` Request Entity Too Large: ErrResponse
- `422` field_invalid_format, redirect_uri_not_loopback, invalid_region, invalid_encryption_key: ErrResponse
- `429` unclaimed_instance_limit (rate_limit_error), with Retry-After: ErrResponse
- `500` Internal Server Error: ErrResponse
- `503` unclaimed_instances_unavailable, with Retry-After: ErrResponse

## Get an unclaimed instance

```http
GET https://api.pontive.com/v1/unclaimed-instances/{instance_id}
```

Read an unclaimed instance: with its claim token in X-Pontive-Claim-Token, its status for polling (720 reads per instance per hour); or with a Pontive user's session and a claim link's code in X-Pontive-Claim-Code, for the dashboard's claim page, with the caller's workspaces where they may create a project, each with whether the instance fits (eligible, or reason: project_limit_exceeded, workspace_suspended, workspace_paused, workspace_cancelled) and what the claim would start there (charges, as a project create answers them); 20 session reads and claims per user per hour. Reading does not use up the code. Once claimed, the claim token keeps reading status claimed with claimed_at and nothing else of the instance. 404 unclaimed_instance_not_found for an unknown or expired instance or a wrong token, alike; 404 claim_link_invalid for an unknown, expired or used code.

Operation ID: `GetUnclaimedInstance`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `instance_id` | string | yes | Instance ID |

### Header parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `X-Pontive-Claim-Token` | string |  | The claim token |
| `X-Pontive-Claim-Code` | string |  | A claim link's code, with a Pontive user's session |

### Responses

- `200` OK: UnclaimedInstance
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` unclaimed_instance_not_found, claim_link_invalid: ErrResponse
- `429` rate_limit_error, with Retry-After: ErrResponse
- `500` Internal Server Error: ErrResponse

## Claim an unclaimed instance

```http
POST https://api.pontive.com/v1/unclaimed-instances/{instance_id}/claim
```

Claim an unclaimed instance into one of the caller's workspaces, with a Pontive user's session and a claim link's code in X-Pontive-Claim-Code: its project moves into the workspace intact (ids, issuer, users, apps, keys and settings unchanged), its expiry is cleared and every claim link of it dies. Needs project:create on the workspace, as a project create does (403 otherwise). name renames the project. Answers the project, now in the workspace, with what it started charging. 404 claim_link_invalid for an unknown, expired or used code; 409 instance_claimed; 409 project_limit_exceeded when the workspace's plan holds no more projects; 403 workspace_suspended, workspace_paused or workspace_cancelled. With X-Idempotency-Key, the answer is kept for 24 hours: a retry with the same key and body is answered it again without claiming, and the same key with another body is 422 idempotency_key_reused. 20 session reads and claims per user per hour.

Operation ID: `ClaimUnclaimedInstance`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `instance_id` | string | yes | Instance ID |

### Header parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `X-Pontive-Claim-Code` | string | yes | The claim link's code |
| `X-Idempotency-Key` | string |  | Idempotency key |

### Request body (`application/json`, required): ClaimUnclaimedInstanceRequest

The workspace, and a new name

### Responses

- `200` OK: ClaimedProject
- `400` Bad Request: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` permission_denied, workspace_suspended, workspace_paused, workspace_cancelled: ErrResponse
- `404` claim_link_invalid, unclaimed_instance_not_found: ErrResponse
- `409` instance_claimed, project_limit_exceeded: ErrResponse
- `422` field_invalid_format, idempotency_key_reused: ErrResponse
- `429` rate_limit_error, with Retry-After: ErrResponse
- `500` Internal Server Error: ErrResponse

## Create a claim link

```http
POST https://api.pontive.com/v1/unclaimed-instances/{instance_id}/claim-links
```

Mint a claim link with the claim token in X-Pontive-Claim-Token: https://app.pontive.com/claim/{instance_id}#code={code}, the code in the fragment, single use, valid for one hour. Give the person the link, never the token. Minting does not end older links; the first one used ends every other. 30 per instance and 60 per IP address per hour. 404 unclaimed_instance_not_found for an unknown or expired instance or a wrong token; 409 instance_claimed once claimed.

Operation ID: `CreateClaimLink`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `instance_id` | string | yes | Instance ID |

### Header parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `X-Pontive-Claim-Token` | string | yes | The claim token |

### Responses

- `201` Created: ClaimLink
- `404` unclaimed_instance_not_found: ErrResponse
- `409` instance_claimed: ErrResponse
- `429` rate_limit_error, with Retry-After: ErrResponse
- `500` Internal Server Error: ErrResponse

## Schemas

### CreateUnclaimedInstanceRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `app` | UnclaimedInstanceApp |  | The app made with the instance. |
| `client` | UnclaimedInstanceClient |  | The tool, its version and, when detected, the agent: metrics and abuse signals only, never trusted for limits. |
| `encryption_key` | object |  | A public JWK, EC P-256 or OKP X25519: the secrets are then answered sealed to it in encrypted_secrets, never in the clear. |
| `name` | string |  | The project's name, "Untitled app" by default; the claimer may rename it. |
| `region` | "us" \| "eu" \| "au" |  | A region this installation serves; by default the one nearest the caller, echoed in the response. Immutable. |
| `tenancy_mode` | "b2b" \| "b2c" |  | b2c by default. Immutable. |

### CreatedUnclaimedInstance

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `app_id` | string |  |  |
| `claim_token` | string |  | The instance's ownership until it is claimed, answered once; absent with encryption_key. Never put it in a URL or a log. |
| `client_secret` | string |  | A web app's client secret; absent for spa and native, and with encryption_key. |
| `encrypted_secrets` | string |  | With encryption_key: a compact JWE (ECDH-ES, A256GCM, kid the key's RFC 7638 thumbprint) of {client_secret, secret_key, claim_token}. |
| `environment` | string |  |  |
| `expires_at` | string (date-time) |  | When Pontive deletes it, with its users, unless it is claimed first. |
| `instance_id` | string |  |  |
| `issuer` | string |  | The instance's issuer, its auth domain's origin. |
| `limits_url` | string |  |  |
| `name` | string |  |  |
| `object` | string |  |  |
| `project_id` | string |  |  |
| `region` | "us" \| "eu" \| "au" |  |  |
| `secret_key` | string |  | The developer secret key named keyless; absent with encryption_key. |
| `secret_key_id` | string |  |  |
| `tenancy_mode` | "b2b" \| "b2c" |  |  |

### ErrResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | ErrBody |  |  |

### UnclaimedInstance

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `claimed_at` | string (date-time) |  | Null until claimed. |
| `created_at` | string (date-time) |  |  |
| `expires_at` | string (date-time) |  |  |
| `instance_id` | string |  |  |
| `issuer` | string |  |  |
| `name` | string |  |  |
| `object` | string |  |  |
| `project_id` | string |  |  |
| `region` | "us" \| "eu" \| "au" |  |  |
| `status` | "unclaimed" \| "claimed" |  |  |
| `tenancy_mode` | "b2b" \| "b2c" |  |  |
| `workspaces` | ClaimWorkspace[] |  | With a Pontive user's session and a link's code: the caller's workspaces where they may create a project, each with whether the instance fits and what a claim would start charging there. |

### ClaimUnclaimedInstanceRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string |  | Renames the project; omitted keeps its name. |
| `workspace_id` | string |  | The workspace the project moves into: the caller must be able to create a project there. |

### ClaimedProject

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `charges` | ProjectCharges |  | What the project started billing per month, on the project a create returns and nowhere else: nothing on Free or in one of the plan's included slots; else the additional-project fee and, on a b2b project, the uplift (pontive-spec 10). Absent where the installation bills nothing. |
| `compliance_tags` | ComplianceTags |  | Compliance tags of the project |
| `created_at` | string (date-time) |  | The time when the project was created |
| `deleted_at` | string (date-time) |  | The time when the project was deleted, if applicable |
| `description` | string |  | The description of the project |
| `id` | string |  | The unique identifier of the project |
| `instances` | InstanceSummary[] |  | Read-only summary of the project's instances, oldest first |
| `metadata` | Metadata |  | The new metadata for the project |
| `name` | string |  | The name of the project |
| `object` | string |  | The object type |
| `paused_at` | string (date-time) |  | The time when the project was paused, if applicable |
| `purge_scheduled_at` | string (date-time) |  | When a deleted project's restore window ends, deleted_at plus 30 days: it can be restored until then, and is purged after (route review D30). Null unless the project is deleted. |
| `region` | "us" \| "eu" \| "au" |  | The region where the project and all its instances are deployed |
| `slug` | string |  | The slug of the project. Client-supplied, permanent, globally unique and never reused. |
| `status` | "active" \| "paused" \| "deleted" |  | The current status of the project |
| `tenancy_mode` | "b2b" \| "b2c" |  | The project's tenancy mode, chosen at creation and immutable. Every instance inherits it. |
| `updated_at` | string (date-time) |  | The time when the project was last updated |
| `workspace_id` | string |  | The ID of the workspace that owns this project |

### ClaimLink

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `expires_at` | string (date-time) |  |  |
| `object` | string |  |  |
| `url` | string |  | The dashboard's claim page, the code in the fragment. |

### UnclaimedInstanceApp

The app made with the instance.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `redirect_uris` | string[] |  | Loopback only (localhost, 127.0.0.1, [::1]). Without a port, any port matches on a non-production instance. Default http://localhost/api/auth/callback and http://127.0.0.1/api/auth/callback. |
| `type` | "web" \| "spa" \| "native" |  | web (default): an oauth confidential client with a client secret, for server sessions; spa: a public oauth client with PKCE; native: a public native client. |

### UnclaimedInstanceClient

The tool, its version and, when detected, the agent: metrics and abuse
signals only, never trusted for limits.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `agent` | string |  |  |
| `name` | string |  |  |
| `version` | string |  |  |

### ErrBody

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | string |  | Code is a stable machine-readable identifier for this error: the domain code where one exists (e.g. slug_conflict, instance_not_found, confirmation_required), else the spec's generic code (invalid_request, permission_denied, not_found, conflict, internal_error). |
| `doc_url` | string |  | DocURL links to documentation about this error, when available. |
| `message` | string |  | Message is a human-readable description of what went wrong. |
| `object` | string |  | Object is the discriminator; always "error". |
| `param` | string |  | Param names the request parameter this error refers to, when applicable. |
| `type` | string |  | Type is the error's category, from its HTTP status: validation_error, authentication_error, authorization_error, not_found, conflict_error, rate_limit_error or internal_error. |

### ClaimWorkspace

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `charges` | ProjectCharges |  | What the project started billing per month, on the project a create returns and nowhere else: nothing on Free or in one of the plan's included slots; else the additional-project fee and, on a b2b project, the uplift (pontive-spec 10). Absent where the installation bills nothing. |
| `eligible` | boolean |  |  |
| `name` | string |  |  |
| `plan` | string |  | The workspace's plan id; empty when it cannot be read. |
| `reason` | string |  | When not eligible, the error code a claim into it would answer: project_limit_exceeded, workspace_suspended, workspace_paused, workspace_cancelled. |
| `workspace_id` | string |  |  |

### ProjectCharges

What the project started billing per month, on the project a create
returns and nowhere else: nothing on Free or in one of the plan's
included slots; else the additional-project fee and, on a b2b project,
the uplift (pontive-spec 10). Absent where the installation bills
nothing.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `included` | boolean |  | Whether the project took one of the plan's included slots. |

### ComplianceTags

Compliance tags of the project

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `GDPR` | boolean |  |  |
| `HIPAA` | boolean |  |  |

### InstanceSummary

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `environment` | "production" \| "non_production" |  | The environment of the instance |
| `id` | string |  | The unique identifier of the instance |
| `name` | string |  | The name of the instance |
| `slug` | string |  | The slug of the instance |
| `status` | "active" \| "paused" \| "deleted" |  | The effective status of the instance |

### Metadata

The new metadata for the project

Type: Record<string, string>
