{ "components": { "parameters": { "txn": { "description": "Transaction id", "in": "header", "name": "x-defradb-tx", "schema": { "format": "int64", "type": "integer" } } }, "responses": { "error": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/error" } } }, "description": "error" }, "success": { "description": "ok" } }, "schemas": { "acp_document_relationship_add_request": { "properties": { "CollectionName": { "type": "string" }, "DocID": { "type": "string" }, "Relation": { "type": "string" }, "TargetActor": { "type": "string" } }, "type": "object" }, "acp_document_relationship_delete_request": { "properties": { "CollectionName": { "type": "string" }, "DocID": { "type": "string" }, "Relation": { "type": "string" }, "TargetActor": { "type": "string" } }, "type": "object" }, "acp_node_relationship_add_request": { "properties": { "Relation": { "type": "string" }, "TargetActor": { "type": "string" } }, "type": "object" }, "acp_node_relationship_delete_request": { "properties": { "Relation": { "type": "string" }, "TargetActor": { "type": "string" } }, "type": "object" }, "acp_node_status_result": { "properties": { "Status": { "type": "string" } }, "type": "object" }, "acp_policy_add_result": { "properties": { "PolicyID": { "type": "string" } }, "type": "object" }, "acp_relationship_add_result": { "properties": { "ExistedAlready": { "type": "boolean" } }, "type": "object" }, "acp_relationship_delete_result": { "properties": { "RecordFound": { "type": "boolean" } }, "type": "object" }, "add_view_request": { "properties": { "Query": { "type": "string" }, "SDL": { "type": "string" }, "Transform": {} }, "type": "object" }, "backup_config": { "properties": { "collections": { "items": { "type": "string" }, "type": "array" }, "filepath": { "type": "string" }, "format": { "type": "string" }, "pretty": { "type": "boolean" } }, "type": "object" }, "ccip_request": { "properties": { "data": { "type": "string" }, "sender": { "type": "string" } }, "type": "object" }, "ccip_response": { "properties": { "data": { "type": "string" } }, "type": "object" }, "collection": { "properties": { "CollectionID": { "type": "string" }, "CollectionSet": {}, "EncryptedIndexes": { "items": { "properties": { "FieldName": { "type": "string" }, "Type": { "type": "string" } }, "type": "object" }, "type": "array" }, "Fields": { "items": { "properties": { "DefaultValue": {}, "FieldID": { "type": "string" }, "IsPrimary": { "type": "boolean" }, "Kind": {}, "Name": { "type": "string" }, "RelationName": {}, "Size": { "type": "integer" }, "Typ": { "maximum": 255, "minimum": 0, "type": "integer" } }, "type": "object" }, "type": "array" }, "Indexes": { "items": { "properties": { "Fields": { "items": { "properties": { "Descending": { "type": "boolean" }, "Name": { "type": "string" } }, "type": "object" }, "type": "array" }, "ID": { "maximum": 4294967295, "minimum": 0, "type": "integer" }, "Name": { "type": "string" }, "Unique": { "type": "boolean" } }, "type": "object" }, "type": "array" }, "IsActive": { "type": "boolean" }, "IsBranchable": { "type": "boolean" }, "IsEmbeddedOnly": { "type": "boolean" }, "IsMaterialized": { "type": "boolean" }, "IsPlaceholder": { "type": "boolean" }, "Name": { "type": "string" }, "Policy": {}, "PreviousVersion": {}, "Query": {}, "VectorEmbeddings": { "items": { "properties": { "FieldName": { "type": "string" }, "Fields": { "items": { "type": "string" }, "type": "array" }, "Model": { "type": "string" }, "Provider": { "type": "string" }, "Template": { "type": "string" }, "URL": { "type": "string" } }, "type": "object" }, "type": "array" }, "VersionID": { "type": "string" } }, "type": "object" }, "collection_delete": { "properties": { "filter": {} }, "type": "object" }, "collection_update": { "properties": { "filter": {}, "updater": { "type": "string" } }, "type": "object" }, "create_tx": { "properties": { "id": { "maximum": 18446744073709552000, "minimum": 0, "type": "integer" } }, "type": "object" }, "delete_replicator_params": { "properties": { "Collections": { "items": { "type": "string" }, "type": "array" }, "ID": { "type": "string" } }, "type": "object" }, "delete_result": { "properties": { "Count": { "format": "int64", "type": "integer" }, "DocIDs": { "items": { "type": "string" }, "type": "array" } }, "type": "object" }, "document": { "additionalProperties": true, "type": "object" }, "encrypted_index": { "properties": { "FieldName": { "type": "string" }, "Type": { "type": "string" } }, "type": "object" }, "encrypted_index_create": { "properties": { "FieldName": { "type": "string" }, "Type": { "type": "string" } }, "type": "object" }, "error": { "properties": { "error": {} }, "type": "object" }, "graphql_request": { "properties": { "operationName": { "type": "string" }, "query": { "type": "string" }, "variables": { "additionalProperties": {}, "type": "object" } }, "type": "object" }, "identity": { "properties": { "DID": { "type": "string" }, "PublicKey": { "type": "string" } }, "type": "object" }, "index": { "properties": { "Fields": { "items": { "properties": { "Descending": { "type": "boolean" }, "Name": { "type": "string" } }, "type": "object" }, "type": "array" }, "ID": { "maximum": 4294967295, "minimum": 0, "type": "integer" }, "Name": { "type": "string" }, "Unique": { "type": "boolean" } }, "type": "object" }, "index_create": { "properties": { "Fields": { "items": { "properties": { "Descending": { "type": "boolean" }, "Name": { "type": "string" } }, "type": "object" }, "type": "array" }, "Name": { "type": "string" }, "Unique": { "type": "boolean" } }, "type": "object" }, "lens_config": { "properties": { "DestinationSchemaVersionID": { "type": "string" }, "Lenses": { "items": { "properties": { "Arguments": { "additionalProperties": {}, "type": "object" }, "Inverse": { "type": "boolean" }, "Path": { "type": "string" } }, "type": "object" }, "type": "array" }, "SourceSchemaVersionID": { "type": "string" } }, "type": "object" }, "patch_collection_request": { "properties": { "Migration": {}, "Patch": { "type": "string" } }, "type": "object" }, "peer_info": { "properties": { "Addresses": { "items": { "type": "string" }, "type": "array" }, "ID": { "type": "string" } }, "type": "object" }, "replicator": { "properties": { "Addresses": { "items": { "type": "string" }, "type": "array" }, "CollectionIDs": { "items": { "type": "string" }, "type": "array" }, "ID": { "type": "string" }, "LastStatusChange": { "format": "date-time", "type": "string" }, "Status": { "maximum": 255, "minimum": 0, "type": "integer" } }, "type": "object" }, "set_migration": { "properties": { "lensId": { "type": "string" } }, "type": "object" }, "set_replicator_params": { "properties": { "Addresses": { "items": { "type": "string" }, "type": "array" }, "Collections": { "items": { "type": "string" }, "type": "array" } }, "type": "object" }, "update_result": { "properties": { "Count": { "format": "int64", "type": "integer" }, "DocIDs": { "items": { "type": "string" }, "type": "array" } }, "type": "object" } }, "securitySchemes": { "bearerToken": { "bearerFormat": "JWT", "scheme": "bearer", "type": "http" } } }, "externalDocs": { "description": "Learn more about DefraDB", "url": "https://docs.source.network" }, "info": { "title": "DefraDB API", "version": "0" }, "openapi": "3.0.3", "paths": { "/acp/document/policy": { "post": { "description": "Add a policy using document acp system", "operationId": "add dac policy", "requestBody": { "content": { "text/plain": { "schema": { "type": "string" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/acp_policy_add_result" } } }, "description": "Add document acp policy result" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "acp_document_policy" ] } }, "/acp/document/relationship": { "delete": { "description": "Delete an actor relationship using document acp system", "operationId": "delete dac relationship", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/acp_document_relationship_delete_request" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/acp_relationship_delete_result" } } }, "description": "Delete document acp relationship result" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "acp_document_relationship" ] }, "post": { "description": "Add an actor relationship using document acp system", "operationId": "add dac relationship", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/acp_document_relationship_add_request" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/acp_relationship_add_result" } } }, "description": "Add document acp relationship result" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "acp_document_relationship" ] } }, "/acp/node/disable": { "post": { "description": "Disable nac", "operationId": "disable nac", "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "acp_node_disable" ] } }, "/acp/node/re-enable": { "post": { "description": "Re-enable nac", "operationId": "re-enable nac", "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "acp_node_re-enable" ] } }, "/acp/node/relationship": { "delete": { "description": "Delete an actor relationship using node acp system", "operationId": "delete nac relationship", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/acp_node_relationship_delete_request" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/acp_relationship_delete_result" } } }, "description": "Delete node acp relationship result" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "acp_node_relationship" ] }, "post": { "description": "Add an actor relationship using node acp system", "operationId": "add nac relationship", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/acp_node_relationship_add_request" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/acp_relationship_add_result" } } }, "description": "Add node acp relationship result" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "acp_node_relationship" ] } }, "/acp/node/status": { "get": { "description": "Check status of node acp system", "operationId": "Check status of nac", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/acp_node_status_result" } } }, "description": "Node acp status result" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "acp_node_status" ] } }, "/backup/export": { "post": { "description": "Export a database backup to file", "operationId": "backup_export", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/backup_config" } } }, "required": true }, "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "backup" ] } }, "/backup/import": { "post": { "description": "Import a database backup from file", "operationId": "backup_import", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/backup_config" } } }, "required": true }, "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "backup" ] } }, "/block/verify-signature": { "get": { "description": "Verify block signature", "operationId": "verify_block", "parameters": [ { "description": "Content ID of the block to verify", "in": "query", "name": "cid", "required": true, "schema": { "type": "string" } }, { "description": "Public key of the block to verify", "in": "query", "name": "public-key", "required": true, "schema": { "type": "string" } }, { "description": "Type of the public key: secp256k1, ed25519", "in": "query", "name": "type", "schema": { "type": "string" } } ], "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "block" ] } }, "/ccip": { "post": { "description": "CCIP POST endpoint", "operationId": "ccip_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ccip_request" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ccip_response" } } }, "description": "GraphQL response" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "ccip" ] } }, "/ccip/{sender}/{data}": { "get": { "description": "CCIP GET endpoint", "operationId": "ccip_get", "parameters": [ { "description": "Hex encoded request data", "in": "path", "name": "data", "required": true, "schema": { "type": "string" } }, { "description": "Hex encoded sender address", "in": "path", "name": "sender", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ccip_response" } } }, "description": "GraphQL response" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "ccip" ] } }, "/collections": { "get": { "description": "Introspect collection(s) by name, schema id, or version id.", "operationId": "collection_describe", "parameters": [ { "description": "Collection name", "in": "query", "name": "name", "schema": { "type": "string" } }, { "description": "Collection schema root", "in": "query", "name": "collection_id", "schema": { "type": "string" } }, { "description": "Collection schema version id", "in": "query", "name": "version_id", "schema": { "type": "string" } }, { "description": "If true, inactive collections will be returned in addition to active ones", "in": "query", "name": "get_inactive", "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/collection" }, { "items": { "$ref": "#/components/schemas/collection" }, "type": "array" } ] } } }, "description": "Collection(s) with matching name, schema id, or version id." }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "collection" ] }, "patch": { "description": "Update collection definitions", "operationId": "patch_collection", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/patch_collection_request" } } } }, "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "collection" ] } }, "/collections/default": { "post": { "description": "Set the default version for a collection", "operationId": "set_default_collection_version", "requestBody": { "content": { "text/plain": { "schema": { "type": "string" } } } }, "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "collection" ] } }, "/collections/indexes": { "get": { "description": "List all indexes for all collections", "operationId": "indexes_list_all", "responses": { "200": { "content": { "application/json": { "schema": { "additionalProperties": { "items": { "$ref": "#/components/schemas/index" }, "type": "array" }, "type": "object" } } }, "description": "Map of collection names to their indexes" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "index" ] } }, "/collections/{name}": { "delete": { "description": "Delete document(s) from a collection", "operationId": "collection_delete_with_filter", "parameters": [ { "description": "Collection name", "in": "path", "name": "name", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/collection_delete" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/delete_result" } } }, "description": "Delete results" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "collection" ] }, "get": { "description": "Get all document IDs", "operationId": "collection_keys", "parameters": [ { "description": "Collection name", "in": "path", "name": "name", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "collection" ] }, "patch": { "description": "Update document(s) in a collection", "operationId": "collection_update_with_filter", "parameters": [ { "description": "Collection name", "in": "path", "name": "name", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/collection_update" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/update_result" } } }, "description": "Update results" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "collection" ] }, "post": { "description": "Create document(s) in a collection", "operationId": "collection_create", "parameters": [ { "description": "Collection name", "in": "path", "name": "name", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/document" }, { "items": { "$ref": "#/components/schemas/document" }, "type": "array" } ] } } }, "required": true }, "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "collection" ] } }, "/collections/{name}/encrypted-indexes": { "get": { "description": "List encrypted indexes", "operationId": "encrypted_index_list", "parameters": [ { "description": "Collection name", "in": "path", "name": "name", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/encrypted_index" }, "type": "array" } } }, "description": "List of encrypted indexes" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "encrypted_index" ] }, "post": { "description": "Create an encrypted index", "operationId": "encrypted_index_create", "parameters": [ { "description": "Collection name", "in": "path", "name": "name", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/encrypted_index_create" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/encrypted_index" } } }, "description": "Encrypted index description" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "encrypted_index" ] } }, "/collections/{name}/encrypted-indexes/{field}": { "delete": { "description": "Delete an encrypted index", "operationId": "encrypted_index_delete", "parameters": [ { "description": "Collection name", "in": "path", "name": "name", "required": true, "schema": { "type": "string" } }, { "description": "Field name of the encrypted index", "in": "path", "name": "field", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "encrypted_index" ] } }, "/collections/{name}/indexes": { "get": { "description": "List secondary indexes", "operationId": "index_list", "parameters": [ { "description": "Collection name", "in": "path", "name": "name", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/index" }, "type": "array" } } }, "description": "List of indexes" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "index" ] }, "post": { "description": "Create a secondary index", "operationId": "index_create", "parameters": [ { "description": "Collection name", "in": "path", "name": "name", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/index_create" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/index" } } }, "description": "Index description" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "index" ] } }, "/collections/{name}/indexes/{index}": { "delete": { "description": "Delete a secondary index", "operationId": "index_drop", "parameters": [ { "description": "Collection name", "in": "path", "name": "name", "required": true, "schema": { "type": "string" } }, { "in": "path", "name": "index", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "index" ] } }, "/collections/{name}/{docID}": { "delete": { "description": "Delete a document by docID", "operationId": "collection_delete", "parameters": [ { "description": "Collection name", "in": "path", "name": "name", "required": true, "schema": { "type": "string" } }, { "in": "path", "name": "docID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "collection" ] }, "get": { "description": "Get a document by docID", "operationId": "collection_get", "parameters": [ { "description": "Collection name", "in": "path", "name": "name", "required": true, "schema": { "type": "string" } }, { "in": "path", "name": "docID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/document" } } }, "description": "Document value" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "collection" ] }, "patch": { "description": "Update a document by docID", "operationId": "collection_update", "parameters": [ { "description": "Collection name", "in": "path", "name": "name", "required": true, "schema": { "type": "string" } }, { "in": "path", "name": "docID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "collection" ] } }, "/debug/dump": { "get": { "description": "Dump database", "operationId": "debug_dump", "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "debug" ] } }, "/encrypted-indexes": { "get": { "description": "List all encrypted indexes for all collections", "operationId": "encrypted_indexes_list_all", "responses": { "200": { "content": { "application/json": { "schema": { "additionalProperties": { "items": { "$ref": "#/components/schemas/encrypted_index" }, "type": "array" }, "type": "object" } } }, "description": "Map of collection names to their encrypted indexes" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "encrypted_index" ] } }, "/graphql": { "get": { "description": "GraphQL GET endpoint", "operationId": "graphql_get", "parameters": [ { "in": "query", "name": "query", "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "data": { "additionalProperties": true, "type": "object" }, "errors": { "items": { "properties": { "message": { "type": "string" } }, "type": "object" }, "type": "array" } }, "type": "object" } } }, "description": "GraphQL response" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "graphql" ] }, "post": { "description": "GraphQL POST endpoint", "operationId": "graphql_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/graphql_request" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "data": { "additionalProperties": true, "type": "object" }, "errors": { "items": { "properties": { "message": { "type": "string" } }, "type": "object" }, "type": "array" } }, "type": "object" } } }, "description": "GraphQL response" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "graphql" ] } }, "/lens": { "post": { "description": "Add a new lens migration", "operationId": "lens_set_migration", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/lens_config" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/set_migration" } } }, "description": "Lens info" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "lens" ] } }, "/node/identity": { "get": { "description": "Get node's public identity", "operationId": "node_identity", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/identity" } } }, "description": "Identity" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "node", "identity" ] } }, "/p2p/active-peers": { "get": { "operationId": "active_peers", "responses": { "200": { "content": { "application/json": { "schema": { "items": { "type": "string" }, "type": "array" } } }, "description": "Connected peers" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "p2p" ] } }, "/p2p/collections": { "delete": { "description": "Remove peer collections", "operationId": "peer_collections_remove", "requestBody": { "content": { "application/json": { "schema": { "items": { "type": "string" }, "type": "array" } } }, "required": true }, "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "p2p" ] }, "get": { "description": "List peer collections", "operationId": "peer_collections_list", "responses": { "200": { "content": { "application/json": { "schema": { "items": { "type": "string" }, "type": "array" } } }, "description": "Peer collections" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "p2p" ] }, "post": { "description": "Add peer collections", "operationId": "peer_collections_add", "requestBody": { "content": { "application/json": { "schema": { "items": { "type": "string" }, "type": "array" } } }, "required": true }, "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "p2p" ] } }, "/p2p/collections/sync-versions": { "post": { "description": "Synchronize collection versions to the local node", "operationId": "peer_sync_collection_versions", "requestBody": { "content": { "application/json": { "schema": { "properties": { "timeout": { "type": "string" }, "versionIDs": { "items": { "type": "string" }, "type": "array" } }, "type": "object" } } }, "required": true }, "responses": { "200": { "description": "Collection synchronization completed successfully" }, "400": { "$ref": "#/components/responses/error" }, "500": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "p2p" ] } }, "/p2p/connect": { "post": { "operationId": "connect", "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "p2p" ] } }, "/p2p/documents": { "delete": { "description": "Remove peer documents", "operationId": "peer_documents_remove", "requestBody": { "content": { "application/json": { "schema": { "items": { "type": "string" }, "type": "array" } } }, "required": true }, "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "p2p" ] }, "get": { "description": "List peer documents", "operationId": "peer_documents_list", "responses": { "200": { "content": { "application/json": { "schema": { "items": { "type": "string" }, "type": "array" } } }, "description": "Peer documents" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "p2p" ] }, "post": { "description": "Add peer documents", "operationId": "peer_documents_add", "requestBody": { "content": { "application/json": { "schema": { "items": { "type": "string" }, "type": "array" } } }, "required": true }, "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "p2p" ] } }, "/p2p/documents/sync": { "post": { "description": "Synchronize documents from the network", "operationId": "peer_sync_documents", "requestBody": { "content": { "application/json": { "schema": { "properties": { "collectionName": { "type": "string" }, "docIDs": { "items": { "type": "string" }, "type": "array" }, "timeout": { "type": "string" } }, "type": "object" } } }, "required": true }, "responses": { "200": { "description": "Document sync completed successfully" }, "400": { "$ref": "#/components/responses/error" }, "500": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "p2p" ] } }, "/p2p/info": { "get": { "operationId": "peer_info", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/peer_info" } } }, "description": "Peer network info" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "p2p" ] } }, "/p2p/replicators": { "delete": { "description": "Delete peer replicators", "operationId": "peer_replicator_delete", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/delete_replicator_params" } } }, "required": true }, "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "p2p" ] }, "get": { "description": "List peer replicators", "operationId": "peer_replicator_list", "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/replicator" }, "type": "array" } } }, "description": "Replicators" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "p2p" ] }, "post": { "description": "Add peer replicators", "operationId": "peer_replicator_set", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/set_replicator_params" } } }, "required": true }, "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "p2p" ] } }, "/purge": { "post": { "description": "Purge all persisted data and restart", "operationId": "purge", "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } } } }, "/schema": { "post": { "description": "Add a new schema definition", "operationId": "add_schema", "requestBody": { "content": { "text/plain": { "schema": { "type": "string" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/collection" }, "type": "array" } } }, "description": "Collection(s)" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "schema" ] } }, "/tx": { "post": { "description": "Create a new transaction", "operationId": "new_transaction", "parameters": [ { "description": "Read only transaction", "in": "query", "name": "read_only", "schema": { "default": false, "type": "boolean" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/create_tx" } } }, "description": "Transaction info" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "transaction" ] } }, "/tx/concurrent": { "post": { "description": "Create a new concurrent transaction", "operationId": "new_concurrent_transaction", "parameters": [ { "description": "Read only transaction", "in": "query", "name": "read_only", "schema": { "default": false, "type": "boolean" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/create_tx" } } }, "description": "Transaction info" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "transaction" ] } }, "/tx/{id}": { "delete": { "description": "Discard a transaction", "operationId": "transaction_discard", "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "format": "int64", "type": "integer" } } ], "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "transaction" ] }, "post": { "description": "Commit a transaction", "operationId": "transaction_commit", "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "format": "int64", "type": "integer" } } ], "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "transaction" ] } }, "/view": { "post": { "description": "Manage database views.", "operationId": "view", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/add_view_request" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/collection" }, { "items": { "$ref": "#/components/schemas/collection" }, "type": "array" } ] } } }, "description": "The created collection and embedded schemas for the added view." }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "view" ] } }, "/view/refresh": { "post": { "description": "Refresh view(s) by name, schema id, or version id.", "operationId": "view_refresh", "parameters": [ { "description": "Collection name", "in": "query", "name": "name", "schema": { "type": "string" } }, { "description": "Collection schema root", "in": "query", "name": "collection_id", "schema": { "type": "string" } }, { "description": "Collection schema version id", "in": "query", "name": "version_id", "schema": { "type": "string" } }, { "description": "If true, inactive collections will be returned in addition to active ones", "in": "query", "name": "get_inactive", "schema": { "type": "string" } } ], "responses": { "200": { "$ref": "#/components/responses/success" }, "400": { "$ref": "#/components/responses/error" }, "default": { "description": "" } }, "tags": [ "view" ] } } }, "servers": [ { "description": "Local DefraDB instance", "url": "/api/v0" } ], "tags": [ { "description": "Upload GQL schemas to create collections", "name": "schema" }, { "description": "Add, remove, or update documents", "name": "collection" }, { "description": "Add views", "name": "view" }, { "description": "Add, update, or remove indexes", "name": "index" }, { "description": "Migrate documents to and from collection versions", "name": "lens" }, { "description": "Peer-to-peer network operations", "name": "p2p" }, { "description": "Access control system(s)", "name": "acp" }, { "description": "Database transaction operations", "name": "transaction" }, { "description": "Database backup operations", "name": "backup" }, { "description": "GraphQL query endpoints", "name": "graphql" }, { "externalDocs": { "description": "EIP-3668", "url": "https://eips.ethereum.org/EIPS/eip-3668" }, "name": "ccip" } ] }