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

# Sharing Faces

> Keep a face private, share it with named accounts, or publish it to everyone.

# Sharing Faces

A face you create is private: only you can use it. There are two ways to let other
people use it.

| state | who can use it |
| - | - |
| private (default) | you |
| **shared** | the accounts you name, and nobody else |
| **published** | every account on the platform |

Publishing is the broad switch. Sharing is the precise one. `published: true` overrides
sharing while it is on: a published face is available to everyone regardless of who it
is shared with.

Sharing and publishing take a [signed-in session](https://docs.headwaters.ai/authentication.md#what-needs-a-signed-in-session):
an API key answers `403`.

***

## Share with named accounts

```bash theme={null}
curl -X PATCH "https://api.faces.sh/v1/faces/alice/share" \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{"shared_with": ["dana", "sam"]}'
```

```json theme={null}
{ "alias": "alice", "shared_with": ["dana", "sam"], "handle": "you:alice" }
```

`dana` and `sam` can now use the face with the handle in the response.

> [!WARNING]
>
> **Send the complete list every time.** This replaces the whole set, it does not add to
> it. A name you leave out loses access the moment the request succeeds, and
> `{"shared_with": []}` revokes everyone.

Each entry is **an existing account's username or its email address**, and the two
may be mixed in one list. Email is a second way to find an account, not an
invitation; it must already belong to one. An unknown entry returns `404` and
says which one, and nothing is changed: a list with one bad entry applies none of
itself rather than half of itself. You cannot share a face with yourself (`400`).

Revoking is the same call without the name. Once the list is empty, `handle` comes back
`null`.

```bash theme={null}
# dana keeps access, sam loses it immediately
curl -X PATCH "https://api.faces.sh/v1/faces/alice/share" \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{"shared_with": ["dana"]}'
```

***

## What sharing does and does not give away

A shared face can be **asked** ([choices](https://docs.headwaters.ai/guides/choices.md), [chat](https://docs.headwaters.ai/guides/chat.md), [decisions](https://docs.headwaters.ai/guides/decisions.md)), and its card can be read: its name, description,
`basic_facts` and avatar, the same fields a [published face](https://docs.headwaters.ai/guides/faces.md#faces-you-do-not-own)
shows. The people you share with can also put it in a [group](https://docs.headwaters.ai/guides/groups.md) of their own.

They cannot read the documents you compiled into it, cannot compile
into it or change it, cannot share it onward, and never see its
[profile addendum](https://docs.headwaters.ai/guides/faces.md), which stays proprietary to you exactly as it does for
published faces.

**Billing is unchanged.** You pay to compile your face. Whoever asks it pays for
their own inference on their own account.

***

## Publish to everyone

```bash theme={null}
curl -X PATCH "https://api.faces.sh/v1/faces/alice/publish" \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{"published": true}'
```

```json theme={null}
{ "alias": "alice", "published": true, "handle": "you:alice" }
```

Any account can then use `you:alice`, and it appears in the published listing for
everyone. Unpublishing revokes that immediately, and returns `"handle": null`.

**Any face owner can publish.**

***

## Finding faces other people made available to you

`GET /v1/faces` returns only your own faces by default. Two independent flags widen it:

```bash theme={null}
# faces shared with you specifically
curl "https://api.faces.sh/v1/faces?include_shared=true" \
  -H "Authorization: Bearer YOUR_API_KEY"

# faces anyone has published
curl "https://api.faces.sh/v1/faces?include_published=true" \
  -H "Authorization: Bearer YOUR_API_KEY"

# both
curl "https://api.faces.sh/v1/faces?include_shared=true&include_published=true" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

They answer different questions and neither implies the other. `include_published` is
about what is open to everybody; `include_shared` is about what was made available to
**you**.

### `via`: how a shared face reached you

Items returned by `include_shared=true` carry a `via` field:

```json theme={null}
{
  "alias": "alice",
  "owned_by": "dana",
  "via": ["shared"]
}
```

`["shared"]` means the owner named your account directly.

Published faces do not carry `via`; they carry `published: true` instead.

***

## Asking a face someone shared

Name it as `@owner~alias` in `model`, exactly as a published face:

```bash theme={null}
curl -X POST "https://api.faces.sh/v1/choices" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "@dana~alice:maestro-1",
    "state": "A client wants the launch moved up a month.",
    "instructions": "What do you make of this?"
  }'
```

If access has been revoked, or was never granted, this returns `404`, the same response
a face that does not exist returns.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.