SSyncropel Docs

Invite another instance

Use `spl federation invite` to pair with another instance, share namespaces, and allow threads in one command.

What this is

spl federation invite <peer> does in one step what would otherwise take several commands:

  1. Establish a federation pair (or look up an existing one).
  2. Emit consent grants on the namespaces you want shared.
  3. Add threads to the pair's allowed list.
  4. Print a URL you can send to the recipient so they can find the pair from their side.

The common case is "let Bob see my code-review records". This command does it in one go. Use it for onboarding, demos and scripts. Use the separate commands (see the federation pair guide and the consent guide) when you need richer namespace mapping or thread-by-thread control.

Who this is for

  • Owners who want one command for "pair and share these namespaces".
  • Anyone writing onboarding scripts or demos.

If you're new to federation, read the federation pair guide first. invite builds on pairing, and fails in the same ways.

Prerequisites

  • Both instances are running and reachable.
  • Each has a cryptographic identity (spl identity show; if missing, spl identity generate).
  • The local instance has the destination URL or, if a pair already exists, the pair_id.

The headline command

spl federation invite https://bob.example.com \
    --grant-namespace code \
    --grant-thread th_review_inbox

This pairs with bob.example.com, grants cross-namespace consent on code, and allows the thread th_review_inbox on the pair. Output:

Invited did:sync:instance:bob-fedb12...

  Pair ID:                fed_<sha256-of-both-DIDs>
  Peer DID:               did:sync:instance:bob-fedb12...
  Peer URL:               https://bob.example.com
  Consent grants:         1
    - code                 cg_<id>
  Thread allows:          1
    - th_review_inbox

Send the recipient this URL so they can find the pair:
  https://bob.example.com/.well-known/syncropel

Next steps:
  spl federation show did:sync:instance:bob-fedb12...
  spl sync th_review_inbox from did:sync:instance:bob-fedb12...

To pair now and share later, leave out --grant-namespace and --grant-thread. If the pair already exists, the command skips pairing and goes straight to the grants.

Argument reference

<peer> (positional, required)

One of:

  • A URL: https://... or http://.... Pairing happens on first contact.
  • An existing pair_id (the pair_<hash> form). The command finds the pair, then adds the grants.

Bare handles (alice/code, bob) aren't supported as a peer and are rejected.

--grant-namespace <NS> (repeatable)

Emit one consent grant per namespace. Defaults to a same-name local-to-peer mapping at hash level L1 (records pass but with redacted bodies, and Consent management explains what each level shares). Repeat the flag for multiple namespaces:

spl federation invite https://bob.example.com \
    --grant-namespace code \
    --grant-namespace docs \
    --grant-namespace research

For richer namespace mapping (for example, your local code mapped to Bob's engineering), use the discrete spl federation grant form directly.

--grant-thread <TH> (repeatable)

Add a thread to the pair's allowed list. Thread IDs must start with th_; bare names are rejected.

spl federation invite https://bob.example.com \
    --grant-thread th_review_inbox \
    --grant-thread th_review_active \
    --grant-thread th_review_done

--map <local:peer> (repeatable)

Used when creating a new pair, and ignored if the pair already exists. Use it to propose namespace mappings up front:

spl federation invite https://bob.example.com \
    --map code:engineering \
    --grant-namespace code

--auto-approve

Accepted but has no effect. The peer's own approval step decides, and the inviting side cannot skip it.

--auto-generate-identity

Create a local identity if you don't have one. Useful in first-run scripts.

--no-strict

Skip the check that the peer's manifest has not expired.

-o json

Emit a structured JSON object instead of the human-readable summary:

{
  "status": "invited",
  "pair_id": "fed_...",
  "peer_did": "did:sync:instance:...",
  "peer_base_url": "https://bob.example.com",
  "grants": [
    { "namespace": "code", "grant_id": "cg_..." }
  ],
  "thread_allows": [
    { "thread": "th_review_inbox", "record_id": "..." }
  ],
  "recipient_manifest_url": "https://bob.example.com/.well-known/syncropel",
  "auto_approve_requested": false
}

Use cases

The minimal call: pair only. Useful when you want to decide what to share later:

spl federation invite https://bob.example.com

You can run spl federation grant later to open specific namespaces once you've decided which to share.

Onboard a code-review partner

Three threads + one namespace, one command:

spl federation invite https://bob.example.com \
    --grant-namespace code \
    --grant-thread th_review_inbox \
    --grant-thread th_review_active \
    --grant-thread th_review_done

Works well with the code-review-pair workspace template. See the code-review-pair walkthrough for the full two-person flow.

Re-grant against an existing pair

If you've already paired but want to add more namespaces or threads later, pass the pair_id instead of a URL:

spl federation invite pair_<hash> \
    --grant-namespace docs \
    --grant-thread th_documentation_drafts

Pairing is skipped and only the grants are added.

Scripted onboarding

Use -o json and a tool like jq to script:

RESPONSE=$(spl federation invite https://bob.example.com \
    --grant-namespace code -o json)
PAIR_ID=$(echo "$RESPONSE" | jq -r .pair_id)
RECIPIENT_URL=$(echo "$RESPONSE" | jq -r .recipient_manifest_url)
echo "Forward this to the recipient: $RECIPIENT_URL"

Failure modes

  • Peer unreachable: you see the same error as spl federation pair. Run curl https://bob.example.com/.well-known/syncropel manually to verify reachability.
  • Peer manifest expired: this fails by default. Pass --no-strict if you trust the peer, or try again after the peer refreshes its manifest.
  • Thread without th_ prefix: --grant-thread foo is rejected. Use the full thread ID, which starts with th_.
  • Bare handle as peer: spl federation invite alice/code is rejected. Use a URL or an existing pair_id.

If a step fails partway through, earlier steps are NOT undone. The pair stays in place and any grants already made are listed in the audit log. Run the command again; it is safe to repeat.

See also

On this page