PrivMX Bridge API
This documentation provides a comprehensive guidance for using PrivMX Bridge API. PrivMX Bridge is a secure, zero-knowledge server for encrypted data storage and communication. It allows users to communicate and exchange data in a fully encrypted environment, ensuring end-to-end encryption and protecting data privacy at every step. Client software for PrivMX Bridge is PrivMX Endpoint, which handles the encryption. Learn more about how PrivMX works with our docs.
Introduction
We use the JSON-rpc protocol to call API methods.
Below is an example cURL command for querying the API to list Solutions:
curl -X POST -H "Content-Type: application/json" \
-H "Authorization: one-of-our-authorization-methods" \
--data-binary '{
"jsonrpc": "2.0",
"id": 0,
"method": "solution/listSolutions",
"params": {}
}' \
https://my-privmx-bridge-instance/api
Authorization
API Keys
You can access the API methods using API Keys. These keys have no time-to-live (TTL) but can be disabled or deleted. Each key is assigned a specific scope. You can create up to 10 API Keys by calling the method manager/createApiKey.
NOTICE: When you install PrivMX Bridge, you should receive your first API Key during the installation, and it should have full API access.
An API Key can be created without public key:
curl -X POST -H "Content-Type: application/json" \
-H "Authorization: one-of-our-authorization-methods" \
--data-binary '{
"jsonrpc": "2.0",
"id": 0,
"method": "manager/createApiKey",
"params": {
"name": "My ApiKey",
"scope": ["apikey", "context", "solution"],
}
}' \
https://my-privmx-bridge-instance/api
Or with an ED25519 PEM-encoded public key:
curl -X POST -H "Content-Type: application/json" \
-H "Authorization: one-of-our-authorization-methods" \
--data-binary '{
"jsonrpc": "2.0",
"id": 0,
"method": "manager/createApiKey",
"params": {
"name": "My ApiKey",
"scope": ["apikey", "context", "solution"],
"publicKey": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEADsSTjY2wnm1iwWamIWwLTPVhtTIb8TVlI8tts3wkhkQ=\n-----END PUBLIC KEY-----",
}
}' \
https://my-privmx-bridge-instance/api
You will receive an id
and secret
of API Key:
{
"jsonrpc":"2.0",
"id":0,
"result": {
"id": "hysd62jsd7823nasd03",
"secret": "759a1d8edba555badf1216b0f381b94950141"
}
}
You can now authorize requests using your API Key in one of the following ways:
Signatures
You can sign your request using your API Key.
First, prepare the data to be signed:
apiKeyId = "6XMc4VMf3q54YNarSn9CWUn4htStNu1ry9ajamemdo23sS1y21";
requestPayload = '{"jsonrpc":"2.0","id":0,"method":"solution/listSolutions","params":{}}';
requestData = `POST\n/api\n${requestPayload}\n`; // UPPERCASE(HTTP_METHOD()) + "\n" + URI() + "\n" + RequestBody + "\n";
timestamp = 1702555410352;
nonce = "3xUee4EA0gr8dg==";
dataToSign = `${timestamp};${nonce};${requestData}`;
Next, generate a signature corresponding to your API Key credentials:
HMAC signature
apiKeySecret = "CspXxVtTyE3sf6jB7z4CSjxoymuS2H67ZjNDfovTu3i8";
signature = BASE64(HMACSHA256(apiKeySecret, dataToSign).SUBARRAY(0, 20))
ECC signature, if you provided a publicKey
:
privateKey = "-----BEGIN PRIVATE KEY-----\nMC4CAQAwBQYDK2VwBCIEIOBVFGaSFtfqbNvZWctFKg3k+I0T5YXRavpKAD9+BgCX\n-----END PRIVATE KEY-----";
signature = BASE64(SIGN(dataToSign, privateKey))
To sign a request, include the following in the Authorization
header:
"pmx-hmac-sha256 ${apiKeyId};1;${timestamp};${nonce};${signature}"
curl -X POST -H "Content-Type: application/json" \
-H "Authorization: pmx-hmac-sha256 6XMc4VMf3q54YNarSn9CWUn4htStNu1ry9ajamemdo23sS1y21;1;1702555410352;3xUee4EA0gr8dg;JN5llLladWZ+1rGu6yrkbIQzme0=" \
--data-binary '{
"jsonrpc": "2.0",
"id": 0,
"method": "solution/listSolutions",
"params": {}
}' \
https://my-privmx-bridge-instance/api
API Key Credentials
You can authorize the request by placing your API Key credentials in the Authorization
header:
basicAuthorization = BASE64(`${apiKeyId}:${apiKeySecret}`);
authorizationHeaderValue = `Basic ${basicAuthorization}`;
curl -X POST -H "Content-Type: application/json" \
-H "Authorization: Basic YWxpY2U6dGhlc2NlcmV0" \
--data-binary '{
"jsonrpc": "2.0",
"id": 0,
"method": "solution/listSolutions",
"params": {}
}' \
https://my-privmx-bridge-instance/api
Note that you cannot use this authorization method if your API Key includes a public key. In such a case, only ECC signatures are available for this API Key.
Access Tokens
Access Tokens have a TTL but can be refreshed using refresh tokens. You can generate them by calling manager/auth:
curl -X POST \
-H "Content-Type: application/json" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "manager/auth",
"params": {
"scope": ["apikey", "solution"],
"grantType": "api_key_credentials",
"apiKeyId": "65ad8f6b2e4f4f1adb40bf68",
"apiKeySecret": "5ZTUQ7VBxoqRKn3pEyPjHeavXHVw7JcJF3MvAV43yfsR"
}
}' \
https://my-privmx-bridge-instance/api
You will receive an access_token
and a refresh_token
:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"accessToken": "SXRzIGEgcmFuZG9tIHRleHQgZW5jb2RlZCBmb3IgdGhlIHRlc3RpbmcgcHVycG9zZSwgaWYgeW91IGRlY29kZWQgdGhpcyB0ZXh0LCB0cmVhdCBpcyBhcyBhIHNvcnQgb2YgZWFzdGVyIGVnZyA6KS4=",
"accessTokenExpiry": 1726652150623,
"refreshToken": "TG9yZW0gaXBzdW1Mb3JlbSBpcHN1bUxvcmVtIGlwc3VtTG9yZW0gaXBzdW1Mb3JlbSBpcHN1bUxvcmVtIGlwc3VtTG9yZW0gaXBzdW0=",
"refreshTokenExpiry": 1726952150623,
"tokenType": "Bearer",
"scope": [
"apiKey",
"solution",
"context"
]
}
}
The Access Token can be used to authorize your request by placing it in the Authorization
header:
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer SXRzIGEgcmFuZG9tIHRleHQgZW5jb2RlZCBmb3IgdGhlIHRlc3RpbmcgcHVycG9zZSwgaWYgeW91IGRlY29kZWQgdGhpcyB0ZXh0LCB0cmVhdCBpcyBhcyBhIHNvcnQgb2YgZWFzdGVyIGVnZyA6KS4=" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "solution/listSolutions",
"params": {}
}' \
https://my-privmx-bridge-instance/api
Access Tokens can be refreshed using refresh tokens by calling the manager/auth method:
curl -X POST \
-H "Content-Type: application/json" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "manager/auth",
"params": {
"grantType": "refresh_token",
"refreshToken": "TG9yZW0gaXBzdW1Mb3JlbSBpcHN1bUxvcmVtIGlwc3VtTG9yZW0gaXBzdW0=",
}
}' \
https://my-privmx-bridge-instance/api
In response, you will receive a new pair of tokens, and the old pair will be revoked.
API Scopes
When requesting an Access Token, you can specify the scope, which defines the level of access granted. Here's a breakdown of the available scopes:
Scope | Description |
---|---|
session:NAME | Creates a new session with the provided name, generating tokens bound to that session. Access is granted for the session's lifetime. A user can have up to 16 sessions; when this limit is reached, the oldest session is removed. |
ipAddr:ADDR | Restricts the token to connections from a specific IPv4 address (ADDR). |
expiresIn:NUMBER | Access Token will expire after NUMBER of milliseconds. Max value is refresh token TTL. |
apiKey | Restricts the token to manager api scope. |
solution | Restricts the token to solution api scope. |
context | Restricts the token to context api scope. |
thread | Restricts the token to thread api scope. |
store | Restricts the token to store api scope. |
inbox | Restricts the token to inbox api scope. |
stream | Restricts the token to stream api scope. |
solution:SOLUTION_ID | Restricts the token to manage contexts only under given SOLUTION_ID. |
solution:* | Restricts the token to manage all contexts. |
These scopes allow fine-grained control over what actions can be performed with the generated tokens, making it easier to manage permissions across different parts of the system.
Metrics Documentation
Overview
The application provides a /metrics
endpoint that returns various metrics in a format compatible with Prometheus. The endpoint is protected by HTTP Basic Authorization for security.
Metrics Endpoint
- Endpoint:
/metrics
- Access Control: Requires HTTP Basic Authorization
- Scrape Interval: 1 minute (data older than 1 minute is discarded)
- Bucket Clearing: After each metric collection via the
/metrics
endpoint, the internal metrics bucket is cleared. This enables the endpoint to support scrape intervals shorter than 1 minute, if desired.
Metrics Collected
The following metrics are available from the /metrics
endpoint:
- privmx_bridge_error_gauge
- Type: Gauge
- Description: Tracks the number of errors.
- privmx_bridge_cpu_execution_time_gauge
- Type: Gauge
- Description: Measures the CPU time taken for executions.
- privmx_bridge_in_traffic_gauge
- Type: Gauge
- Description: Records incoming traffic volume in bytes.
- privmx_bridge_out_traffic_gauge
- Type: Gauge
- Description: Records outgoing traffic volume in bytes.
- privmx_bridge_request_gauge
- Type: Gauge
- Description: Counts the number of requests.
Each of these metrics is exposed with the # TYPE <metric_name> gauge
format.
Introduction to ACL
An ACL (Access Control List) is a set of rules that determines which functions a user can access. It consists of simple instructions using the terms "ALLOW" or "DENY" followed by the name of a function or group. By default, an ACL is set to "DENY ALL." Instructions are executed in the order they are listed. If group scopes overlap, the second instruction will override the overlapping portion.
ALLOW store/READ
ALLOW store/storeFileCreate
ALLOW thread/ALL
DENY thread/deleteThread
DENY thread/deleteMessage
DENY thread/deleteManyMessages
DENY thread/deleteMessagesOlderThan
The example above allows the user to browse Stores, create files, and use Threads, but excludes the ability to delete Threads or messages.
Explanation and breakdown of the example:
ALLOW store/READ => Grants access to all methods in the store/READ group
ALLOW store/storeFileCreate => Grants access to the storeFileCreate method
ALLOW thread/ALL => Grants access to all methods in the thread group
DENY thread/deleteThread => Revokes access to the thread/deleteThread method, other thread methods remain unchanged
DENY thread/deleteMessage => Revokes access to the thread/deleteMessage method, other thread methods remain unchanged
DENY thread/deleteManyMessages => Revokes access to the thread/deleteManyMessages method, other thread methods remain unchanged
DENY thread/deleteMessagesOlderThan => Revokes access to the thread/deleteMessagesOlderThan method, other thread methods remain unchanged
It's also possible to bind an ACL rule to a specific object by using function arguments:
[DIRECTIVE] [scope/method] [parameter]=[argument]
Example:
ALLOW store/storeFileWrite storeId=65ad8f6c2e4f4f1adb40bf81
Check all ACL groups here.
Api errors
Every API request can return any of the common errors, which are only specified in Error Codes section not to duplicate them in every method description.
Methods
Context
context/addSolutionToContext
Creates connection between context and solution
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "context/addSolutionToContext",
"params": {
"contextId": "65fd820f0758a54a68558d7c",
"solutionId": "65ad8f6c2e4f4f1adb40bf81"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "context/addSolutionToContext",
"params": {
"contextId": "65fd820f0758a54a68558d7c",
"solutionId": "65ad8f6c2e4f4f1adb40bf81"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": "OK"
}
Parameter | Type | Enum | Description |
---|---|---|---|
contextId | string | context's id (length in [1,128]) | |
solutionId | string | solution's id (length in [1,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | string | OK | "OK" |
Additional errors
Error Code | Message |
---|---|
24854 | Context does not exist |
24880 | Solution does not exist |
24883 | Cannot assign private context |
context/addUserToContext
Add user to context with given id
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "context/addUserToContext",
"params": {
"contextId": "65fd820f0758a54a68558d7c",
"userId": "Josh",
"userPubKey": "64dGCs7myoFrZDnP5pgvmBNKF1za22b5iBQaEpeBcGWiTUCA3c"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "context/addUserToContext",
"params": {
"contextId": "65fd820f0758a54a68558d7c",
"userId": "Josh",
"userPubKey": "64dGCs7myoFrZDnP5pgvmBNKF1za22b5iBQaEpeBcGWiTUCA3c"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": "OK"
}
Parameter | Type | Enum | Description |
---|---|---|---|
contextId | string | context's id (length in [1,128]) | |
userId | string | user's id (length in [1,128]) | |
userPubKey | string | context user's public key | |
acl | string | (optional) user acl (length in [0,4096]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | string | OK | "OK" |
Additional errors
Error Code | Message |
---|---|
24854 | Context does not exist |
context/createContext
Creates new application context with given options
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "context/createContext",
"params": {
"solution": "65ad8f6c2e4f4f1adb40bf81",
"name": "some-context",
"description": "some-description",
"scope": "private"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "context/createContext",
"params": {
"solution": "65ad8f6c2e4f4f1adb40bf81",
"name": "some-context",
"description": "some-description",
"scope": "private"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"contextId": "65fd820f0758a54a68558d7c"
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
solution | string | solution's id (length in [1,128]) | |
name | string | context's name (length in [0,128]) | |
description | string | context's description (length in [0,128]) | |
scope | string | public private |
context's scope, public or private |
policy | object | (optional) context's policy |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | id of newly created context | |
› contextId | string | context's id |
Additional errors
Error Code | Message |
---|---|
24880 | Solution does not exist |
context/deleteContext
Removes context
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "context/deleteContext",
"params": {
"contextId": "65fd820f0758a54a68558d7c"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "context/deleteContext",
"params": {
"contextId": "65fd820f0758a54a68558d7c"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": "OK"
}
Parameter | Type | Enum | Description |
---|---|---|---|
contextId | string | context's id (length in [1,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | string | OK | "OK" |
Additional errors
Error Code | Message |
---|---|
24854 | Context does not exist |
context/getContext
Get context by given id
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "context/getContext",
"params": {
"contextId": "65fd820f0758a54a68558d7c"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "context/getContext",
"params": {
"contextId": "65fd820f0758a54a68558d7c"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"context": {
"id": "65fd820f0758a54a68558d7c",
"created": 1726652150623,
"modified": 1726652150623,
"solution": "56fd820f0758a54a68558d7c",
"name": "My Context",
"description": "Some text",
"scope": "private",
"shares": [
"56eee20f0758a54a68558d7c"
],
"policy": {}
}
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
contextId | string | context's id (length in [1,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | context's info | |
› context | object | context's info | |
› › id | string | context's id | |
› › created | number | context's creation timestamp | |
› › modified | number | context's modification timestamp | |
› › solution | string | context's main solution | |
› › name | string | context's name | |
› › description | string | context's description | |
› › scope | string | public private |
context's scope |
› › shares | array of string | context's shares | |
› › policy | object | context's policy |
Additional errors
Error Code | Message |
---|---|
24854 | Context does not exist |
context/getUserFromContext
Get user from context
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "context/getUserFromContext",
"params": {
"contextId": "65fd820f0758a54a68558d7c",
"userId": "John"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "context/getUserFromContext",
"params": {
"contextId": "65fd820f0758a54a68558d7c",
"userId": "John"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"user": {
"userId": "John",
"pubKey": "64dGCs7myoFrZDnP5pgvmBNKF1za22b5iBQaEpeBcGWiTUCA3c",
"created": 1713444359253,
"contextId": "65fd820f0758a54a68558d7c",
"acl": ""
}
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
contextId | string | context's id (length in [1,128]) | |
userId | string | user's id (length in [1,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | info about user of the context | |
› user | object | user info | |
› › userId | string | user's id | |
› › pubKey | string | context user's public key | |
› › created | number | context user's creation date | |
› › contextId | string | context's id | |
› › acl | string | user acl |
Additional errors
Error Code | Message |
---|---|
24854 | Context does not exist |
9 | User doesn't exist |
context/getUserFromContextByPubKey
Get user from context by user's public key
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "context/getUserFromContextByPubKey",
"params": {
"contextId": "65fd820f0758a54a68558d7c",
"pubKey": "64dGCs7myoFrZDnP5pgvmBNKF1za22b5iBQaEpeBcGWiTUCA3c"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "context/getUserFromContextByPubKey",
"params": {
"contextId": "65fd820f0758a54a68558d7c",
"pubKey": "64dGCs7myoFrZDnP5pgvmBNKF1za22b5iBQaEpeBcGWiTUCA3c"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"user": {
"userId": "John",
"pubKey": "64dGCs7myoFrZDnP5pgvmBNKF1za22b5iBQaEpeBcGWiTUCA3c",
"created": 1713444359253,
"contextId": "65fd820f0758a54a68558d7c",
"acl": ""
}
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
contextId | string | context's id (length in [1,128]) | |
pubKey | string | context user's public key |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | info about user of a context | |
› user | object | user info | |
› › userId | string | user's id | |
› › pubKey | string | context user's public key | |
› › created | number | context user's creation date | |
› › contextId | string | context's id | |
› › acl | string | user acl |
Additional errors
Error Code | Message |
---|---|
24854 | Context does not exist |
9 | User doesn't exist |
context/listContexts
Get list of all contexts
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "context/listContexts",
"params": {
"limit": 10,
"skip": 0,
"sortOrder": "asc"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "context/listContexts",
"params": {
"limit": 10,
"skip": 0,
"sortOrder": "asc"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"count": 1,
"list": [
{
"id": "662116076325655645e6031e",
"solution": "65ad8f6c2e4f4f1adb40bf81",
"shares": [],
"created": 1713444359253,
"modified": 1713444359253,
"name": "sampleContext",
"description": "context description",
"scope": "private",
"policy": {}
}
]
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
skip | number | (in range: [0,∞]) | |
limit | number | (in range: [1,100]) | |
sortOrder | string | desc asc |
|
lastId | string | (optional) (length in [1,60]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | list of contexts | |
› list | array of object | contexts list | |
› › id | string | context's id | |
› › created | number | context's creation timestamp | |
› › modified | number | context's modification timestamp | |
› › solution | string | context's main solution | |
› › name | string | context's name | |
› › description | string | context's description | |
› › scope | string | public private |
context's scope |
› › shares | array of string | context's shares | |
› › policy | object | context's policy | |
› count | number | list elements count |
Additional errors
No additional errors
context/listContextsOfSolution
Get list of all contexts of given solution
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "context/listContextsOfSolution",
"params": {
"solutionId": "65ad8f6c2e4f4f1adb40bf81",
"skip": 0,
"limit": 10,
"sortOrder": "asc"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "context/listContextsOfSolution",
"params": {
"solutionId": "65ad8f6c2e4f4f1adb40bf81",
"skip": 0,
"limit": 10,
"sortOrder": "asc"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"count": 1,
"list": [
{
"id": "662116076325655645e6031e",
"solution": "65ad8f6c2e4f4f1adb40bf81",
"shares": [],
"created": 1713444359253,
"modified": 1713444359253,
"name": "sampleContext",
"description": "context description",
"scope": "private",
"policy": {}
}
]
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
solutionId | string | solution's id (length in [1,128]) | |
skip | number | (in range: [0,∞]) | |
limit | number | (in range: [1,100]) | |
sortOrder | string | desc asc |
|
lastId | string | (optional) (length in [1,60]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | list of contexts | |
› list | array of object | contexts list | |
› › id | string | context's id | |
› › created | number | context's creation timestamp | |
› › modified | number | context's modification timestamp | |
› › solution | string | context's main solution | |
› › name | string | context's name | |
› › description | string | context's description | |
› › scope | string | public private |
context's scope |
› › shares | array of string | context's shares | |
› › policy | object | context's policy | |
› count | number | list elements count |
Additional errors
Error Code | Message |
---|---|
24880 | Solution does not exist |
context/listUsersFromContext
Get list of all users in the given context
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "context/listUsersFromContext",
"params": {
"contextId": "65fd820f0758a54a68558d7c",
"skip": 0,
"limit": 10,
"sortOrder": "asc"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "context/listUsersFromContext",
"params": {
"contextId": "65fd820f0758a54a68558d7c",
"skip": 0,
"limit": 10,
"sortOrder": "asc"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"users": [
{
"userId": "John",
"pubKey": "64dGCs7myoFrZDnP5pgvmBNKF1za22b5iBQaEpeBcGWiTUCA3c",
"created": 1713444359253,
"contextId": "65fd820f0758a54a68558d7c",
"acl": ""
}
],
"count": 1
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
contextId | string | context's id (length in [1,128]) | |
skip | number | (in range: [0,∞]) | |
limit | number | (in range: [1,100]) | |
sortOrder | string | desc asc |
|
lastId | string | (optional) (length in [1,60]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | list of context users | |
› users | array of object | ||
› › userId | string | user's id | |
› › pubKey | string | context user's public key | |
› › created | number | context user's creation date | |
› › contextId | string | context's id | |
› › acl | string | user acl | |
› count | number | list elements count |
Additional errors
Error Code | Message |
---|---|
24854 | Context does not exist |
context/removeSolutionFromContext
Removes connection between context and solution
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "context/removeSolutionFromContext",
"params": {
"contextId": "65fd820f0758a54a68558d7c",
"solutionId": "65ad8f6c2e4f4f1adb40bf81"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "context/removeSolutionFromContext",
"params": {
"contextId": "65fd820f0758a54a68558d7c",
"solutionId": "65ad8f6c2e4f4f1adb40bf81"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": "OK"
}
Parameter | Type | Enum | Description |
---|---|---|---|
contextId | string | context's id (length in [1,128]) | |
solutionId | string | solution's id (length in [1,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | string | OK | "OK" |
Additional errors
Error Code | Message |
---|---|
24854 | Context does not exist |
24880 | Solution does not exist |
24884 | Cannot unassign context from its parent |
context/removeUserFromContext
Removes user from the context
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "context/removeUserFromContext",
"params": {
"contextId": "65fd820f0758a54a68558d7c",
"userId": "John"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "context/removeUserFromContext",
"params": {
"contextId": "65fd820f0758a54a68558d7c",
"userId": "John"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": "OK"
}
Parameter | Type | Enum | Description |
---|---|---|---|
contextId | string | context's id (length in [1,128]) | |
userId | string | user's id (length in [1,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | string | OK | "OK" |
Additional errors
Error Code | Message |
---|---|
24854 | Context does not exist |
context/removeUserFromContextByPubKey
Removes user form the context by user's public key
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "context/removeUserFromContextByPubKey",
"params": {
"contextId": "65fd820f0758a54a68558d7c",
"userPubKey": "64dGCs7myoFrZDnP5pgvmBNKF1za22b5iBQaEpeBcGWiTUCA3c"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "context/removeUserFromContextByPubKey",
"params": {
"contextId": "65fd820f0758a54a68558d7c",
"userPubKey": "64dGCs7myoFrZDnP5pgvmBNKF1za22b5iBQaEpeBcGWiTUCA3c"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": "OK"
}
Parameter | Type | Enum | Description |
---|---|---|---|
contextId | string | context's id (length in [1,128]) | |
userPubKey | string | context user's public key |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | string | OK | "OK" |
Additional errors
Error Code | Message |
---|---|
24854 | Context does not exist |
context/setUserAcl
updates user ACL
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "context/setUserAcl",
"params": {
"userId": "John",
"contextId": "65fd820f0758a54a68558d7c",
"acl": "ALLOW ALL"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "context/setUserAcl",
"params": {
"userId": "John",
"contextId": "65fd820f0758a54a68558d7c",
"acl": "ALLOW ALL"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": "OK"
}
Parameter | Type | Enum | Description |
---|---|---|---|
contextId | string | context's id (length in [1,128]) | |
userId | string | user's id (length in [1,128]) | |
acl | string | user acl (length in [0,4096]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | string | OK | "OK" |
Additional errors
Error Code | Message |
---|---|
24854 | Context does not exist |
9 | User doesn't exist |
context/updateContext
Updates existing context properties
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "context/updateContext",
"params": {
"contextId": "65fd820f0758a54a68558d7c",
"scope": "public"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "context/updateContext",
"params": {
"contextId": "65fd820f0758a54a68558d7c",
"scope": "public"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": "OK"
}
Parameter | Type | Enum | Description |
---|---|---|---|
contextId | string | context's id (length in [1,128]) | |
name | string | (optional) context's name (length in [0,128]) | |
description | string | (optional) context's description (length in [0,128]) | |
scope | string | public private |
(optional) context's scope, public or private |
policy | object | (optional) context's policy |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | string | OK | "OK" |
Additional errors
Error Code | Message |
---|---|
24854 | Context does not exist |
24885 | Cannot switch connected context to private |
Inbox
inbox/deleteInbox
Deletes inbox
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "inbox/deleteInbox",
"params": {
"inboxId": "65ad8f6c2e4f4f1adb40bf81"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "inbox/deleteInbox",
"params": {
"inboxId": "65ad8f6c2e4f4f1adb40bf81"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": "OK"
}
Parameter | Type | Enum | Description |
---|---|---|---|
inboxId | string | Inbox ID (length in [1,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | string | OK | "OK" |
Additional errors
Error Code | Message |
---|---|
24862 | Inbox does not exist |
inbox/deleteManyInboxes
Deletes given Inboxes, requires that they belong to the same Context
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "inbox/deleteManyInboxes",
"params": {
"inboxIds": [
"65ad8f6c2e4f4f1adb40bf81"
]
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "inbox/deleteManyInboxes",
"params": {
"inboxIds": [
"65ad8f6c2e4f4f1adb40bf81"
]
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"results": [
{
"id": "65ad8f6c2e4f4f1adb40bf81",
"status": "OK"
}
]
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
inboxIds | array of string | List of Inboxes to delete (length in [0,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | List of ID and status for every deletion attempt | |
› results | array of object | List of deletions status | |
› › id | string | ||
› › status | string | "OK" "INBOX_DOES_NOT_EXIST" "ACCESS_DENIED" |
Additional errors
Error Code | Message |
---|---|
24868 | Resources does not belong to same context |
inbox/getInbox
Fetches inbox with given ID
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "inbox/getInbox",
"params": {
"inboxId": "65ad8f6c2e4f4f1adb40bf81"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "inbox/getInbox",
"params": {
"inboxId": "65ad8f6c2e4f4f1adb40bf81"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"inbox": {
"id": "65ad8f6c2e4f4f1adb40bf81",
"contextId": "657838dd3359f5a16f93cd81",
"createDate": 1709648110994,
"creator": "john",
"lastModificationDate": 1709648110994,
"lastModifier": "john",
"keyId": "my-key",
"users": [
"john"
],
"managers": [
"john"
],
"version": 1
}
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
inboxId | string | Inbox ID (length in [1,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | Inbox's info | |
› inbox | object | Inbox | |
› › id | string | Inbox's ID | |
› › contextId | string | Context's ID | |
› › createDate | number | Creation date | |
› › creator | string | Creator's ID | |
› › lastModificationDate | number | Last modification date | |
› › lastModifier | string | Last modifier ID | |
› › keyId | string | Key's ID | |
› › users | array of string | Users list | |
› › managers | array of string | Managers list | |
› › version | number | Version |
Additional errors
Error Code | Message |
---|---|
24862 | Inbox does not exist |
inbox/listInboxes
List Inboxes in given context
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "inbox/listInboxes",
"params": {
"contextId": "657838dd3359f5a16f93cd81",
"from": null,
"limit": 10,
"sortOrder": "asc"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "inbox/listInboxes",
"params": {
"contextId": "657838dd3359f5a16f93cd81",
"from": null,
"limit": 10,
"sortOrder": "asc"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"count": 1,
"list": [
{
"id": "65ad8f6c2e4f4f1adb40bf81",
"contextId": "657838dd3359f5a16f93cd81",
"createDate": 1709648110994,
"creator": "john",
"lastModificationDate": 1709648110994,
"lastModifier": "john",
"keyId": "my-key",
"users": [
"john"
],
"managers": [
"john"
],
"version": 1
}
]
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
contextId | string | Context's ID (length in [1,128]) | |
from | generic | (nullable) | |
limit | number | (in range: [1,100]) | |
sortOrder | string | desc asc |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | List of Inboxes | |
› list | array of object | List of Inboxes | |
› › id | string | Inbox's ID | |
› › contextId | string | Context's ID | |
› › createDate | number | Creation date | |
› › creator | string | Creator's ID | |
› › lastModificationDate | number | Last modification date | |
› › lastModifier | string | Last modifier ID | |
› › keyId | string | Key's ID | |
› › users | array of string | Users list | |
› › managers | array of string | Managers list | |
› › version | number | Version | |
› count | number | Number of all elements |
Additional errors
Error Code | Message |
---|---|
24854 | Context does not exist |
Manager
manager/auth
Retrieve an Oauth access token, to be used for authentication of requests.
Two methods of authentication are supported:
api_key_credentials
- using the apikey id and apikey secretapi_key_signature
- using the apikey id user generated signature. The signature is calculated using fields provided in the request. Method and URI are ommited in this signature:
"" + "\n" + "" + "\n" + $dataField + "\n"
refresh_token
- using a refresh token that was received from an earlier invocation
The response will contain an access token, expiration timestamp and a refresh token that can be used to get a new set of tokens.
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "manager/auth",
"params": {
"apiKeyId": "hysd62jsd7823nasd03",
"apiKeySecret": "759a1d8edba555badf1216b0f381b94950141",
"grantType": "api_key_credentials",
"scope": [
"apiKey",
"solution",
"context"
]
}
}),
headers: {
"Content-type": "application/json"
}
});
curl -X POST \
-H "Content-Type: application/json" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "manager/auth",
"params": {
"apiKeyId": "hysd62jsd7823nasd03",
"apiKeySecret": "759a1d8edba555badf1216b0f381b94950141",
"grantType": "api_key_credentials",
"scope": [
"apiKey",
"solution",
"context"
]
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"accessToken": "SXRzIGEgcmFuZG9tIHRleHQgZW5jb2RlZCBmb3IgdGhlIHRlc3RpbmcgcHVycG9zZSwgaWYgeW91IGRlY29kZWQgdGhpcyB0ZXh0LCB0cmVhdCBpcyBhcyBhIHNvcnQgb2YgZWFzdGVyIGVnZyA6KS4=",
"accessTokenExpiry": 1726652150623,
"refreshToken": "TG9yZW0gaXBzdW1Mb3JlbSBpcHN1bUxvcmVtIGlwc3VtTG9yZW0gaXBzdW1Mb3JlbSBpcHN1bUxvcmVtIGlwc3VtTG9yZW0gaXBzdW0=",
"refreshTokenExpiry": 1726952150623,
"tokenType": "Bearer",
"scope": [
"apiKey",
"solution",
"context"
]
}
}
one of the following: AuthByApiKeyCredentialsModel, AuthByRefreshTokenModel, AuthByApiKeySignatureModel
AuthByApiKeyCredentialsModel
Parameter | Type | Enum | Description |
---|---|---|---|
grantType | string | "api_key_credentials" | Token grant type |
apiKeyId | string | Api key id (length in [1,128]) | |
apiKeySecret | string | Api key secret (length in [1,128]) | |
scope | array of string | (optional) Requested token scope (length in [0,128]) |
AuthByRefreshTokenModel
Parameter | Type | Enum | Description |
---|---|---|---|
grantType | string | "refresh_token" | Token grant type |
refreshToken | string | Refresh token from earlier invocation (length in [1,2048]) |
AuthByApiKeySignatureModel
Parameter | Type | Enum | Description |
---|---|---|---|
grantType | string | "api_key_signature" | Token grant type |
apiKeyId | string | Api key id (length in [1,128]) | |
signature | string | EdDSA signature or Hash | |
timestamp | number | Request timestamp (in range: [-∞,∞]) | |
nonce | string | Random value used to generate signature (length in [32,64]) | |
scope | array of string | (optional) Requested token scope (length in [0,128]) | |
data | string | (optional) Optional signed data (length in [0,1024]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | accessToken, refreshToken, expiryTime and scope | |
› accessToken | string | Access token used in authorization | |
› accessTokenExpiry | number | Access token expiration timestamp | |
› tokenType | string | "Bearer" | Token type |
› refreshToken | string | Refresh token that will be used to generate new tokens | |
› refreshTokenExpiry | number | Refresh token expiration timestamp | |
› scope | array of string | Created token scope |
Additional errors
Error Code | Message |
---|---|
24875 | Api key does not exist |
24876 | Invalid credentials |
21 | Invalid token |
8 | Invalid signature |
manager/bindAccessToken
Bind Access Token to websocket, request will be executed with the given Token rights.
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "manager/bindAccessToken",
"params": {
"accessToken": "TG9yZW0gaXBzdW1Mb3JlbSBpcHN1bUxvcmVtIGlwc3VtTG9yZW0gaXBzdW1Mb3JlbSBpcHN1bUxvcmVtIGlwc3VtTG9yZW0gaXBzdW0="
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "manager/bindAccessToken",
"params": {
"accessToken": "TG9yZW0gaXBzdW1Mb3JlbSBpcHN1bUxvcmVtIGlwc3VtTG9yZW0gaXBzdW1Mb3JlbSBpcHN1bUxvcmVtIGlwc3VtTG9yZW0gaXBzdW0="
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": "OK"
}
Parameter | Type | Enum | Description |
---|---|---|---|
accessToken | string | Access token (length in [1,2048]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | string | OK | OK |
Additional errors
No additional errors
manager/createApiKey
Adds new ApiKey (up to limit of 10). If you pass a public key you cannot use generated api key secret to authorize
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "manager/createApiKey",
"params": {
"name": "myApiKey",
"scope": [
"apiKey",
"solution",
"context"
]
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "manager/createApiKey",
"params": {
"name": "myApiKey",
"scope": [
"apiKey",
"solution",
"context"
]
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"id": "hysd62jsd7823nasd03",
"secret": "759a1d8edba555badf1216b0f381b94950141"
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
name | string | New api key name (length in [0,128]) | |
scope | array of string | New api key scope (length in [0,128]) | |
publicKey | string | (optional) ED25519 PEM encoded public key |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | api key id and secret | |
› id | string | New api key id | |
› secret | string | New api key secret |
Additional errors
Error Code | Message |
---|---|
24877 | Api keys limit exceeded |
manager/deleteApiKey
Deletes ApiKey
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "manager/deleteApiKey",
"params": {
"id": "hysd62jsd7823nasd03"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "manager/deleteApiKey",
"params": {
"id": "hysd62jsd7823nasd03"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": "OK"
}
Parameter | Type | Enum | Description |
---|---|---|---|
id | string | Api key id (length in [1,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | string | OK | OK |
Additional errors
Error Code | Message |
---|---|
24875 | Api key does not exist |
manager/getApiKey
returns info about ApiKey
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "manager/getApiKey",
"params": {
"id": "hysd62jsd7823nasd03"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "manager/getApiKey",
"params": {
"id": "hysd62jsd7823nasd03"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"apiKey": {
"id": "hysd62jsd7823nasd03",
"created": 1726652150623,
"enabled": true,
"name": "MyApiKey",
"scope": [
"apiKey",
"solution",
"context"
]
}
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
id | string | Api key id (length in [1,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | api key info | |
› apiKey | object | Api key info | |
› › id | string | Api key id | |
› › created | number | Api key creation timestamp | |
› › enabled | boolean | Api key status | |
› › name | string | Api key name | |
› › scope | array of string | Api key scope | |
› › publicKey | string | (optional) Api key public key |
Additional errors
Error Code | Message |
---|---|
24875 | Api key does not exist |
manager/listApiKeys
lists all ApiKeys
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "manager/listApiKeys",
"params": {}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "manager/listApiKeys",
"params": {}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"list": [
{
"id": "hysd62jsd7823nasd03",
"created": 1726652150623,
"enabled": true,
"name": "MyApiKey",
"scope": [
"apiKey",
"solution",
"context"
]
}
]
}
}
No parameters
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | list of api keys | |
› list | array of object | Api key info list | |
› › id | string | Api key id | |
› › created | number | Api key creation timestamp | |
› › enabled | boolean | Api key status | |
› › name | string | Api key name | |
› › scope | array of string | Api key scope | |
› › publicKey | string | (optional) Api key public key |
Additional errors
No additional errors
manager/subscribeToChannel
Subscribes to notifications from given channels.
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "manager/subscribeToChannel",
"params": {
"channels": [
"thread",
"store"
]
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "manager/subscribeToChannel",
"params": {
"channels": [
"thread",
"store"
]
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": "OK"
}
Parameter | Type | Enum | Description |
---|---|---|---|
channels | array of enum | thread store stream inbox |
Channels list (length in [0,16]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | string | OK | OK |
Additional errors
Error Code | Message |
---|---|
24886 | Method is callable with websocket only |
manager/unsubscribeFromChannel
Removes given channels from subscribed.
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "manager/unsubscribeFromChannel",
"params": {
"channels": [
"thread",
"store"
]
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "manager/unsubscribeFromChannel",
"params": {
"channels": [
"thread",
"store"
]
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": "OK"
}
Parameter | Type | Enum | Description |
---|---|---|---|
channels | array of enum | thread store stream inbox |
Channels list (length in [0,16]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | string | OK | OK |
Additional errors
Error Code | Message |
---|---|
24886 | Method is callable with websocket only |
manager/updateApiKey
updates given ApiKey
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "manager/updateApiKey",
"params": {
"id": "hysd62jsd7823nasd03",
"enabled": false
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "manager/updateApiKey",
"params": {
"id": "hysd62jsd7823nasd03",
"enabled": false
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": "OK"
}
Parameter | Type | Enum | Description |
---|---|---|---|
id | string | Api key id (length in [1,128]) | |
name | string | (optional) Api key name (length in [0,128]) | |
scope | array of string | (optional) Api key scope (length in [0,128]) | |
enabled | boolean | (optional) Api key status |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | string | OK | OK |
Additional errors
Error Code | Message |
---|---|
24875 | Api key does not exist |
Solution
solution/createSolution
Creates solution
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "solution/createSolution",
"params": {
"name": "New solution"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "solution/createSolution",
"params": {
"name": "New solution"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"solutionId": "2v36hhQQjXH74kGHyS7gxcEwWp4C"
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
name | string | solution's name (length in [0,256]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | solution's id | |
› solutionId | string | solution's id |
Additional errors
No additional errors
solution/deleteSolution
Deletes solution
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "solution/deleteSolution",
"params": {
"id": "2v36hhQQjXH74kGHyS7gxcEwWp4C"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "solution/deleteSolution",
"params": {
"id": "2v36hhQQjXH74kGHyS7gxcEwWp4C"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": "OK"
}
Parameter | Type | Enum | Description |
---|---|---|---|
id | string | solution's id (length in [1,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | string | OK | "OK" |
Additional errors
Error Code | Message |
---|---|
24880 | Solution does not exist |
solution/getSolution
Get solution
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "solution/getSolution",
"params": {
"id": "65fd820f0758a54a68558d7c"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "solution/getSolution",
"params": {
"id": "65fd820f0758a54a68558d7c"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"solution": {
"id": "65fd820f0758a54a68558d7c",
"created": 1726652150623,
"name": "My Solution"
}
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
id | string | solution's id (length in [1,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | solution | |
› solution | object | solution's info | |
› › id | string | solution's id | |
› › created | number | solution's create date timestamp | |
› › name | string | solution's name |
Additional errors
Error Code | Message |
---|---|
24880 | Solution does not exist |
solution/listSolutions
return list of the solutions
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "solution/listSolutions",
"params": {}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "solution/listSolutions",
"params": {}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"list": [
{
"id": "65fd820f0758a54a68558d7c",
"created": 1726652150623,
"name": "My Solution"
}
]
}
}
No parameters
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | returns list of solutions | |
› list | array of object | solutions list | |
› › id | string | solution's id | |
› › created | number | solution's create date timestamp | |
› › name | string | solution's name |
Additional errors
No additional errors
solution/updateSolution
Updates solution
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "solution/updateSolution",
"params": {
"id": "2v36hhQQjXH74kGHyS7gxcEwWp4C",
"name": "some-solution-name"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "solution/updateSolution",
"params": {
"id": "2v36hhQQjXH74kGHyS7gxcEwWp4C",
"name": "some-solution-name"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": "OK"
}
Parameter | Type | Enum | Description |
---|---|---|---|
id | string | solution's id (length in [1,128]) | |
name | string | solution's name (length in [0,256]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | string | OK | "OK" |
Additional errors
Error Code | Message |
---|---|
24880 | Solution does not exist |
Store
store/deleteManyStoreFiles
Deletes given files, requires that they belong to the same store
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "store/deleteManyStoreFiles",
"params": {
"fileIds": [
"65ad8f6c2e4f4f1adb40bf81"
]
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "store/deleteManyStoreFiles",
"params": {
"fileIds": [
"65ad8f6c2e4f4f1adb40bf81"
]
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"results": [
{
"id": "65ad8f6c2e4f4f1adb40bf81",
"status": "OK"
}
]
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
fileIds | array of string | List of files to delete (length in [0,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | List of ID and status for every deletion attempt | |
› results | array of object | List of deletions status | |
› › id | string | ||
› › status | string | "OK" "STORE_FILE_DOES_NOT_EXIST" "ACCESS_DENIED" "STORE_DOES_NOT_EXIST" |
Additional errors
Error Code | Message |
---|---|
24870 | Files does not belong to same store |
store/deleteManyStores
Deletes given Stores, requires that they belong to the same context
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "store/deleteManyStores",
"params": {
"storeIds": [
"65ad8f6c2e4f4f1adb40bf81"
]
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "store/deleteManyStores",
"params": {
"storeIds": [
"65ad8f6c2e4f4f1adb40bf81"
]
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"results": [
{
"id": "65ad8f6c2e4f4f1adb40bf81",
"status": "OK"
}
]
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
storeIds | array of string | List of Stores to delete (length in [0,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | List of ID and status for every deletion attempt | |
› results | array of object | List of deletions status | |
› › id | string | ||
› › status | string | "OK" "ACCESS_DENIED" "STORE_DOES_NOT_EXIST" "STORE_BELONGS_TO_INBOX" |
Additional errors
Error Code | Message |
---|---|
24868 | Resources does not belong to same context |
store/deleteStore
Deletes store
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "store/deleteStore",
"params": {
"storeId": "65e71856bcf6598993a0f19e"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "store/deleteStore",
"params": {
"storeId": "65e71856bcf6598993a0f19e"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": "OK"
}
Parameter | Type | Enum | Description |
---|---|---|---|
storeId | string | Store ID (length in [1,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | string | OK | "OK" |
Additional errors
Error Code | Message |
---|---|
24855 | Store does not exist |
store/deleteStoreFile
Deletes file
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "store/deleteStoreFile",
"params": {
"storeFileId": "65ad8f6c2e4f4f1adb40bf81"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "store/deleteStoreFile",
"params": {
"storeFileId": "65ad8f6c2e4f4f1adb40bf81"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": "OK"
}
Parameter | Type | Enum | Description |
---|---|---|---|
storeFileId | string | Store file ID (length in [1,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | string | OK | "OK" |
Additional errors
Error Code | Message |
---|---|
24856 | Store file does not exist |
store/deleteStoreFilesOlderThan
Deletes all files older than given timestamp
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "store/deleteStoreFilesOlderThan",
"params": {
"storeId": "66477724276e411b86fe6d73",
"timestamp": 1715959588042
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "store/deleteStoreFilesOlderThan",
"params": {
"storeId": "66477724276e411b86fe6d73",
"timestamp": 1715959588042
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"results": [
{
"id": "65ad8f6c2e4f4f1adb40bf81",
"status": "OK"
}
]
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
storeId | string | Store's ID (length in [1,128]) | |
timestamp | number | Date in milliseconds (in range: [-∞,∞]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | List of ID and status for every deletion attempt | |
› results | array of object | List of deletions status | |
› › id | string | ||
› › status | string | "OK" "STORE_FILE_DOES_NOT_EXIST" "ACCESS_DENIED" "STORE_DOES_NOT_EXIST" |
Additional errors
Error Code | Message |
---|---|
24855 | Store does not exist |
store/getStore
Fetches store with given ID
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "store/getStore",
"params": {
"storeId": "65e71856bcf6598993a0f19e"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "store/getStore",
"params": {
"storeId": "65e71856bcf6598993a0f19e"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"store": {
"id": "65e71856bcf6598993a0f19e",
"contextId": "657838dd3359f5a16f93cd81",
"createDate": 1709643862879,
"creator": "john",
"lastModificationDate": 1709643862879,
"lastModifier": "john",
"keyId": "f03c6e25c54bac1b7e22e5508d38b9d5",
"users": [
"john"
],
"managers": [
"john"
],
"version": 1,
"lastFileDate": 1709648110994,
"files": 1
}
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
storeId | string | Store ID (length in [1,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | Store's info | |
› store | object | Store | |
› › id | string | Store's ID | |
› › contextId | string | Context's ID | |
› › createDate | number | Creation date | |
› › creator | string | Creator ID | |
› › lastModificationDate | number | Modification date | |
› › lastModifier | string | Last modifier ID | |
› › keyId | string | Key ID | |
› › users | array of string | Users list | |
› › managers | array of string | Managers list | |
› › version | number | Version | |
› › lastFileDate | number | Date of last modified file in store | |
› › files | number | Files count in the store |
Additional errors
Error Code | Message |
---|---|
24855 | Store does not exist |
store/getStoreFile
Fetches file with given ID
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "store/getStoreFile",
"params": {
"storeFileId": "65e728ee6600e98985cdb814"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "store/getStoreFile",
"params": {
"storeFileId": "65e728ee6600e98985cdb814"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"storeFile": {
"id": "65e728ee6600e98985cdb814",
"version": 1,
"storeId": "65e71856bcf6598993a0f19e",
"contextId": "657838dd3359f5a16f93cd81",
"created": 1709648110994,
"creator": "john",
"lastModifier": "john",
"lastModificationDate": 1709648110994,
"size": 64,
"keyId": "f03c6e25c54bac1b7e22e5508d38b9d5"
}
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
storeFileId | string | Store file ID (length in [1,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | file's info | |
› storeFile | object | Store file | |
› › id | string | Store file's ID | |
› › version | number | Version | |
› › contextId | string | Context's ID | |
› › storeId | string | Store's ID | |
› › created | number | Creation date | |
› › creator | string | Creator ID | |
› › lastModificationDate | number | Modification date | |
› › lastModifier | string | Last modifier ID | |
› › size | number | File size | |
› › keyId | string | Key ID | |
› › thumb | object | (optional) Thumb | |
› › › size | number | Thumb's size |
Additional errors
Error Code | Message |
---|---|
24856 | Store file does not exist |
store/listStoreFiles
List files in given Store
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "store/listStoreFiles",
"params": {
"storeId": "65e71856bcf6598993a0f19e",
"from": null,
"limit": 10,
"sortOrder": "asc"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "store/listStoreFiles",
"params": {
"storeId": "65e71856bcf6598993a0f19e",
"from": null,
"limit": 10,
"sortOrder": "asc"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"count": 1,
"list": [
{
"id": "65e728ee6600e98985cdb814",
"version": 1,
"storeId": "65e71856bcf6598993a0f19e",
"contextId": "657838dd3359f5a16f93cd81",
"created": 1709648110994,
"creator": "john",
"lastModifier": "john",
"lastModificationDate": 1709648110994,
"size": 64,
"keyId": "f03c6e25c54bac1b7e22e5508d38b9d5"
}
]
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
storeId | string | Store ID (length in [1,128]) | |
from | generic | (nullable) | |
limit | number | (in range: [1,100]) | |
sortOrder | string | desc asc |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | List of files | |
› list | array of object | List of API usage buckets | |
› › id | string | Store file's ID | |
› › version | number | Version | |
› › contextId | string | Context's ID | |
› › storeId | string | Store's ID | |
› › created | number | Creation date | |
› › creator | string | Creator ID | |
› › lastModificationDate | number | Modification date | |
› › lastModifier | string | Last modifier ID | |
› › size | number | File size | |
› › keyId | string | Key ID | |
› › thumb | object | (optional) Thumb | |
› › › size | number | Thumb's size | |
› count | number | Number of all elements |
Additional errors
Error Code | Message |
---|---|
24855 | Store does not exist |
store/listStores
List stores in given context
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "store/listStores",
"params": {
"contextId": "657838dd3359f5a16f93cd81",
"from": null,
"limit": 10,
"sortOrder": "asc"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "store/listStores",
"params": {
"contextId": "657838dd3359f5a16f93cd81",
"from": null,
"limit": 10,
"sortOrder": "asc"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"count": 0,
"list": [
{
"id": "65e71856bcf6598993a0f19e",
"contextId": "657838dd3359f5a16f93cd81",
"createDate": 1709643862879,
"creator": "john",
"lastModificationDate": 1709643862879,
"lastModifier": "john",
"keyId": "f03c6e25c54bac1b7e22e5508d38b9d5",
"users": [
"john"
],
"managers": [
"john"
],
"version": 1,
"lastFileDate": 1709648110994,
"files": 1
}
]
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
contextId | string | Context's ID (length in [1,128]) | |
from | generic | (nullable) | |
limit | number | (in range: [1,100]) | |
sortOrder | string | desc asc |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | List of stores | |
› list | array of object | List of Stores | |
› › id | string | Store's ID | |
› › contextId | string | Context's ID | |
› › createDate | number | Creation date | |
› › creator | string | Creator ID | |
› › lastModificationDate | number | Modification date | |
› › lastModifier | string | Last modifier ID | |
› › keyId | string | Key ID | |
› › users | array of string | Users list | |
› › managers | array of string | Managers list | |
› › version | number | Version | |
› › lastFileDate | number | Date of last modified file in store | |
› › files | number | Files count in the store | |
› count | number | Number of all elements |
Additional errors
Error Code | Message |
---|---|
24854 | Context does not exist |
Thread
thread/deleteManyThreadMessages
Deletes given messages, requires that they belong to the same Thread
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "thread/deleteManyThreadMessages",
"params": {
"messageIds": [
"65ad8f6c2e4f4f1adb40bf81"
]
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "thread/deleteManyThreadMessages",
"params": {
"messageIds": [
"65ad8f6c2e4f4f1adb40bf81"
]
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"results": [
{
"id": "65ad8f6c2e4f4f1adb40bf81",
"status": "OK"
}
]
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
messageIds | array of string | List of messages to delete (length in [0,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | List of ID and status for every deletion attempt | |
› results | array of object | List of deletions status | |
› › id | string | ||
› › status | string | "OK" "THREAD_MESSAGE_DOES_NOT_EXIST" "ACCESS_DENIED" |
Additional errors
Error Code | Message |
---|---|
24869 | Messages does not belong to same thread |
thread/deleteManyThreads
Deletes given Threads, requires that they belong to the same Context
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "thread/deleteManyThreads",
"params": {
"threadIds": [
"65ad8f6c2e4f4f1adb40bf81"
]
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "thread/deleteManyThreads",
"params": {
"threadIds": [
"65ad8f6c2e4f4f1adb40bf81"
]
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"results": [
{
"id": "65ad8f6c2e4f4f1adb40bf81",
"status": "OK"
}
]
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
threadIds | array of string | List of Threads to delete (length in [0,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | List of ID and status for every deletion attempt | |
› results | array of object | List of deletions status | |
› › id | string | ||
› › status | string | "OK" "THREAD_DOES_NOT_EXIST" "ACCESS_DENIED" "THREAD_BELONGS_TO_INBOX" |
Additional errors
Error Code | Message |
---|---|
24868 | Resources does not belong to same context |
thread/deleteThread
Deletes Thread
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "thread/deleteThread",
"params": {
"threadId": "664775ddb5d9a3f95b619ef0"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "thread/deleteThread",
"params": {
"threadId": "664775ddb5d9a3f95b619ef0"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": "OK"
}
Parameter | Type | Enum | Description |
---|---|---|---|
threadId | string | Thread ID (length in [1,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | string | OK | "OK" |
Additional errors
Error Code | Message |
---|---|
24577 | Thread does not exist |
thread/deleteThreadMessage
Deletes Thread message
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "thread/deleteThreadMessage",
"params": {
"threadMessageId": "65ad8f6c2e4f4f1adb40bf81"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "thread/deleteThreadMessage",
"params": {
"threadMessageId": "65ad8f6c2e4f4f1adb40bf81"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": "OK"
}
Parameter | Type | Enum | Description |
---|---|---|---|
threadMessageId | string | Thread message ID (length in [1,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | string | OK | "OK" |
Additional errors
Error Code | Message |
---|---|
24589 | Thread message does not exist |
thread/deleteThreadMessagesOlderThan
Deletes all messages older than given timestamp
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "thread/deleteThreadMessagesOlderThan",
"params": {
"threadId": "66477724276e411b86fe6d73",
"timestamp": 1715959588042
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "thread/deleteThreadMessagesOlderThan",
"params": {
"threadId": "66477724276e411b86fe6d73",
"timestamp": 1715959588042
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"results": [
{
"id": "65ad8f6c2e4f4f1adb40bf81",
"status": "OK"
}
]
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
threadId | string | Thread's ID (length in [1,128]) | |
timestamp | number | Date in milliseconds (in range: [-∞,∞]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | List of ID and status for every deletion attempt | |
› results | array of object | List of deletions status | |
› › id | string | ||
› › status | string | "OK" "THREAD_MESSAGE_DOES_NOT_EXIST" "ACCESS_DENIED" |
Additional errors
Error Code | Message |
---|---|
24577 | Thread does not exist |
thread/getThread
Fetches Thread with given ID
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "thread/getThread",
"params": {
"threadId": "664775ddb5d9a3f95b619ef0"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "thread/getThread",
"params": {
"threadId": "664775ddb5d9a3f95b619ef0"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"thread": {
"id": "664775ddb5d9a3f95b619ef0",
"contextId": "657838dd3359f5a16f93cd81",
"createDate": 1715959261142,
"creator": "john",
"lastModificationDate": 1715959261142,
"lastModifier": "john",
"keyId": "my-key",
"users": [
"john"
],
"managers": [
"john"
],
"version": 1,
"lastMsgDate": 1715959261394,
"messages": 34
}
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
threadId | string | Thread ID (length in [1,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | Thread's info | |
› thread | object | Thread | |
› › id | string | Thread's ID | |
› › contextId | string | Context's ID | |
› › createDate | number | Creation date | |
› › creator | string | Creator ID | |
› › lastModificationDate | number | Modification date | |
› › lastModifier | string | Last modifier ID | |
› › keyId | string | Key ID | |
› › users | array of string | Users list | |
› › managers | array of string | Managers list | |
› › version | number | Version | |
› › lastMsgDate | number | Date of last modified message in thread | |
› › messages | number | Messages count in thread |
Additional errors
Error Code | Message |
---|---|
24577 | Thread does not exist |
thread/getThreadMessage
Fetches message with given ID
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "thread/getThreadMessage",
"params": {
"threadMessageId": "65ad8f6c2e4f4f1adb40bf81"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "thread/getThreadMessage",
"params": {
"threadMessageId": "65ad8f6c2e4f4f1adb40bf81"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"threadMessage": {
"id": "664775dd05c7c6f92f654a11",
"contextId": "657838dd3359f5a16f93cd81",
"threadId": "664775ddb5d9a3f95b619ef0",
"createDate": 1715959261318,
"author": "john",
"keyId": "my-key"
}
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
threadMessageId | string | Thread message ID (length in [1,128]) |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | message's info | |
› threadMessage | object | Thread message | |
› › id | string | Thread message's ID | |
› › contextId | string | Context's ID | |
› › threadId | string | Thread's ID | |
› › createDate | number | Creation date | |
› › author | string | Author's ID | |
› › keyId | string | Key ID |
Additional errors
Error Code | Message |
---|---|
24589 | Thread message does not exist |
thread/listThreadMessages
List Thread messages in given Thread
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "thread/listThreadMessages",
"params": {
"threadId": "65ad8f6c2e4f4f1adb40bf81",
"from": null,
"limit": 10,
"sortOrder": "asc"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "thread/listThreadMessages",
"params": {
"threadId": "65ad8f6c2e4f4f1adb40bf81",
"from": null,
"limit": 10,
"sortOrder": "asc"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"count": 1,
"list": [
{
"id": "664775dd05c7c6f92f654a11",
"contextId": "657838dd3359f5a16f93cd81",
"threadId": "664775ddb5d9a3f95b619ef0",
"createDate": 1715959261318,
"author": "john",
"keyId": "my-key"
}
]
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
threadId | string | Thread ID (length in [1,128]) | |
from | generic | (nullable) | |
limit | number | (in range: [1,100]) | |
sortOrder | string | desc asc |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | List of messages | |
› list | array of object | List of Thread messages | |
› › id | string | Thread message's ID | |
› › contextId | string | Context's ID | |
› › threadId | string | Thread's ID | |
› › createDate | number | Creation date | |
› › author | string | Author's ID | |
› › keyId | string | Key ID | |
› count | number | Number of all elements |
Additional errors
Error Code | Message |
---|---|
24577 | Thread does not exist |
thread/listThreads
List Threads in given Context
Parameters
const response = await fetch("https://my-privmx-bridge-instance/api", {
method: "POST",
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 128,
"method": "thread/listThreads",
"params": {
"contextId": "657838dd3359f5a16f93cd81",
"from": null,
"limit": 10,
"sortOrder": "asc"
}
}),
headers: {
"Content-type": "application/json",
"Authorization": "Bearer TOKEN"
}
});
curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" \
--data-binary '{
"jsonrpc": "2.0",
"id": 128,
"method": "thread/listThreads",
"params": {
"contextId": "657838dd3359f5a16f93cd81",
"from": null,
"limit": 10,
"sortOrder": "asc"
}
}' \
https://my-privmx-bridge-instance/types
The command above returns JSON structured like this:
{
"jsonrpc": "2.0",
"id": 128,
"result": {
"count": 1,
"list": [
{
"id": "664775ddb5d9a3f95b619ef0",
"contextId": "657838dd3359f5a16f93cd81",
"createDate": 1715959261142,
"creator": "john",
"lastModificationDate": 1715959261142,
"lastModifier": "john",
"keyId": "my-key",
"users": [
"john"
],
"managers": [
"john"
],
"version": 1,
"lastMsgDate": 1715959261394,
"messages": 34
}
]
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
contextId | string | Context's ID (length in [1,128]) | |
from | generic | (nullable) | |
limit | number | (in range: [1,100]) | |
sortOrder | string | desc asc |
Response
Parameter | Type | Enum | Description |
---|---|---|---|
id | number | ID sent in the request | |
jsonrpc | string | 2.0 | The JSON-RPC version |
result | object | List of Threads | |
› list | array of object | List of Threads | |
› › id | string | Thread's ID | |
› › contextId | string | Context's ID | |
› › createDate | number | Creation date | |
› › creator | string | Creator ID | |
› › lastModificationDate | number | Modification date | |
› › lastModifier | string | Last modifier ID | |
› › keyId | string | Key ID | |
› › users | array of string | Users list | |
› › managers | array of string | Managers list | |
› › version | number | Version | |
› › lastMsgDate | number | Date of last modified message in thread | |
› › messages | number | Messages count in thread | |
› count | number | Number of all elements |
Additional errors
Error Code | Message |
---|---|
24854 | Context does not exist |
Errors
HTTP error codes
Error Code | Message | Description |
---|---|---|
404 | Not Found | Given url is invalid. |
429 | Too Many Requests | You're making too many request. |
500 | Internal Server Error | We had a problem with our server. Try again later. |
503 | Service Unavailable | We're temporarily offline for maintenance. Please try again later. |
Common Errors
Error Code | Message | Description |
---|---|---|
48 | Access denied | You don't have access to requested resource. |
24879 | Unauthorized | Your credentials are invalid. |
24878 | Insufficient scope | You don't have enough rights to requested resource. |
-32601 | Method not found | Given method does not exis. |
-32602 | Invalid params | Given parameters are invalid. The data property of error object contains detailed description what is wrong. |
-32603 | Internal error | We had a problem with our server. |
-32700 | Parse error | You sent us invalid json. |
-32600 | Invalid Request | You sent us invalid json rpc request. |
-32605 | Only post method allowed | You do not use HTTP POST method. |
Other JSON-RPC error codes
Error Code | Message | Description |
---|---|---|
2 | Invalid username | |
8 | Invalid signature | |
9 | User doesn't exist | |
12 | Unknown session | |
13 | Invalid session state | |
14 | Invalid A | |
15 | Different M1 | |
21 | Invalid token | |
40 | Invalid timestamp | |
41 | Invalid nonce | |
64 | Login rejected | |
99 | Invalid version | |
100 | Invalid device id | |
101 | Pub key already in use | |
104 | Maintenance mode | |
105 | Invalid proxy session | |
112 | Invalid key | |
114 | Websocket required | |
115 | Websocket already authorized | |
129 | Need 2FA authentication | |
133 | Exceeded limit of websocket channels | |
134 | AddWsChannelId required on multi channel websocket | |
135 | Cannot add channel to single channel websocket | |
24577 | Thread does not exist | |
24578 | Invalid thread key | |
24579 | Request does not exist | |
24580 | Request file does not exist | |
24581 | Request file aready closed | |
24582 | Request size exceeded | |
24583 | Request file size exceeded | |
24584 | Too many files in request | |
24585 | Request file desynchronized | |
24586 | Invalid file index | |
24587 | File already used | |
24588 | Request not ready yet | |
24589 | Thread message does not exist | |
24597 | Invalid key id | |
24837 | Files container file has not thumb | |
24853 | Unsupported operation | |
24854 | Context does not exist | |
24855 | Store does not exist | |
24856 | Store file does not exist | |
24857 | Unsupported resource type | |
24858 | Resource does not exist | |
24859 | Cannot query not root resource | |
24860 | Cannot query root resource | |
24861 | Resource field does not exist | |
24862 | Inbox does not exist | |
24863 | Not enough files in request | |
24864 | Thread belongs to inbox | |
24865 | Store belongs to inbox | |
24866 | Stream room does not exist | |
24867 | Object with lastId does not exist | |
24868 | Resources does not belong to same context | |
24869 | Messages does not belong to same thread | |
24870 | Files does not belong to same store | |
24871 | Request chunk too small | |
24872 | Store file version mismatch | |
24874 | File does not belong to store | |
24875 | Api key does not exist | |
24876 | Invalid credentials | |
24877 | Api keys limit exceeded | |
24880 | Solution does not exist | |
24881 | Invalid ACL | |
24882 | Solution has contexts | |
24883 | Cannot assign private context | |
24884 | Cannot unassign context from its parent | |
24885 | Cannot switch connected context to private | |
24886 | Method is callable with websocket only |
ACL Groups and functions
thread/READ
Function | parameters |
---|---|
thread/threadGet | threadId |
thread/threadList | |
thread/threadMessageGet | threadIdmessageId |
thread/threadMessagesGet | threadId |
thread/WRITE
Function | parameters |
---|---|
thread/threadCreate | |
thread/threadUpdate | threadId |
thread/threadDelete | threadId |
thread/threadDeleteMany | |
thread/threadMessageSend | threadId |
thread/threadMessageDelete | threadIdmessageId |
thread/threadMessageDeleteMany | threadId |
thread/threadMessageDeleteOlderThan | threadId |
thread/ALL
Function | parameters |
---|---|
thread/threadGet | threadId |
thread/threadList | |
thread/threadMessageGet | threadIdmessageId |
thread/threadMessagesGet | threadId |
thread/threadCreate | |
thread/threadUpdate | threadId |
thread/threadDelete | threadId |
thread/threadDeleteMany | |
thread/threadMessageSend | threadId |
thread/threadMessageDelete | threadIdmessageId |
thread/threadMessageDeleteMany | threadId |
thread/threadMessageDeleteOlderThan | threadId |
store/READ
Function | parameters |
---|---|
store/storeGet | storeId |
store/storeList | |
store/storeFileGet | storeIdfileId |
store/storeFileList | storeId |
store/storeFileRead | storeIdfileId |
store/WRITE
Function | parameters |
---|---|
store/storeCreate | |
store/storeUpdate | storeId |
store/storeDelete | storeId |
store/storeDeleteMany | |
store/storeFileCreate | storeId |
store/storeFileWrite | storeIdfileId |
store/storeFileUpdate | storeIdfileId |
store/storeFileDelete | storeIdfileId |
store/storeFileDeleteMany | storeId |
store/storeFileDeleteOlderThan | storeId |
store/ALL
Function | parameters |
---|---|
store/storeGet | storeId |
store/storeList | |
store/storeFileGet | storeIdfileId |
store/storeFileList | storeId |
store/storeFileRead | storeIdfileId |
store/storeCreate | |
store/storeUpdate | storeId |
store/storeDelete | storeId |
store/storeDeleteMany | |
store/storeFileCreate | storeId |
store/storeFileWrite | storeIdfileId |
store/storeFileUpdate | storeIdfileId |
store/storeFileDelete | storeIdfileId |
store/storeFileDeleteMany | storeId |
store/storeFileDeleteOlderThan | storeId |
inbox/READ
Function | parameters |
---|---|
inbox/inboxGet | inboxId |
inbox/inboxList |
inbox/WRITE
Function | parameters |
---|---|
inbox/inboxCreate | |
inbox/inboxUpdate | inboxId |
inbox/inboxDelete | inboxId |
inbox/inboxDeleteMany |
inbox/ALL
Function | parameters |
---|---|
inbox/inboxGet | inboxId |
inbox/inboxList | |
inbox/inboxCreate | |
inbox/inboxUpdate | inboxId |
inbox/inboxDelete | inboxId |
inbox/inboxDeleteMany |
stream/READ
Function | parameters |
---|---|
stream/streamRoomGet | streamRoomId |
stream/streamRoomList |
stream/WRITE
Function | parameters |
---|---|
stream/streamRoomCreate | |
stream/streamRoomUpdate | streamRoomId |
stream/streamRoomDelete | streamRoomId |
stream/streamRoomDeleteMany |
stream/ALL
Function | parameters |
---|---|
stream/streamRoomGet | streamRoomId |
stream/streamRoomList | |
stream/streamRoomCreate | |
stream/streamRoomUpdate | streamRoomId |
stream/streamRoomDelete | streamRoomId |
stream/streamRoomDeleteMany |
READ
Function | parameters |
---|---|
store/storeGet | storeId |
store/storeList | |
store/storeFileGet | storeIdfileId |
store/storeFileList | storeId |
store/storeFileRead | storeIdfileId |
thread/threadGet | threadId |
thread/threadList | |
thread/threadMessageGet | threadIdmessageId |
thread/threadMessagesGet | threadId |
inbox/inboxGet | inboxId |
inbox/inboxList | |
stream/streamRoomGet | streamRoomId |
stream/streamRoomList |
WRITE
Function | parameters |
---|---|
store/storeCreate | |
store/storeUpdate | storeId |
store/storeDelete | storeId |
store/storeDeleteMany | |
store/storeFileCreate | storeId |
store/storeFileWrite | storeIdfileId |
store/storeFileUpdate | storeIdfileId |
store/storeFileDelete | storeIdfileId |
store/storeFileDeleteMany | storeId |
store/storeFileDeleteOlderThan | storeId |
thread/threadGet | threadId |
thread/threadList | |
thread/threadMessageGet | threadIdmessageId |
thread/threadMessagesGet | threadId |
inbox/inboxGet | inboxId |
inbox/inboxList | |
stream/streamRoomGet | streamRoomId |
stream/streamRoomList |
ALL
Function | parameters |
---|---|
store/storeGet | storeId |
store/storeList | |
store/storeFileGet | storeIdfileId |
store/storeFileList | storeId |
store/storeFileRead | storeIdfileId |
store/storeCreate | |
store/storeUpdate | storeId |
store/storeDelete | storeId |
store/storeDeleteMany | |
store/storeFileCreate | storeId |
store/storeFileWrite | storeIdfileId |
store/storeFileUpdate | storeIdfileId |
store/storeFileDelete | storeIdfileId |
store/storeFileDeleteMany | storeId |
store/storeFileDeleteOlderThan | storeId |
thread/threadGet | threadId |
thread/threadList | |
thread/threadMessageGet | threadIdmessageId |
thread/threadMessagesGet | threadId |
thread/threadCreate | |
thread/threadUpdate | threadId |
thread/threadDelete | threadId |
thread/threadDeleteMany | |
thread/threadMessageSend | threadId |
thread/threadMessageDelete | threadIdmessageId |
thread/threadMessageDeleteMany | threadId |
thread/threadMessageDeleteOlderThan | threadId |
inbox/inboxGet | inboxId |
inbox/inboxList | |
inbox/inboxCreate | |
inbox/inboxUpdate | inboxId |
inbox/inboxDelete | inboxId |
inbox/inboxDeleteMany | |
stream/streamRoomGet | streamRoomId |
stream/streamRoomList | |
stream/streamRoomCreate | |
stream/streamRoomUpdate | streamRoomId |
stream/streamRoomDelete | streamRoomId |
stream/streamRoomDeleteMany |
Policy
This object determines who is allowed to do what. The policy can be set in two places: in the Context and in the Container. Setting a policy in the Container overwrites the policy from the Context. Some of the Containers (Threads, Stores) can include items (Messages, Files), which have their own policy. The property of the policy can be set to one of the following values:
- "default" - take the default value
- "inherit" - take value from the Context (can be used only in the Container policy)
- "none" - no one can perform this action
- "all" - all Context users can perform this action
- "user" - all Container users can perform this action
- "manager" - all Container managers can perform this action
- "owner" - only Container owner can perform this action
- "itemOwner" - only item owner can perform this action (can be used only in the item policy)
You can also combine the values listed above. If you want to allow item updates to be executed only by the item owner,
with the additional assumption that he must be an active user of the Container, you can write itemOwner&user
.
But if you want to allow the Container managers to also update the item, you can write itemOwner&user,manager
.
In the policy entry, the &
character means 'and', and the coma ,
means 'or'.
Default policy:
{
"thread": {
"get": "user",
"listMy": "all",
"listAll": "none",
"create": "all",
"update": "manager",
"delete": "manager",
"updatePolicy": "manager",
"creatorHasToBeManager": "yes",
"updaterCanBeRemovedFromManagers": "no",
"ownerCanBeRemovedFromManagers": "yes",
"canOverwriteContextPolicy": "yes",
"item": {
"get": "user",
"listMy": "user",
"listAll": "user",
"create": "user",
"update": "itemOwner&user,manager",
"delete": "itemOwner&user,manager"
}
},
"store": {
"get": "user",
"listMy": "all",
"listAll": "none",
"create": "all",
"update": "manager",
"delete": "manager",
"updatePolicy": "manager",
"creatorHasToBeManager": "yes",
"updaterCanBeRemovedFromManagers": "no",
"ownerCanBeRemovedFromManagers": "yes",
"canOverwriteContextPolicy": "yes",
"item": {
"get": "user",
"listMy": "user",
"listAll": "user",
"create": "user",
"update": "itemOwner&user,manager",
"delete": "itemOwner&user,manager"
}
},
"inbox": {
"get": "user",
"listMy": "all",
"listAll": "none",
"create": "all",
"update": "manager",
"delete": "manager",
"updatePolicy": "manager",
"creatorHasToBeManager": "yes",
"updaterCanBeRemovedFromManagers": "no",
"ownerCanBeRemovedFromManagers": "yes",
"canOverwriteContextPolicy": "yes"
},
"stream": {
"get": "user",
"listMy": "all",
"listAll": "none",
"create": "all",
"update": "manager",
"delete": "manager",
"updatePolicy": "manager",
"creatorHasToBeManager": "yes",
"updaterCanBeRemovedFromManagers": "no",
"ownerCanBeRemovedFromManagers": "yes",
"canOverwriteContextPolicy": "yes"
}
}
Parameter | Type | Enum | Description |
---|---|---|---|
thread | object | (optional) Policy for threads in this context | |
› item | object | (optional) Item policy | |
› › get | string | (optional) Determine who can get an item | |
› › listMy | string | (optional) Determine who can list items created by me | |
› › listAll | string | (optional) Determine who can list all items | |
› › create | string | (optional) Determine who can create an item | |
› › update | string | (optional) Determine who can update an item | |
› › delete | string | (optional) Determine who can update an item | |
› get | string | (optional) Determine who can get a container | |
› listMy | string | (optional) Determine who can list containers created by me | |
› listAll | string | (optional) Determine who can list all containers | |
› create | string | (optional) Determine who can create a container | |
› update | string | (optional) Determine who can update a container | |
› delete | string | (optional) Determine who can update a container | |
› updatePolicy | string | (optional) Determine who can update policy | |
› creatorHasToBeManager | string | inherit yes no default |
(optional) Determine whether the creator has to be added to the list of managers |
› updaterCanBeRemovedFromManagers | string | inherit yes no default |
(optional) Determine whether the updater can be removed from the list of managers |
› ownerCanBeRemovedFromManagers | string | inherit yes no default |
(optional) Determine whether the owner can be removed from the list of managers |
› canOverwriteContextPolicy | string | inherit yes no default |
(optional) Determine whether the policy can be overwritten in container |
store | object | (optional) Policy for stores in this context | |
› item | object | (optional) Item policy | |
› › get | string | (optional) Determine who can get an item | |
› › listMy | string | (optional) Determine who can list items created by me | |
› › listAll | string | (optional) Determine who can list all items | |
› › create | string | (optional) Determine who can create an item | |
› › update | string | (optional) Determine who can update an item | |
› › delete | string | (optional) Determine who can update an item | |
› get | string | (optional) Determine who can get a container | |
› listMy | string | (optional) Determine who can list containers created by me | |
› listAll | string | (optional) Determine who can list all containers | |
› create | string | (optional) Determine who can create a container | |
› update | string | (optional) Determine who can update a container | |
› delete | string | (optional) Determine who can update a container | |
› updatePolicy | string | (optional) Determine who can update policy | |
› creatorHasToBeManager | string | inherit yes no default |
(optional) Determine whether the creator has to be added to the list of managers |
› updaterCanBeRemovedFromManagers | string | inherit yes no default |
(optional) Determine whether the updater can be removed from the list of managers |
› ownerCanBeRemovedFromManagers | string | inherit yes no default |
(optional) Determine whether the owner can be removed from the list of managers |
› canOverwriteContextPolicy | string | inherit yes no default |
(optional) Determine whether the policy can be overwritten in container |
inbox | object | (optional) Policy for inboxes in this context | |
› get | string | (optional) Determine who can get a container | |
› listMy | string | (optional) Determine who can list containers created by me | |
› listAll | string | (optional) Determine who can list all containers | |
› create | string | (optional) Determine who can create a container | |
› update | string | (optional) Determine who can update a container | |
› delete | string | (optional) Determine who can update a container | |
› updatePolicy | string | (optional) Determine who can update policy | |
› creatorHasToBeManager | string | inherit yes no default |
(optional) Determine whether the creator has to be added to the list of managers |
› updaterCanBeRemovedFromManagers | string | inherit yes no default |
(optional) Determine whether the updater can be removed from the list of managers |
› ownerCanBeRemovedFromManagers | string | inherit yes no default |
(optional) Determine whether the owner can be removed from the list of managers |
› canOverwriteContextPolicy | string | inherit yes no default |
(optional) Determine whether the policy can be overwritten in container |
stream | object | (optional) Policy for streams in this context | |
› get | string | (optional) Determine who can get a container | |
› listMy | string | (optional) Determine who can list containers created by me | |
› listAll | string | (optional) Determine who can list all containers | |
› create | string | (optional) Determine who can create a container | |
› update | string | (optional) Determine who can update a container | |
› delete | string | (optional) Determine who can update a container | |
› updatePolicy | string | (optional) Determine who can update policy | |
› creatorHasToBeManager | string | inherit yes no default |
(optional) Determine whether the creator has to be added to the list of managers |
› updaterCanBeRemovedFromManagers | string | inherit yes no default |
(optional) Determine whether the updater can be removed from the list of managers |
› ownerCanBeRemovedFromManagers | string | inherit yes no default |
(optional) Determine whether the owner can be removed from the list of managers |
› canOverwriteContextPolicy | string | inherit yes no default |
(optional) Determine whether the policy can be overwritten in container |