---
title: "Send to a shared build's own app - a form, a sign-in or a call to its API"
url: https://xovris.ai/docs/api/operations/postcodesharedbytokenpreviewbypath/
---

# Send to a shared build's own app - a form, a sign-in or a call to its API

`POST /v1/code/shared/{token}/preview/{path}`

Open to anyone, so no Idempotency-Key is kept: nobody is signed in to keep it for, and replaying one caller's answer to another would hand it over.

No token needed: anyone may call this.

## Parameters

- `token` (string, path, required)
- `path` (string, path, required)

## Request body

### `application/json`

One of:
- A new account on the app - {path} ending __xovris/api/auth/signup
  - `email` (string, required)
  - `password` (string, required): Kept only as a salted hash.
- A sign-in to the app - {path} ending __xovris/api/auth/signin
  - `email` (string, required)
  - `password` (string, required)
- A sign-out of the app - {path} ending __xovris/api/auth/signout: No body: the session ended is the one in the Authorization header (Bearer xas_...).
- A new row in one of the app's tables - {path} ending __xovris/api/data/{table}: The row's fields, as the app's xovris.app.json declares that table's fields (GET __xovris/api/manifest lists each table with its fields); a field the table does not declare, or a value of the wrong type, is refused with the reason.
- A change to a row its caller added - {path} ending __xovris/api/data/{table}/{id}: The fields to change, as the table declares them; the fields not sent keep their values. Only the person who added the row changes it.
- A file the app keeps - {path} ending __xovris/api/files
  - `data` (string, required): The file's contents.
  - `name` (string)
  - `type` (string): Its media type, such as image/png; application/octet-stream when not said.
- A Stripe Checkout for one of the app's products - {path} ending __xovris/api/pay/checkout
  - `product` (string, required): A product id the manifest lists.
  - `quantity` (integer)
  - `back` (string): The page to come back to after paying.
- Stripe's own event about a payment - {path} ending __xovris/api/pay/webhook: Sent by Stripe and believed only with a Stripe-Signature header made with this app's STRIPE_WEBHOOK_SECRET.
  - `type` (string, required): checkout.session.completed and checkout.session.async_payment_succeeded are recorded.
  - `data` (object, required)
- A real charge in Stripe's test mode (the preview only) - {path} ending __xovris/api/pay/test-charge
  - `product` (string): A product id the manifest lists; its first product when not said.
- A question to the app's AI - {path} ending __xovris/api/ai
  - `prompt` (string, required)
- A conversation with the app's assistant - {path} ending __xovris/api/chat
  - `messages` (object[], required): The conversation so far, the newest last.
- The app's MCP server (JSON-RPC 2.0) - {path} ending __xovris/api/mcp
  - `jsonrpc` (required)
  - `id` (string | number | null)
  - `method` (string, required): initialize, tools/list, tools/call or a notification.
  - `params` (object)
- An assistant registering itself to sign a person in (OAuth dynamic client registration) - {path} ending __xovris/api/oauth/register
  - `redirect_uris` (string[], required): Each an https address, or http on the person's own computer
  - `client_name` (string)
- One page view, from the page's own beacon (no cookie) - {path} ending __xovris/api/hit
  - `p` (string): The page's path and query.
  - `r` (string): The page that linked here, when the browser says.

Example:

```json
{
  "email": "hello@example.com",
  "password": "example"
}
```

### `application/x-www-form-urlencoded`

One of:
- A person signing in here for an assistant (the sign-in form, sent as a form) - {path} ending __xovris/api/oauth/authorize
  - `response_type` (required)
  - `client_id` (string, required)
  - `redirect_uri` (string, required)
  - `state` (string)
  - `code_challenge` (string, required)
  - `code_challenge_method` (required)
  - `email` (string, required)
  - `password` (string, required)
- An assistant trading its sign-in code for the person's session (sent as a form) - {path} ending __xovris/api/oauth/token
  - `grant_type` (required)
  - `code` (string, required)
  - `code_verifier` (string, required)
  - `redirect_uri` (string, required)
  - `client_id` (string, required)

Example:

```json
{
  "response_type": {},
  "client_id": "example",
  "redirect_uri": "example",
  "state": "example",
  "code_challenge": "example",
  "code_challenge_method": {},
  "email": "hello@example.com",
  "password": "example"
}
```

### `text/plain`

One of:
- One page view, from the page's own beacon (no cookie) - {path} ending __xovris/api/hit
  - `p` (string): The page's path and query.
  - `r` (string): The page that linked here, when the browser says.

Example:

```json
{
  "p": "example",
  "r": "example"
}
```

## Answers

- `200`: Done. (application/json: Tf44704dff116)
- `201`: Done: something new was made, and the answer is it. (application/json: object)
- `202`: Started: the answer says where to follow it. (application/json: object)
- `404`: Nothing with that id here, or it belongs to another workspace. Nothing was changed. (application/json: Problem)
- `default`: Any other refusal or failure. The answer says what happened and what to do next. (application/json: Problem)

## A call

The address is https://api.xovris.ai/v1/code/shared/{token}/preview/{path} - put your own value in place of each part in braces.

```sh
curl --request POST \
  --url 'https://api.xovris.ai/v1/code/shared/{token}/preview/{path}' \
  --header 'Content-Type: application/json' \
  --data '{"email":"hello@example.com","password":"example"}'
```
