# place.hud.createInstance

> Make a private instance of a published frame app: a memberspace of type place.hud.app.instance on the person's own PDS, keyed by a new TID, with them as its authority and its one member, reading and writing (com.atproto.space.createSpace, then com.atproto.memberspace.putMembers), its info written in their repo in it (place.hud.app.instance.info). Its members alone read and write its entries; the app runs in it unchanged. Requires auth: the workspace's web session (its cookie, with X-HUD: 1 and the server's own Origin) or a HUD access token as Bearer.

- Kind: procedure
- Authority: hud.place
- Lexicon: 1
- Published by [lexicons.hud.place](https://lexicon.garden/identity/did:plc:3tzbz4pml36u4mkresb6pdhv), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:3tzbz4pml36u4mkresb6pdhv/place.hud.createInstance)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:3tzbz4pml36u4mkresb6pdhv/place.hud.createInstance/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:3tzbz4pml36u4mkresb6pdhv/place.hud.createInstance/analytics)

## Procedure (`place.hud.createInstance`)

Type: procedure · POST

### Input (application/json)

- `app` (string · at-uri, required): The app's place.hud.app record, its authority a DID or a handle.
- `name` (string, required): What its members will call it.
  - Constraints: minLength: 1, maxLength: 640, maxGraphemes: 64

### Output (application/json)

- `schema` (ref)
  - Reference: `place.hud.getInstance#instance`

### Errors

- `InvalidRequest`: The input is not what the method takes.
- `NotFound`: No such app, or this server took it down.
- `SpacesUnavailable`: The person's PDS can't host a private instance: it does not offer spaces.
- `MethodNotImplemented`: This server makes no private instances (HUD_SPACES is off).
- `AuthRequired`: No live web session or HUD access token, or the person's sign-in at their PDS ended: sign in.
- `UpstreamFailure`: Their PDS refused or could not be reached; or their sign-in does not allow HUD's private instances, which the message says: sign in again.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Make a private instance of a published frame app: a memberspace of type place.hud.app.instance on the person's own PDS, keyed by a new TID, with them as its authority and its one member, reading and writing (com.atproto.space.createSpace, then com.atproto.memberspace.putMembers), its info written in their repo in it (place.hud.app.instance.info). Its members alone read and write its entries; the app runs in it unchanged. Requires auth: the workspace's web session (its cookie, with X-HUD: 1 and the server's own Origin) or a HUD access token as Bearer.",
      "errors": [
        {
          "description": "The input is not what the method takes.",
          "name": "InvalidRequest"
        },
        {
          "description": "No such app, or this server took it down.",
          "name": "NotFound"
        },
        {
          "description": "The person's PDS can't host a private instance: it does not offer spaces.",
          "name": "SpacesUnavailable"
        },
        {
          "description": "This server makes no private instances (HUD_SPACES is off).",
          "name": "MethodNotImplemented"
        },
        {
          "description": "No live web session or HUD access token, or the person's sign-in at their PDS ended: sign in.",
          "name": "AuthRequired"
        },
        {
          "description": "Their PDS refused or could not be reached; or their sign-in does not allow HUD's private instances, which the message says: sign in again.",
          "name": "UpstreamFailure"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "app": {
              "description": "The app's place.hud.app record, its authority a DID or a handle.",
              "format": "at-uri",
              "type": "string"
            },
            "name": {
              "description": "What its members will call it.",
              "maxGraphemes": 64,
              "maxLength": 640,
              "minLength": 1,
              "type": "string"
            }
          },
          "required": [
            "app",
            "name"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "ref": "place.hud.getInstance#instance",
          "type": "ref"
        }
      },
      "type": "procedure"
    }
  },
  "description": "Make a private instance of a frame app.",
  "id": "place.hud.createInstance",
  "lexicon": 1
}
```
