# ai.newnal.illi.home.createInvite

> Create an invite link (root admin). The token is shown once and delivered by hand.

- Kind: procedure
- Authority: home.illi.newnal.ai
- Lexicon: 1
- Published by [illi-service.newnal.id](https://lexicon.garden/identity/did:plc:uztm7bi2ce42dez3uu3qafro), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.home.createInvite)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.home.createInvite/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.home.createInvite/analytics)

## Procedure (`ai.newnal.illi.home.createInvite`)

Type: procedure · POST

### Input (application/json)

- `expiresInDays` (integer)
  - Constraints: minimum: 1, maximum: 30, default: 7
- `homeId` (string · tid, required)
- `maxUses` (integer)
  - Constraints: minimum: 1, maximum: 20, default: 1
- `note` (string)
  - Constraints: maxLength: 120

### Output (application/json)

- `expiresAt` (string · datetime, required)
- `inviteId` (string, required)
- `inviteUrl` (string · uri, required)
- `maxUses` (integer, required)

### Errors

- `NotRootAdmin`: No description in schema.
- `HomeNotFound`: No description in schema.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Create an invite link (root admin). The token is shown once and delivered by hand.",
      "errors": [
        {
          "name": "NotRootAdmin"
        },
        {
          "name": "HomeNotFound"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "expiresInDays": {
              "default": 7,
              "maximum": 30,
              "minimum": 1,
              "type": "integer"
            },
            "homeId": {
              "format": "tid",
              "type": "string"
            },
            "maxUses": {
              "default": 1,
              "maximum": 20,
              "minimum": 1,
              "type": "integer"
            },
            "note": {
              "maxLength": 120,
              "type": "string"
            }
          },
          "required": [
            "homeId"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "expiresAt": {
              "format": "datetime",
              "type": "string"
            },
            "inviteId": {
              "type": "string"
            },
            "inviteUrl": {
              "format": "uri",
              "type": "string"
            },
            "maxUses": {
              "type": "integer"
            }
          },
          "required": [
            "inviteId",
            "inviteUrl",
            "expiresAt",
            "maxUses"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "ai.newnal.illi.home.createInvite",
  "lexicon": 1
}
```
