Skip to main content

Sharing

Share memory spaces with other Novyx tenants using secure, token-based invitations. Grant read or write access, rotate tokens, and revoke access at any time.

Base URL: https://novyx-ram-api.fly.dev

Tier: Starter+


Share Space

POST /v1/spaces/share

Create a share invitation for a memory space. Sends a token the recipient can use to join.

Request body

ParameterTypeRequiredDefaultDescription
tagstringYesTag or space to share (1–50 characters)
emailstringYesRecipient's email address
permissionstringNo"read"Access level: read or write

Response fields

FieldTypeDescription
tokenstringShare token for the recipient
share_urlstringFull invitation URL
tagstringShared tag/space
shared_with_emailstringRecipient email
permissionstringAccess level
expires_atstring | nullToken expiry (ISO 8601)
messagestringConfirmation message

Examples

from novyx import Novyx

nx = Novyx(api_key="nram_your_key")

share = nx.share_space(
tag="customer-support",
email="alice@example.com",
permission="write",
)
print(share["share_url"])

Response

{
"token": "shr_x1y2z3a4b5c6",
"share_url": "https://novyxlabs.com/join?token=shr_x1y2z3a4b5c6",
"tag": "customer-support",
"shared_with_email": "alice@example.com",
"permission": "write",
"expires_at": null,
"message": "Space shared successfully"
}

Errors

StatusCodeCause
400VALIDATION_ERRORInvalid tag or email
403FEATURE_NOT_AVAILABLERequires Starter+ plan

List Shared Spaces

GET /v1/spaces/shared

List spaces you've shared and spaces shared with you.

Response fields

FieldTypeDescription
shared_by_mearraySpaces you've shared (owner view)
shared_with_mearraySpaces shared to you

Each entry includes:

FieldTypeDescription
tokenstringShare token
tagstringShared tag/space
permissionstringread or write
owner_tenant_idstringOwner's tenant ID
shared_with_emailstringRecipient email
acceptedbooleanWhether the invitation was accepted
accepted_by_tenantstring | nullAccepting tenant ID
created_atstringISO 8601 timestamp
expires_atstring | nullToken expiry

Examples

result = nx.list_shared()
for share in result["shared_by_me"]:
status = "accepted" if share["accepted"] else "pending"
print(f"{share['tag']}{share['shared_with_email']} ({status})")

Preview Share Token

GET /v1/spaces/token/{token}

Preview a share invitation before accepting it. No authentication required.

Path parameters

ParameterTypeDescription
tokenstringShare token

Response fields

FieldTypeDescription
validbooleanWhether the token is valid
owner_tenant_idstringOwner's tenant ID (if valid)
tagstringShared space (if valid)
permissionstringAccess level (if valid)
already_acceptedbooleanWhether already accepted
expires_atstring | nullToken expiry
errorstring | nullError message (if invalid)

Examples

info = nx.preview_share("shr_x1y2z3a4b5c6")
if info["valid"]:
print(f"Space: {info['tag']} ({info['permission']} access)")

Accept Share

POST /v1/spaces/join

Accept a share invitation and gain access to the shared space.

Request body

ParameterTypeRequiredDescription
tokenstringYesShare token from the invitation

Response fields

FieldTypeDescription
successbooleanWhether join succeeded
tagstringShared space
owner_tenant_idstringOwner's tenant ID
permissionstringGranted access level
expires_atstring | nullAccess expiry
messagestringConfirmation message

Examples

result = nx.join_space(token="shr_x1y2z3a4b5c6")
print(f"Joined {result['tag']} with {result['permission']} access")

Errors

StatusCodeCause
400INVALID_TOKENToken expired or invalid
403FEATURE_NOT_AVAILABLERequires Starter+ plan

Rotate Share Token

POST /v1/spaces/share/{token}/rotate

Generate a new token for an existing share, invalidating the old one. Owner only.

Path parameters

ParameterTypeDescription
tokenstringCurrent share token

Response fields

Same as Share Space with the new token.

Examples

result = nx.rotate_share("shr_x1y2z3a4b5c6")
print(f"New token: {result['token']}")

Errors

StatusCodeCause
403FORBIDDENNot the share owner
404NOT_FOUNDToken does not exist

Revoke Share

DELETE /v1/spaces/share/{token}

Revoke a share invitation and remove the recipient's access. Owner only.

Path parameters

ParameterTypeDescription
tokenstringShare token to revoke

Examples

nx.revoke_share("shr_x1y2z3a4b5c6")

Response

Returns 204 No Content on success.

Errors

StatusCodeCause
403FORBIDDENNot the share owner
404NOT_FOUNDToken does not exist