> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nexudus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Public API Commands

> Use the Nexudus CLI to access your coworking space as a member — manage plans, bookings, invoices, visitors, and more via the public API.

# Public API Commands

The Nexudus CLI supports the **Public API**, which allows you to interact with your coworking space as a member rather than an administrator. This is the same API that powers the members portal, and it lets you manage your plans, bookings, invoices, visitors, and more from the command line.

All public API commands use the `nexudus public` prefix and authenticate against a specific location's subdomain at `{webaddress}.spaces.nexudus.com`.

## How it works

The Public API targets a single location (determined by its web address/subdomain) and authenticates using member credentials (email + password). Tokens are stored separately from admin credentials, so you can switch between admin and member contexts independently.

```
nexudus public <domain> <action> [options] [--json | --md | --agent]
```

For example:

```bash theme={null}
# Authenticate as a member
nexudus public login --web-address myspace --email you@example.com --password xxx

# List your active plans
nexudus public plans list

# View your upcoming bookings
nexudus public bookings list

# Check your invoices
nexudus public invoices list
```

## Authentication

### Log in as a member

```bash theme={null}
nexudus public login --web-address myspace --email you@example.com --password your-password
```

| Option          | Description                                                                       |
| --------------- | --------------------------------------------------------------------------------- |
| `--web-address` | The subdomain of your location (e.g., `myspace` for `myspace.spaces.nexudus.com`) |
| `--email`       | Your member email address                                                         |
| `--password`    | Your member password                                                              |
| `--totp`        | Two-factor authentication code (if 2FA is enabled)                                |

If any option is omitted, the CLI will prompt you interactively.

<Info>
  Public API tokens are stored separately from admin credentials. You can be logged in as both an admin and a member simultaneously.
</Info>

### Verify your session

```bash theme={null}
nexudus public whoami
```

This displays your authenticated member information, including your email, web address, token expiry, and associated profiles.

### Log out

```bash theme={null}
nexudus public logout
```

This clears stored public API (member) credentials only — your admin credentials remain unaffected.

## Command Reference

### Business & Location

| Command                                  | Description                        |
| ---------------------------------------- | ---------------------------------- |
| `nexudus public businesses current`      | Get current location details       |
| `nexudus public businesses networks`     | Get all network locations          |
| `nexudus public businesses all`          | Get all businesses in the network  |
| `nexudus public businesses withVisitors` | Get locations accepting visitors   |
| `nexudus public businesses withTour`     | Get locations with available tours |
| `nexudus public configuration get`       | Get mobile app configuration       |
| `nexudus public countries list`          | Get all countries                  |

Most business commands support the `--shape` option to request only specific fields:

```bash theme={null}
nexudus public businesses current --shape "Name,WebAddress,Country.Name"
```

### Plans & Contracts

| Command                                   | Description                           |
| ----------------------------------------- | ------------------------------------- |
| `nexudus public plans list [--cancelled]` | List your active or cancelled plans   |
| `nexudus public plans get <id>`           | Get details of a specific plan        |
| `nexudus public plans published`          | Browse all published plans            |
| `nexudus public plans cancel <id>`        | Cancel a plan contract                |
| `nexudus public contracts list`           | List your contracts                   |
| `nexudus public contracts get <id>`       | Get contract details                  |
| `nexudus public contracts pause <id>`     | Pause a contract for N billing cycles |
| `nexudus public contracts resume <id>`    | Resume a paused contract              |

**Examples:**

```bash theme={null}
# List active plans
nexudus public plans list

# List cancelled plans
nexudus public plans list --cancelled

# Cancel a plan with reason
nexudus public plans cancel 12345 --reason 1 --notes "Moving to another location"

# Pause a contract for 2 billing cycles
nexudus public contracts pause 12345 --cycles 2
```

### Invoices & Billing

| Command                                                  | Description                      |
| -------------------------------------------------------- | -------------------------------- |
| `nexudus public invoices list [--paid] [--credit-notes]` | List your invoices               |
| `nexudus public invoices get <id>`                       | Get invoice details              |
| `nexudus public products list`                           | List your products               |
| `nexudus public discounts list`                          | List your discount codes         |
| `nexudus public discounts referral`                      | Get your referral discount codes |
| `nexudus public discounts refer <code_id> <email>`       | Send a referral invite           |

**Examples:**

```bash theme={null}
# List unpaid invoices
nexudus public invoices list --paid false

# List credit notes
nexudus public invoices list --credit-notes

# Send a referral invite
nexudus public discounts refer 98765 friend@example.com
```

### Bookings & Resources

| Command                                    | Description                          |
| ------------------------------------------ | ------------------------------------ |
| `nexudus public bookings list [--past]`    | List your upcoming or past bookings  |
| `nexudus public bookings get <id-or-guid>` | Get booking details                  |
| `nexudus public bookings delete <id>`      | Cancel a booking                     |
| `nexudus public bookings suggestions`      | Get booking suggestions              |
| `nexudus public bookings team`             | Get team bookings                    |
| `nexudus public bookings teamCancelled`    | Get cancelled team bookings          |
| `nexudus public bookings cancellationFee`  | Get cancellation fee for a booking   |
| `nexudus public resources summary`         | Get published resources summary      |
| `nexudus public resources details`         | Get published resources with details |
| `nexudus public resources get <id>`        | Get specific resource details        |
| `nexudus public resources products <id>`   | Get products for a resource          |
| `nexudus public resources fields <id>`     | Get custom fields for a resource     |

**Examples:**

```bash theme={null}
# List upcoming bookings
nexudus public bookings list

# List past bookings
nexudus public bookings list --past

# Cancel a booking
nexudus public bookings delete 12345 --reason "NoLongerNeeded" --details "Meeting was rescheduled"

# Browse available resources
nexudus public resources summary
```

### Visitors

| Command                                 | Description                         |
| --------------------------------------- | ----------------------------------- |
| `nexudus public visitors list [--past]` | List your upcoming or past visitors |
| `nexudus public visitors get <id>`      | Get visitor details                 |
| `nexudus public visitors create`        | Create a new visitor                |
| `nexudus public visitors delete <id>`   | Delete a visitor                    |
| `nexudus public visitors approve <id>`  | Approve or reject a visitor         |

**Examples:**

```bash theme={null}
# List upcoming visitors
nexudus public visitors list

# Create a visitor
nexudus public visitors create --business-id 12345 --full-name "John Doe" --email "john@example.com" --expected-arrival "2026-07-10T10:00:00"

# Create visitors from a JSON file
nexudus public visitors create --json-file visitors.json

# Approve a visitor
nexudus public visitors approve 12345
```

### Profile & Settings

| Command                                       | Description                            |
| --------------------------------------------- | -------------------------------------- |
| `nexudus public profile patch`                | Update your profile                    |
| `nexudus public coworkers profiles`           | Get all your profiles across locations |
| `nexudus public coworkers benefits`           | Get your benefits (credits, passes)    |
| `nexudus public coworkers setCurrent`         | Set your active profile                |
| `nexudus public settings get <name>`          | Get a specific setting value           |
| `nexudus public settings getMultiple <names>` | Get multiple setting values            |
| `nexudus public settings search <query>`      | Search settings                        |
| `nexudus public settings set <name> <value>`  | Set a setting value                    |
| `nexudus public settings setMultiple`         | Set multiple settings at once          |

**Examples:**

```bash theme={null}
# Update your profile
nexudus public profile patch --json-request '{"User":{"FirstName":"John"},"Coworker":{"Phone":"555-0100"}}'

# Check your benefits
nexudus public coworkers benefits

# Get a specific setting
nexudus public settings get "maxBookingDays"
```

### Store & Checkout

| Command                           | Description                        |
| --------------------------------- | ---------------------------------- |
| `nexudus public store list`       | Browse store products              |
| `nexudus public store get <id>`   | Get store product details          |
| `nexudus public checkout preview` | Preview checkout with basket items |
| `nexudus public signup contact`   | Send a contact form message        |

**Examples:**

```bash theme={null}
# Browse store products
nexudus public store list

# Filter to time passes only
nexudus public store list --only-time-passes

# Filter by tag
nexudus public store list --tag "printing"

# Preview checkout
nexudus public checkout preview --basket '[{"ProductId":123,"Quantity":1}]' --agreed-terms
```

### Community

| Command                                               | Description            |
| ----------------------------------------------------- | ---------------------- |
| `nexudus public community threads list`               | List community threads |
| `nexudus public community threads get <id>`           | Get thread details     |
| `nexudus public community threads start`              | Start a new thread     |
| `nexudus public community threads delete <id>`        | Delete a thread        |
| `nexudus public community threads like <id>`          | Like a thread          |
| `nexudus public community threads follow <id>`        | Follow a thread        |
| `nexudus public community threads messages list <id>` | List thread messages   |
| `nexudus public community threads messages reply`     | Reply to a thread      |
| `nexudus public community threads messages like`      | Like a message         |
| `nexudus public community groups list`                | List community groups  |
| `nexudus public community tags list`                  | List thread tags       |

**Examples:**

```bash theme={null}
# List community threads
nexudus public community threads list

# Start a new thread
nexudus public community threads start --subject "Welcome event this Friday" --message "Join us for drinks and networking!" --tags "events,community"

# Like a thread
nexudus public community threads like 12345
```

### Perks

| Command                                | Description          |
| -------------------------------------- | -------------------- |
| `nexudus public perks list`            | List available perks |
| `nexudus public perks claim <perk-id>` | Claim a perk         |

### Blog & Content

| Command                                                            | Description             |
| ------------------------------------------------------------------ | ----------------------- |
| `nexudus public blog list [--category-id] [--search] [--featured]` | List blog posts         |
| `nexudus public blog get <id>`                                     | Get a blog post         |
| `nexudus public blog categories`                                   | List blog categories    |
| `nexudus public events list [--past] [--category-id] [--featured]` | List events             |
| `nexudus public events get <id>`                                   | Get event details       |
| `nexudus public faq list [--search]`                               | List FAQ articles       |
| `nexudus public newsletter subscribe <email>`                      | Subscribe to newsletter |

**Examples:**

```bash theme={null}
# Browse blog posts
nexudus public blog list

# Search blog posts
nexudus public blog list --search "workshop"

# List upcoming events
nexudus public events list

# Subscribe to newsletter
nexudus public newsletter subscribe you@example.com --name "John Doe"
```

### Courses

| Command                                            | Description                |
| -------------------------------------------------- | -------------------------- |
| `nexudus public courses list [--group] [--search]` | List available courses     |
| `nexudus public courses get <id>`                  | Get course details         |
| `nexudus public courses my`                        | List your enrolled courses |
| `nexudus public courses signup <id>`               | Sign up for a course       |
| `nexudus public courses accept <id>`               | Accept a course invitation |
| `nexudus public courses lessons <id>`              | List course lessons        |
| `nexudus public courses lesson get <id>`           | Get lesson details         |
| `nexudus public courses lesson complete <id>`      | Mark a lesson as complete  |

### Help Desk

| Command                                       | Description                    |
| --------------------------------------------- | ------------------------------ |
| `nexudus public helpdesk messages list`       | List your help desk messages   |
| `nexudus public helpdesk messages get <id>`   | Get message details            |
| `nexudus public helpdesk messages create`     | Create a new help desk message |
| `nexudus public helpdesk messages close <id>` | Close a message                |
| `nexudus public helpdesk comments list <id>`  | List comments on a message     |
| `nexudus public helpdesk comments create`     | Add a comment                  |
| `nexudus public helpdesk departments list`    | List help desk departments     |

### Teams

| Command                                  | Description                 |
| ---------------------------------------- | --------------------------- |
| `nexudus public teams my`                | List your teams             |
| `nexudus public teams profile <id>`      | Get team profile            |
| `nexudus public teams published`         | Browse published teams      |
| `nexudus public teams publishedGet <id>` | Get published team details  |
| `nexudus public teams addMembers <id>`   | Add members to a team       |
| `nexudus public teams removeMember <id>` | Remove a member from a team |
| `nexudus public teams attendance <id>`   | Get team attendance         |
| `nexudus public teams kpi <id>`          | Get team KPIs               |
| `nexudus public teams metrics <id>`      | Get team metrics            |
| `nexudus public teams directoryMeta`     | Get team directory metadata |

### Deliveries & Mail

| Command                                           | Description                  |
| ------------------------------------------------- | ---------------------------- |
| `nexudus public deliveries list [--show-pending]` | List your deliveries         |
| `nexudus public delivery get <id>`                | Get delivery details         |
| `nexudus public delivery update <id>`             | Update delivery info         |
| `nexudus public delivery markCollected <id>`      | Mark a delivery as collected |

### Virtual Offices

| Command                                  | Description                    |
| ---------------------------------------- | ------------------------------ |
| `nexudus public vo meta`                 | Get virtual office metadata    |
| `nexudus public vo form get`             | Get the virtual office form    |
| `nexudus public vo form submit`          | Submit the virtual office form |
| `nexudus public vo amlChecks list`       | List AML checks                |
| `nexudus public vo amlChecks start`      | Start an AML check             |
| `nexudus public vo identityChecks list`  | List identity checks           |
| `nexudus public vo identityChecks start` | Start an identity check        |
| `nexudus public vo directors list`       | List company directors         |
| `nexudus public vo directors add`        | Add a company director         |
| `nexudus public vo recipients list`      | List mail recipients           |
| `nexudus public vo recipients add`       | Add a mail recipient           |
| `nexudus public vo companyAliases list`  | List company aliases           |
| `nexudus public vo companyAliases add`   | Add a company alias            |

### Identity & Legal

| Command                                     | Description                   |
| ------------------------------------------- | ----------------------------- |
| `nexudus public identityChecks list`        | List your identity checks     |
| `nexudus public identityChecks get <id>`    | Get identity check details    |
| `nexudus public identityChecks upload <id>` | Upload identity documents     |
| `nexudus public legal status`               | Check terms acceptance status |
| `nexudus public legal accept`               | Accept terms and conditions   |

**Examples:**

```bash theme={null}
# Check if you've accepted terms
nexudus public legal status

# Accept general terms
nexudus public legal accept --general

# Accept both general and contract terms
nexudus public legal accept --all
```

### Forms & Surveys

| Command                                    | Description                |
| ------------------------------------------ | -------------------------- |
| `nexudus public form get <id>`             | Get a form page            |
| `nexudus public form preview <id>`         | Preview a form             |
| `nexudus public form submit <id>`          | Submit a form              |
| `nexudus public survey questionnaire <id>` | Get a survey questionnaire |
| `nexudus public survey preview <id>`       | Preview a survey           |
| `nexudus public survey submit <id>`        | Submit survey answers      |

### Onboarding & Data Files

| Command                                      | Description               |
| -------------------------------------------- | ------------------------- |
| `nexudus public onboarding get`              | Get onboarding actions    |
| `nexudus public dataFiles list`              | List your data files      |
| `nexudus public dataFiles getFileUrl <id>`   | Get file download URL     |
| `nexudus public dataFiles getSignedUrl <id>` | Get signed URL for a file |
| `nexudus public dataFiles eSignStatus <id>`  | Get e-signature status    |

### Payments

| Command                                                  | Description                      |
| -------------------------------------------------------- | -------------------------------- |
| `nexudus public payments stripe createCustomerSession`   | Create a Stripe payment session  |
| `nexudus public payments stripe createSetupSession`      | Create a Stripe setup session    |
| `nexudus public payments paypal createCustomerSession`   | Create a PayPal customer session |
| `nexudus public payments paypal createGuestSession`      | Create a PayPal guest session    |
| `nexudus public payments spreedly createCustomerSession` | Create a Spreedly session        |
| `nexudus public payments spreedly storePaymentMethod`    | Store a Spreedly payment method  |

## Response Shaping

Many public API endpoints support **response shaping** via the `--shape` option. This lets you request only the fields you need, reducing response size and improving performance.

```bash theme={null}
# Full response
nexudus public plans list

# Only specific fields
nexudus public plans list --shape "Name,Price,FromTime"

# Nested fields using dot notation
nexudus public businesses current --shape "Name,WebAddress,Country.Name,Currency.Code"
```

<Tip>
  Not all commands support `--shape`. It's available on commands that wrap endpoints with response shaping support (most list and get operations).
</Tip>

## Global Flags

All public API commands support the same global flags as admin commands:

| Flag                   | Description                                         |
| ---------------------- | --------------------------------------------------- |
| `--json`               | Output raw JSON (for scripting)                     |
| `--md`                 | Output as Markdown tables                           |
| `--agent`              | Output structured JSON envelope (for AI assistants) |
| `--web-address <addr>` | Override the location subdomain                     |

## Error Handling

### Common Errors

| Error                                | Cause                          | Solution                                    |
| ------------------------------------ | ------------------------------ | ------------------------------------------- |
| "Not logged in (public)"             | No public API token stored     | Run `nexudus public login`                  |
| "Unauthorized"                       | Token expired or invalid       | Run `nexudus public login` again            |
| "Two-factor authentication required" | 2FA is enabled on your account | Use `--totp` to provide your code           |
| "Account locked"                     | Too many failed login attempts | Wait and retry, or reset your password      |
| "Account disabled"                   | Account has been disabled      | Contact your space administrator            |
| "Must reset password"                | Password reset required        | Use "Forgot password" on the members portal |

## Next steps

<CardGroup cols={2}>
  <Card title="Install the CLI" icon="download" href="/cli/installation">
    Download and set up the Nexudus CLI on your machine.
  </Card>

  <Card title="Admin Commands" icon="shield" href="/cli/commands">
    Browse the full reference of admin CLI commands.
  </Card>
</CardGroup>
