---
title: "Sync custom keys to cloud vault"
method: POST
path: "/v1/cloud/vault/sync"
tags: ["v1", "Cloud Infrastructure"]
---

# Sync custom keys to cloud vault

`POST /v1/cloud/vault/sync`

## Request

- Base URL: `https://memory.papr.ai`
- URL: `https://memory.papr.ai/v1/cloud/vault/sync`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

## Request body

- VaultSyncRequest
  - `external_user_id` string, nullable: Parse _User.objectId of the acting user (desktop OAuth). Used for ownership-scoped cloud operations instead of the API key user.
  - `scope` 'user' | 'namespace' | 'org' | 'all': Three-level ACL scope matching the memory ACL model.
  - `namespace_id` string, nullable
  - `keys` VaultKeyEntry[], required
    - `name` string, required: Key name (e.g. NEON_DB_URL)
    - `value` string, required: Secret value
    - `source` string, nullable: Key origin: oauth | manual | apiKey (stored as secret label papr-source)
    - `clientAccess` string, nullable: server = backend/jobs only; client = publishable in mini-app browser
    - `shareScope` 'user' | 'namespace' | 'org' | 'members': Per-key sharing scope — mirrors paprwork desktop Audience + org scope.
    - `targetOrgId` string, nullable: Override org for storage when desktop selects a specific organization
    - `permission` string, nullable: Job usage permission: always_allow (default) | ask | ask_once_per_job (stored as label)
    - `penAccess` string, nullable: What Pen may do with this service's tools: read | ask | full. Capped by the org's maxPenAccess.
    - `allowedUserIds` string[], nullable: Parse user IDs allowed to use a members-scoped key

## Response `200`

Successful Response

- VaultSyncResponse
  - `synced` integer, required
  - `created` string[]
  - `updated` string[]
  - `unchanged` string[]
  - `deleted` string[]
  - `conflicts` VaultShareConflict[]
    - `name` string, required
    - `reason` string
    - `ownerUserId` string, nullable
    - `shareScope` 'user' | 'namespace' | 'org' | 'members': Per-key sharing scope — mirrors paprwork desktop Audience + org scope.
    - `maxShare` string, nullable
    - `maxPenAccess` string, nullable

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-16** `0e7a5c0d125d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/papr-ai/apis/papr-memory-api/changes/v1/cloud/vault/sync/post.md)

---

[API](https://skmtc.dev/papr-ai/apis/papr-memory-api.md) - [All operations](https://skmtc.dev/papr-ai/apis/papr-memory-api/llms.txt) - [OpenAPI document](https://skmtc.dev/papr-ai/apis/papr-memory-api/revisions/6fc381dc78b3?raw)
