Vaults

A vault is a shared space in your organization: its members share memory, rules, and files. Create one, manage members, and chat inside it.

A vault is a container inside your organization that a set of members share. It holds memory that chat can recall, its own standing rules, and files. A chat request names the vault it is happening inside with vault_id. Access is by membership: administering an organization does not, by itself, let you read a vault you are not a member of.

Create a vault

POST /api/v1/vaults creates a vault. Only name is required, and names are unique within an organization. You become the owner, and a member with read, write, and share.

curl https://api.cruxy.ai/api/v1/vaults \
  -H "Authorization: Bearer $CRUXY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Platform team",
    "description": "Shared context for the platform team",
    "external_id": "app-vault-8f2c"
  }'

Send external_id, your own system's identifier for the vault, whenever a retry is possible. A second create naming an external_id your organization has already seen returns the existing vault with 200 and created: false, and writes nothing. Without it, a retry after a timeout hits 409 vault_name_exists, which carries no vault id. Reusing an external_id that names a vault somebody else owns is 409 vault_external_id_conflict.

The optional fields:

FieldMeaning
descriptionFree text, at most 2000 characters.
icon, colorPresentation, each from a fixed vocabulary that API Reference lists. An unknown value is 400 invalid_request.
memory_scopedefault or vault_only; see Chat inside a vault.
external_idYour identifier for the vault, which makes the create idempotent.

PATCH /api/v1/vaults/{id} changes name, description, icon, color, or memory_scope, and requires can_write. GET /api/v1/vaults/{id} reads one vault, and GET /api/v1/vaults lists the vaults you can use, with two filters: scope (all, owned, or shared) and archived.

Permissions

Every vault read carries a permissions block with your own four flags:

FlagWhat it allows
can_readRead the vault's content.
can_writeChange the vault's content and metadata, and archive it.
can_shareAdd and remove members, granting only permissions you hold yourself.
can_administerDelete the vault, and hold or restore its members. It is true for the vault's owner and for an admin of its organization.

The four do not imply one another: a member with read, write, and share does not administer the vault. Each flag is resolved from the same check that gates the matching request, so you can show or hide controls from this block alone. Treat an absent can_administer as false.

A vault you cannot read answers 404 vault_not_found, whether it is in another organization, you are not a member, or you are held. A member who is refused an action they lack the flag for gets 403 vault_forbidden.

Members

POST /api/v1/vaults/{id}/members adds a member of your organization with the permissions you name. All four fields are required.

curl https://api.cruxy.ai/api/v1/vaults/$VAULT_ID/members \
  -H "Authorization: Bearer $CRUXY_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"user_id\": \"$USER_ID\",
    \"can_read\": true,
    \"can_write\": true,
    \"can_share\": false
  }"
  • Who may add. The vault's owner and organization admins may grant anything. A member with can_share may grant only permissions they hold: a member who cannot write cannot create a member who can.
  • Errors. A user outside your organization is 404 user_not_found, and one who is already a member is 409 vault_member_exists.
  • List. GET /api/v1/vaults/{id}/members lists the members with their permissions, held members included.
  • Change. PATCH /api/v1/vaults/{id}/members/{user_id} changes a member's read, write, and share flags; omitted fields keep their value. The rule against granting more than you hold applies to the resulting set of permissions.
  • Remove. DELETE /api/v1/vaults/{id}/members/{user_id} removes a member, and their access ends immediately. The owner cannot be removed, and nobody can modify the owner's membership; delete the vault instead.

Hold a member

A hold suspends a member without changing their permissions. PUT /api/v1/vaults/{id}/members/{user_id}/held with {"held": true} makes the member's read, write, and share inert, and the vault reads to them as if it did not exist. {"held": false} restores exactly the permissions they had.

curl -X PUT https://api.cruxy.ai/api/v1/vaults/$VAULT_ID/members/$USER_ID/held \
  -H "Authorization: Bearer $CRUXY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "held": true }'

Only the vault's owner or an organization admin may set or clear a hold, which is what can_administer reports; can_share does not allow it. The owner cannot be held.

Archive and pin

  • Archive. PUT /api/v1/vaults/{id}/archive hides the vault from the default list; it appears only with archived=true, and reads report archived: true. The vault and all its memory are untouched. DELETE /api/v1/vaults/{id}/archive restores it. Both require can_write, are idempotent, and answer 204.
  • Pin. PUT /api/v1/vaults/{id}/pin pins the vault for you alone: a personal bookmark, reported as pinned on your reads of the vault and never visible to other members. DELETE /api/v1/vaults/{id}/pin removes it. Both need only that you can read the vault, are idempotent, and answer 204.
  • Delete. DELETE /api/v1/vaults/{id} deletes the vault, its membership list, and all memory stored in it. It requires can_administer.

Files in a vault

A vault holds files for every member who can read it.

  • POST /api/v1/vaults/{id}/files uploads a file into the vault. It is the same multipart upload as POST /api/v1/files, with the same detection, document reading, and limits; see Files. It requires can_write, and purpose=chat_attachment is refused.
  • POST /api/v1/vaults/{id}/files/share copies one of your own files into the vault, named by file_id, as a new vault file with its own id. The original stays yours and unchanged, and deleting either one never touches the other. The copy counts against your storage pool and spends no monthly upload allowance.
  • GET /api/v1/vaults/{id}/files lists the vault's files, newest first, paged like GET /api/v1/files. GET /api/v1/vaults/{id}/files/{file_id} reads one, and GET /api/v1/vaults/{id}/files/{file_id}/content downloads its bytes. All three require can_read.
  • DELETE /api/v1/vaults/{id}/files/{file_id} deletes a vault file for every member. Any member with can_write may delete any file in the vault, not only their own.
# Upload a file straight into the vault.
curl https://api.cruxy.ai/api/v1/vaults/$VAULT_ID/files \
  -H "Authorization: Bearer $CRUXY_API_KEY" \
  -F "[email protected]"
 
# Or copy in a file you already uploaded.
curl https://api.cruxy.ai/api/v1/vaults/$VAULT_ID/files/share \
  -H "Authorization: Bearer $CRUXY_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{ \"file_id\": \"$FILE_ID\" }"

A vault file carries the fields of any file, plus vault_id, uploaded_by (the user who uploaded or shared it, kept after they leave), shared_with (how many members can read the vault), and retention_until. A vault file has no expires_at: it is deleted at retention_until, 365 days from its last use. An upload, a share, and a download each count as a use; reading metadata does not.

Chat inside a vault

Send vault_id on POST /api/v1/chat to say which vault the chat is happening inside. It changes two things for the turn:

  • Memory. Which stored memories recall may draw on. With no vault, that is your personal memory, your organization's, and every vault you can read whose memory_scope is default. Inside a vault_only vault, recall draws on that vault's memory alone, and its memory is withheld everywhere outside it. See Memory.
  • Rules. Which standing rules apply: the vault's own ruleset, merged with the organization's when the vault inherits them. See Standing rules.

A user message can also attach a file the vault holds, by naming its id in file_ids like any other file. The gateway reads a vault file only while you are a member who reads that vault and is not held.

curl https://api.cruxy.ai/api/v1/chat \
  -H "Authorization: Bearer $CRUXY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Cruxy-Version: 2026-10-05" \
  -d "{
    \"model\": \"saga\",
    \"stream\": false,
    \"vault_id\": \"$VAULT_ID\",
    \"messages\": [
      {
        \"role\": \"user\",
        \"content\": \"What does the handbook say about on-call handover?\",
        \"file_ids\": [\"$FILE_ID\"]
      }
    ]
  }"

A vault_id you cannot read is not an error and is never reported: the turn runs exactly as if you had sent none, so a chat request cannot be used to discover whether a vault id is real. Sending a vault id grants no access you do not already have.

mentioned_vault_ids is different from vault_id. It names up to three vaults the turn references without being inside them, and adds their memory to the turn's recall. It changes nothing about isolation and never makes a vault writable.

Next steps

  • Memory: what recall and capture do inside a vault.
  • Standing rules: give a vault its own rules.
  • Files: upload files and attach them to a chat turn.
  • Conversations: hold a conversation inside a vault.

Was this page helpful?