{ "swagger": "2.0", "info": { "title": "Assets API", "description": "API for asset and event management.", "version": "2.0", "contact": { "name": "DataTrails", "url": "https://www.datatrails.ai" } }, "tags": [ { "name": "Assets and Events", "description": "Primary API for Asset management" } ], "basePath": "/archivist/v2/assets", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "paths": { "/archivist/v2/assets": { "get": { "summary": "List Assets", "description": "Retrieves a list of Assets", "operationId": "Assets_ListAssets", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v2ListAssetsResponse" } }, "206": { "description": "The number of assets exceeds the servers limit. The approximate number of matching results is provided by the x-total-count header if the 'x-request-total-count' header on the request is set to 'true'. The exact limit is available in the content-range header. The value format is 'items 0-LIMIT/TOTAL'. Note that x-total-count is always present for 200 and 206 responses. It is the servers best available approximation. Similarly, in any result set, you may get a few more than LIMIT items." }, "401": { "description": "Returned when the user is not authenticated to the system." }, "403": { "description": "Returned when the user is not authorized to list Assets." }, "429": { "description": "Returned when a user exceeds their subscription's rate limit for requests." } }, "parameters": [ { "name": "page_size", "description": "Maximum results per page.", "in": "query", "required": false, "type": "integer", "format": "int32" }, { "name": "page_token", "description": "The next_page_token returned from a previous list request if any.", "in": "query", "required": false, "type": "string" }, { "name": "order_by", "description": "Specify the sort order for the results.", "in": "query", "required": false, "type": "string", "enum": [ "DEFAULT", "SIMPLEHASHV1", "SIMPLEHASHV2" ], "default": "DEFAULT" }, { "name": "tracked", "description": "indicates whether asset is still being tracked in the system", "in": "query", "required": false, "type": "string", "enum": [ "TRACKED_STATUS_UNSPECIFIED", "TRACKED", "NOT_TRACKED", "ANY" ], "default": "TRACKED_STATUS_UNSPECIFIED" }, { "name": "confirmation_status", "description": "indicates if the asset has been succesfully committed to the blockchain\n\n - PENDING: Not yet stored\n - CONFIRMED: A tree root including the event has been signed by DataTrails\n - FAILED: Permanent failure\n - STORED: In database, awaiting verifiable commitment\n - COMMITTED: The stored event is verifiable\n - UNEQUIVOCAL: Provable independent of DataTrails", "in": "query", "required": false, "type": "string", "enum": [ "CONFIRMATION_STATUS_UNSPECIFIED", "PENDING", "CONFIRMED", "FAILED", "STORED", "COMMITTED", "UNEQUIVOCAL" ], "default": "CONFIRMATION_STATUS_UNSPECIFIED" }, { "name": "attributes[string]", "description": "user defined attributes key max_length: 1024 value max_length: 4096\n\nThis is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18", "in": "query", "required": false, "type": "string" }, { "name": "proof_mechanism", "description": "proof mechanism of the asset (and all its events)\n\nthe mechanism used to provide evidential proof", "in": "query", "required": false, "type": "string", "enum": [ "PROOF_MECHANISM_UNSPECIFIED", "RESERVED1", "SIMPLE_HASH", "MERKLE_LOG" ], "default": "PROOF_MECHANISM_UNSPECIFIED" }, { "name": "chain_id", "description": "chain id of the blockchain associated with this asset", "in": "query", "required": false, "type": "string" }, { "name": "privacy", "description": "privacy filter of the asset (and all its events)\n\nthe privacy status of the asset", "in": "query", "required": false, "type": "string", "enum": [ "PRIVACY_UNSPECIFIED", "RESTRICTED", "PUBLIC" ], "default": "PRIVACY_UNSPECIFIED" } ], "tags": [ "Assets and Events" ] }, "post": { "summary": "Create an Asset", "description": "Creates an Asset", "operationId": "Assets_CreateAsset", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v2AssetResponse" } }, "401": { "description": "Returned when the user is not authenticated to the system." }, "402": { "description": "Returned when the number of assets would exceed the user's quota" }, "403": { "description": "Returned when the user is not authorized to create an Asset." }, "429": { "description": "Returned when a user exceeds their subscription's rate limit for requests." } }, "parameters": [ { "name": "body", "description": "This describes the body of a request to create a new Asset.", "in": "body", "required": true, "schema": { "$ref": "#/definitions/v2CreateAssetRequest" } } ], "tags": [ "Assets and Events" ] } }, "/archivist/v2/assets/{asset_uuid}/events/{uuid}": { "get": { "summary": "Retrieves Event", "description": "Retrieves a specific Event", "operationId": "Assets_GetEvent", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v2EventResponse" } }, "401": { "description": "Returned when the user is not authenticated to the system." }, "403": { "description": "Returned when the user is not authorized to view Event." }, "404": { "description": "Returned when the event does not exist." }, "429": { "description": "Returned when a user exceeds their subscription's rate limit for requests." } }, "parameters": [ { "name": "asset_uuid", "description": "Specify the Asset UUID where `assets/{asset_uuid}/events/{uuid}` is the Event Identity e.g. `add30235-1424-4fda-840a-d5ef82c4c96f` from Identity `assets/add30235-1424-4fda-840a-d5ef82c4c96f/events/11bf5b37-e0b8-42e0-8dcf-dc8c4aefc000`", "in": "path", "required": true, "type": "string" }, { "name": "uuid", "description": "Specify the Event UUID where `assets/{asset_uuid}/events/{uuid}` is the Event Identity e.g. `11bf5b37-e0b8-42e0-8dcf-dc8c4aefc000` from Identity `assets/add30235-1424-4fda-840a-d5ef82c4c96f/events/11bf5b37-e0b8-42e0-8dcf-dc8c4aefc000`", "in": "path", "required": true, "type": "string" } ], "tags": [ "Assets and Events" ] } }, "/archivist/v2/assets/{asset_uuid}/events/{uuid}:publicurl": { "get": { "summary": "Retrieves the public url for a specific Event.", "description": "Retrieves the public url for a specific Event.", "operationId": "Assets_GetEventPublicURL", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v2PublicEventURLResponse" } }, "401": { "description": "Returned when the user is not authenticated to the system." }, "403": { "description": "Returned when the user is not authorized to view an Asset." }, "404": { "description": "Returned when the asset with the id does not exist." }, "429": { "description": "Returned when a user exceeds their subscription's rate limit for requests." } }, "parameters": [ { "name": "asset_uuid", "description": "Specify the Asset UUID where `assets/{asset_uuid}/events/{uuid}` is the Event Identity e.g. `add30235-1424-4fda-840a-d5ef82c4c96f` from Identity `assets/add30235-1424-4fda-840a-d5ef82c4c96f/events/11bf5b37-e0b8-42e0-8dcf-dc8c4aefc000`", "in": "path", "required": true, "type": "string" }, { "name": "uuid", "description": "Specify the Event UUID where `assets/{asset_uuid}/events/{uuid}` is the Event Identity e.g. `11bf5b37-e0b8-42e0-8dcf-dc8c4aefc000` from Identity `assets/add30235-1424-4fda-840a-d5ef82c4c96f/events/11bf5b37-e0b8-42e0-8dcf-dc8c4aefc000`", "in": "path", "required": true, "type": "string" } ], "tags": [ "Assets and Events" ] } }, "/archivist/v2/assets/{uuid}": { "get": { "summary": "Retrieves a specific Asset", "description": "Retrieves a specific Asset", "operationId": "Assets_GetAsset", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v2AssetResponse" } }, "401": { "description": "Returned when the user is not authenticated to the system." }, "403": { "description": "Returned when the user is not authorized to view an Asset." }, "404": { "description": "Returned when the asset with the id does not exist." }, "429": { "description": "Returned when a user exceeds their subscription's rate limit for requests." } }, "parameters": [ { "name": "uuid", "description": "Specify the Asset UUID where `assets/{uuid}` is the Asset Identity e.g. `add30235-1424-4fda-840a-d5ef82c4c96f` from Identity `assets/add30235-1424-4fda-840a-d5ef82c4c96f`", "in": "path", "required": true, "type": "string" }, { "name": "at_time", "description": "Specify time in the past to show asset data as it was at time specified", "in": "query", "required": false, "type": "string", "format": "date-time" } ], "tags": [ "Assets and Events" ] } }, "/archivist/v2/assets/{uuid}/events": { "get": { "summary": "List Events", "description": "Lists Events", "operationId": "Assets_ListEvents", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v2ListEventsResponse" } }, "206": { "description": "The number of events exceeds the servers limit. The approximate number of matching results is provided by the x-total-count header, the exact limit is available in the content-range header. The value format is 'items 0-LIMIT/TOTAL'. Note that x-total-count is always present for 200 and 206 responses. It is the servers best available approximation. Similarly, in any result set, you may get a few more than LIMIT items." }, "401": { "description": "Returned when the user is not authenticated to the system." }, "403": { "description": "Returned when the user is not authorized to list Events." }, "429": { "description": "Returned when a user exceeds their subscription's rate limit for requests." } }, "parameters": [ { "name": "uuid", "description": "Specify the Asset UUID where `assets/{uuid}` is the Asset Identity e.g. `add30235-1424-4fda-840a-d5ef82c4c96f` from Identity `assets/add30235-1424-4fda-840a-d5ef82c4c96f`. Use `-` to list Events for all Assets", "in": "path", "required": true, "type": "string" }, { "name": "page_size", "description": "Maximum results per page.", "in": "query", "required": false, "type": "integer", "format": "int32" }, { "name": "page_token", "description": "The next_page_token returned from a previous list request if any.", "in": "query", "required": false, "type": "string" }, { "name": "order_by", "description": "Specify the sort order for the results.", "in": "query", "required": false, "type": "string", "enum": [ "DEFAULT", "SIMPLEHASHV1", "SIMPLEHASHV2" ], "default": "DEFAULT" }, { "name": "confirmation_status", "description": "indicates if the asset has been succesfully committed to the blockchain\n\n - PENDING: Not yet stored\n - CONFIRMED: A tree root including the event has been signed by DataTrails\n - FAILED: Permanent failure\n - STORED: In database, awaiting verifiable commitment\n - COMMITTED: The stored event is verifiable\n - UNEQUIVOCAL: Provable independent of DataTrails", "in": "query", "required": false, "type": "string", "enum": [ "CONFIRMATION_STATUS_UNSPECIFIED", "PENDING", "CONFIRMED", "FAILED", "STORED", "COMMITTED", "UNEQUIVOCAL" ], "default": "CONFIRMATION_STATUS_UNSPECIFIED" }, { "name": "principal_declared.issuer", "description": "optional issuer of the principal identity. Where the issuer is not provided the subject is treated as a free string", "in": "query", "required": false, "type": "string" }, { "name": "principal_declared.subject", "description": "unique identifier of the principal (within issuer context)", "in": "query", "required": false, "type": "string" }, { "name": "principal_declared.display_name", "description": "The displayable name of the end-user. The name claim is prefered, followed by email claims, then a composite of given_name, middle_name, family_name", "in": "query", "required": false, "type": "string" }, { "name": "principal_declared.email", "description": "The email for the end-user if available. If email_verified is available it is preferd. Empty if neither email_verified or email are provided by the IdP", "in": "query", "required": false, "type": "string" }, { "name": "principal_accepted.issuer", "description": "optional issuer of the principal identity. Where the issuer is not provided the subject is treated as a free string", "in": "query", "required": false, "type": "string" }, { "name": "principal_accepted.subject", "description": "unique identifier of the principal (within issuer context)", "in": "query", "required": false, "type": "string" }, { "name": "principal_accepted.display_name", "description": "The displayable name of the end-user. The name claim is prefered, followed by email claims, then a composite of given_name, middle_name, family_name", "in": "query", "required": false, "type": "string" }, { "name": "principal_accepted.email", "description": "The email for the end-user if available. If email_verified is available it is preferd. Empty if neither email_verified or email are provided by the IdP", "in": "query", "required": false, "type": "string" }, { "name": "timestamp_accepted_since", "description": "Filtering\n\nOnly list events when timestamp_accepted is greater", "in": "query", "required": false, "type": "string", "format": "date-time" }, { "name": "timestamp_accepted_before", "description": "Only list events when timestamp_accepted is lesser", "in": "query", "required": false, "type": "string", "format": "date-time" }, { "name": "timestamp_committed_since", "description": "Only list events when timestamp_committed is greater", "in": "query", "required": false, "type": "string", "format": "date-time" }, { "name": "timestamp_committed_before", "description": "Only list events when timestamp_committed is lesser", "in": "query", "required": false, "type": "string", "format": "date-time" }, { "name": "timestamp_declared_since", "description": "Only list events when timestamp_declared is greater", "in": "query", "required": false, "type": "string", "format": "date-time" }, { "name": "timestamp_declared_before", "description": "Only list events when timestamp_declared is lesser", "in": "query", "required": false, "type": "string", "format": "date-time" }, { "name": "operation", "in": "query", "required": false, "type": "string" }, { "name": "behaviour", "in": "query", "required": false, "type": "string" }, { "name": "event_attributes[string][string]", "description": "user defined event_attributes key max_length: 1024 value max_length: 4096\n\nThis is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18", "in": "query", "required": false, "type": "string" }, { "name": "asset_attributes[string][string]", "description": "user defined asset_attributes key max_length: 1024 value max_length: 4096\n\nThis is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18", "in": "query", "required": false, "type": "string" }, { "name": "asset.attributes[string][string]", "description": "This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18", "in": "query", "required": false, "type": "string" }, { "name": "proof_mechanism", "description": "mechanism for evidential proof for Events on this Asset\n\nspecify the mechanism used to provide evidential proof for Events on this Asset", "in": "query", "required": false, "type": "string", "enum": [ "PROOF_MECHANISM_UNSPECIFIED", "RESERVED1", "SIMPLE_HASH", "MERKLE_LOG" ], "default": "PROOF_MECHANISM_UNSPECIFIED" }, { "name": "mmr_index", "description": "filter events by mmr index", "in": "query", "required": false, "type": "string", "format": "int64" }, { "name": "from", "description": "filter from wallet address", "in": "query", "required": false, "type": "string" }, { "name": "minimum_trust", "description": "specify the minimum trust level for Events COMMITTED -> COMMITTED, CONFIRMED, UNEQUIVOCAL CONFIRMED -> CONFIRMED, UNEQUIVOCAL UNEQUIVOCAL -> UNEQUIVOCAL\n\n - PENDING: Not yet stored\n - CONFIRMED: A tree root including the event has been signed by DataTrails\n - FAILED: Permanent failure\n - STORED: In database, awaiting verifiable commitment\n - COMMITTED: The stored event is verifiable\n - UNEQUIVOCAL: Provable independent of DataTrails", "in": "query", "required": false, "type": "string", "enum": [ "CONFIRMATION_STATUS_UNSPECIFIED", "PENDING", "CONFIRMED", "FAILED", "STORED", "COMMITTED", "UNEQUIVOCAL" ], "default": "CONFIRMATION_STATUS_UNSPECIFIED" }, { "name": "transaction_id", "description": "hash of transaction commiting this event to blockchain", "in": "query", "required": false, "type": "string" } ], "tags": [ "Assets and Events" ] }, "post": { "summary": "Creates an Event", "description": "Creates an Event", "operationId": "Events_Create", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v2EventResponse" } }, "401": { "description": "Returned when the user is not authenticated to the system." }, "402": { "description": "Returned when the user's quota of Events has been reached." }, "429": { "description": "Returned when a user exceeds their subscription's rate limit for requests." } }, "parameters": [ { "name": "uuid", "description": "Specify the Asset UUID where `assets/{uuid}` is the Asset Identity e.g. `add30235-1424-4fda-840a-d5ef82c4c96f` from Identity `assets/add30235-1424-4fda-840a-d5ef82c4c96f`", "in": "path", "required": true, "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EventsCreateBody" } } ], "tags": [ "Assets and Events" ] } }, "/archivist/v2/assets/{uuid}:publicurl": { "get": { "summary": "Retrieves the public url for a specific Asset.", "description": "Retrieves the public url for a specific Asset.", "operationId": "Assets_GetAssetPublicURL", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v2PublicAssetURLResponse" } }, "401": { "description": "Returned when the user is not authenticated to the system." }, "403": { "description": "Returned when the user is not authorized to view an Asset." }, "404": { "description": "Returned when the asset with the id does not exist." }, "429": { "description": "Returned when a user exceeds their subscription's rate limit for requests." } }, "parameters": [ { "name": "uuid", "description": "Specify the Asset UUID where `assets/{uuid}` is the Asset Identity e.g. `add30235-1424-4fda-840a-d5ef82c4c96f` from Identity `assets/add30235-1424-4fda-840a-d5ef82c4c96f`", "in": "path", "required": true, "type": "string" } ], "tags": [ "Assets and Events" ] } } }, "definitions": { "EventsCreateBody": { "type": "object", "example": { "operation": "Record", "behaviour": "RecordEvidence", "event_attributes": { "arc_display_type": "Paint", "arc_description": "Painted the fence" }, "asset_attributes": { "colour": "Midnight Blue" } }, "properties": { "behaviour": { "type": "string", "title": "name of this behaviour" }, "operation": { "type": "string", "title": "name of operation on this behviour" }, "principal_declared": { "$ref": "#/definitions/v2Principal", "title": "principal information associated with event - if not provided will be set to principal_accepted" }, "timestamp_declared": { "type": "string", "format": "date-time", "description": "time of event as declared by the user", "title": "timestamp when operation was actually performed - if not provided will be set to timestamp_accepted", "readOnly": true }, "event_attributes": { "type": "object", "additionalProperties": { "$ref": "#/definitions/v2Attribute" }, "description": "key value mapping of event attributes" }, "asset_attributes": { "type": "object", "additionalProperties": { "$ref": "#/definitions/v2Attribute" }, "description": "key value mapping of asset attributes" } }, "description": "Request creating RecordEvidence event Specify `operation` to chose which RecordEvidence event to create ", "required": [ "behaviour", "operation" ] }, "ListEventsRequestAssetQuery": { "type": "object", "properties": { "attributes[string][string]": { "type": "object", "additionalProperties": { "type": "string" }, "description": "key value mapping of asset attributes" } } }, "v1Cap": { "type": "object", "properties": { "resource_type": { "type": "string", "description": "String identifying the capped resource type" }, "resource_remaining": { "type": "string", "format": "int64", "description": "Number of capped resources remaining" }, "resource_cap": { "type": "string", "format": "int64", "description": "Resource cap" } } }, "v1Caps": { "type": "object", "properties": { "caps": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/v1Cap" }, "description": "List of relevant capped resources" } } }, "v1Filter": { "type": "object", "example": { "or": [ "group=maintainers", "group=supervisors" ] }, "properties": { "or": { "type": "array", "items": { "type": "string" }, "description": "The filter list" } }, "description": "Filter" }, "v2AssetResponse": { "type": "object", "example": { "identity": "assets/add30235-1424-4fda-840a-d5ef82c4c96f", "behaviours": [ "RecordEvidence" ], "attributes": { "arc_display_type": "Garden Fence", "arc_display_name": "My Garden Fence", "colour": "Plain wood" }, "confirmation_status": "PENDING", "tracked": "TRACKED", "owner": "0x601f5A7D3e6dcB55e87bf2F17bC8A27AaCD3511", "at_time": "2019-11-27T14:44:19Z", "proof_mechanism": "MERKLE_LOG", "public": false, "tenant_identity": "tenant/8e0b600c-8234-43e4-860c-e95bdcd695a9" }, "properties": { "identity": { "type": "string", "description": "relative resource address `assets/{UUID}`", "title": "asset identity", "readOnly": true }, "behaviours": { "type": "array", "items": { "type": "string" }, "description": "list of behaviours enabled for this asset", "title": "list of enabled behaviours" }, "attributes": { "type": "object", "additionalProperties": { "$ref": "#/definitions/v2Attribute" }, "description": "key value mapping of asset properties", "title": "all the assets attributes" }, "confirmation_status": { "type": "string", "$ref": "#/definitions/v2ConfirmationStatus", "description": "indicates if the asset has been succesfully committed to the blockchain", "title": "indicated if asset has been committed to the blockchain, possible values are CONFIRMED for committed, PENDING for not yet committed or FAILED for permanent failure", "readOnly": true }, "tracked": { "type": "string", "$ref": "#/definitions/v2TrackedStatus", "description": "indicates whether asset is still being tracked in the system", "title": "indicates if asset is being tracked in the system TRACKED or NOT_TRACKED", "readOnly": true }, "owner": { "type": "string", "description": "wallet address of the asset owner", "title": "wallet address for the owner of this asset", "readOnly": true }, "at_time": { "type": "string", "format": "date-time", "description": "indicates time the asset data is from", "readOnly": true }, "proof_mechanism": { "type": "string", "$ref": "#/definitions/v2ProofMechanism", "description": "the mechanism used to provide evidential proof" }, "chain_id": { "type": "string", "description": "chain id of the blockchain associated with this asset", "readOnly": true }, "public": { "type": "boolean", "description": "Public asset" }, "tenant_identity": { "type": "string", "description": "Identity of the tenant the that created this asset", "maxLength": 1024 } }, "description": "This describes an Asset." }, "v2Attribute": { "type": "object", "properties": { "str_val": { "type": "string" }, "dict_val": { "$ref": "#/definitions/v2DictAttr" }, "list_val": { "$ref": "#/definitions/v2ListAttr" } } }, "v2ConfirmationStatus": { "type": "string", "enum": [ "CONFIRMATION_STATUS_UNSPECIFIED", "PENDING", "CONFIRMED", "FAILED", "STORED", "COMMITTED", "UNEQUIVOCAL" ], "default": "CONFIRMATION_STATUS_UNSPECIFIED", "title": "- PENDING: Not yet stored\n - CONFIRMED: A tree root including the event has been signed by DataTrails\n - FAILED: Permanent failure\n - STORED: In database, awaiting verifiable commitment\n - COMMITTED: The stored event is verifiable\n - UNEQUIVOCAL: Provable independent of DataTrails" }, "v2CreateAssetRequest": { "type": "object", "example": { "behaviours": [ "RecordEvidence" ], "attributes": { "arc_display_type": "Garden Fence", "arc_display_name": "My Garden Fence", "colour": "Plain wood" }, "proof_mechanism": "MERKLE_LOG", "public": false }, "properties": { "behaviours": { "type": "array", "items": { "type": "string", "maxLength": 1024 }, "description": "list of behaviours enabled for this asset", "title": "list of enabled behaviours" }, "attributes": { "type": "object", "additionalProperties": { "$ref": "#/definitions/v2Attribute" }, "description": "key value mapping of event attributes", "title": "event attributes for the assets creation", "maxLength": 1024 }, "proof_mechanism": { "type": "string", "$ref": "#/definitions/v2ProofMechanism", "description": "specify the mechanism used to provide evidential proof for Events on this Asset", "title": "mechanism for evidential proof for Events on this Asset" }, "chain_id": { "type": "string", "description": "chain id of the blockchain associated with this asset", "maxLength": 1024 }, "public": { "type": "boolean", "description": "Public asset. A public asset and all its events are visible to the general public.Sharing to specific organisations is not available for public assets." } }, "description": "This describes the body of a request to create a new Asset." }, "v2DictAttr": { "type": "object", "properties": { "value": { "type": "object", "additionalProperties": { "type": "string" } } } }, "v2EventResponse": { "type": "object", "example": { "identity": "assets/add30235-1424-4fda-840a-d5ef82c4c96f/events/11bf5b37-e0b8-42e0-8dcf-dc8c4aefc000", "asset_identity": "assets/add30235-1424-4fda-840a-d5ef82c4c96f", "operation": "Record", "behaviour": "RecordEvidence", "event_attributes": { "arc_display_type": "Paint", "arc_description": "Painted the fence" }, "asset_attributes": { "colour": "Midnight Blue" }, "timestamp_accepted": "2019-11-27T14:44:19Z", "timestamp_declared": "2019-11-27T14:44:19Z", "timestamp_committed": "2019-11-27T14:44:19Z", "principal_declared": { "issuer": "job.idp.server/1234", "subject": "bob@job" }, "principal_accepted": { "issuer": "job.idp.server/1234", "subject": "bob@job" }, "confirmation_status": "CONFIRMED", "block_number": 12, "transaction_index": 5, "transaction_id": "0x07569", "tenant_identity": "tenant/8e0b600c-8234-43e4-860c-e95bdcd695a9" }, "properties": { "identity": { "type": "string", "description": "identity of a event resource", "title": "Relative Resource Name for the operation event", "readOnly": true }, "asset_identity": { "type": "string", "description": "identity of a related asset resource `assets/11bf5b37-e0b8-42e0-8dcf-dc8c4aefc000`", "title": "relative resource name for associated asset ( asset the operation is performed on - has to have specific behaviour enabled)", "readOnly": true }, "event_attributes": { "type": "object", "additionalProperties": { "$ref": "#/definitions/v2Attribute" }, "description": "key value mapping of event attributes" }, "asset_attributes": { "type": "object", "additionalProperties": { "$ref": "#/definitions/v2Attribute" }, "description": "key value mapping of asset attributes" }, "operation": { "type": "string", "description": "The operation represented by the event. `Record`", "title": "name of operation on this behviour", "readOnly": true, "maxLength": 4096 }, "behaviour": { "type": "string", "description": "The behaviour used to create event. `RecordEvidence`", "title": "name of this behaviour", "readOnly": true, "maxLength": 4096 }, "timestamp_declared": { "type": "string", "format": "date-time", "description": "time of event as declared by the user", "title": "timestamp when operation was actually performed - if not provided will be set to timestamp_accepted", "readOnly": true }, "timestamp_accepted": { "type": "string", "format": "date-time", "description": "time of event as recorded by the server", "title": "timestamp when system received operation request", "readOnly": true }, "timestamp_committed": { "type": "string", "format": "date-time", "description": "time of event as recorded in verifiable storage", "title": "timestamp for when the event was committed to a verifiable log", "readOnly": true }, "principal_declared": { "type": "object", "$ref": "#/definitions/v2Principal", "description": "principal provided by the user", "title": "principal information associated with event - if not provided will be set to principal_accepted", "readOnly": true }, "principal_accepted": { "type": "object", "$ref": "#/definitions/v2Principal", "description": "principal recorded by the server", "title": "principal logged into the system that performed the operation", "readOnly": true }, "confirmation_status": { "type": "string", "$ref": "#/definitions/v2ConfirmationStatus", "description": "indicates if the event has been succesfully committed to the blockchain", "title": "indicated if operation has been committed to the blockchain", "readOnly": true }, "transaction_id": { "type": "string", "description": "hash of the transaction as a hex string `0x11bf5b37e0b842e08dcfdc8c4aefc000`", "title": "hash of transaction committing this operation on blockchain", "maxLength": 4096 }, "block_number": { "type": "string", "format": "uint64", "description": "number of block event was commited on", "title": "block number of committing transaction", "readOnly": true }, "transaction_index": { "type": "string", "format": "uint64", "description": "index of event within commited block", "title": "transaction index of committing transaction", "readOnly": true }, "from": { "type": "string", "description": "wallet address for the creator of this event", "title": "wallet address for the creator of this event", "readOnly": true }, "tenant_identity": { "type": "string", "description": "Identity of the tenant the that created this event", "maxLength": 1024 }, "merklelog_entry": { "type": "object", "$ref": "#/definitions/v2MerkleLogEntry", "description": "verifiable merkle mmr log entry details", "title": "proof details for proof_mechanism MERKLE_LOG" } }, "description": "This describes an Event." }, "v2ListAssetsRequestOrderBy": { "type": "string", "enum": [ "DEFAULT", "SIMPLEHASHV1", "SIMPLEHASHV2" ], "default": "DEFAULT", "title": "Supported sort orders" }, "v2ListAssetsResponse": { "type": "object", "example": { "assets": [ { "identity": "assets/add30235-1424-4fda-840a-d5ef82c4c96f", "behaviours": [ "RecordEvidence" ], "attributes": { "arc_display_type": "Garden Fence", "arc_display_name": "My Garden Fence", "colour": "Plain wood" }, "confirmation_status": "PENDING", "tracked": "TRACKED", "owner": "0x601f5A7D3e6dcB55e87bf2F17bC8A27AaCD3511", "at_time": "2019-11-27T14:44:19Z", "proof_mechanism": "MERKLE_LOG", "public": false, "tenant_identity": "tenant/8e0b600c-8234-43e4-860c-e95bdcd695a9" }, { "identity": "assets/cef61346-2453-5aeb-921c-e6fa93d5b032", "behaviours": [ "RecordEvidence" ], "attributes": { "arc_display_type": "IoT Device", "arc_display_name": "My IoT Device", "arc_firmware_version": "3.2.1" }, "confirmation_status": "PENDING", "tracked": "TRACKED", "owner": "0x601f5A7D3e6dcB55e87bf2F17bC8A27AaCD3511", "at_time": "2019-11-27T14:44:19Z", "proof_mechanism": "MERKLE_LOG", "public": false, "tenant_identity": "tenant/8e0b600c-8234-43e4-860c-e95bdcd695a9" } ], "next_page_token": "abcd" }, "properties": { "assets": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/v2AssetResponse" } }, "next_page_token": { "type": "string", "description": "Token to retrieve the next page of results or empty if there are none." } }, "description": "A list of assets returned data identical to `Asset`" }, "v2ListAttr": { "type": "object", "properties": { "value": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/v2DictAttr" } } } }, "v2ListEventsRequestOrderBy": { "type": "string", "enum": [ "DEFAULT", "SIMPLEHASHV1", "SIMPLEHASHV2" ], "default": "DEFAULT", "title": "Supported sort orders" }, "v2ListEventsResponse": { "type": "object", "example": { "events": [ { "identity": "assets/add30235-1424-4fda-840a-d5ef82c4c96f/events/11bf5b37-e0b8-42e0-8dcf-dc8c4aefc000", "asset_identity": "assets/add30235-1424-4fda-840a-d5ef82c4c96f", "operation": "Record", "behaviour": "RecordEvidence", "event_attributes": { "arc_display_type": "Paint", "arc_description": "Painted the fence" }, "asset_attributes": { "colour": "Midnight Blue" }, "timestamp_accepted": "2019-11-27T14:44:19Z", "timestamp_declared": "2019-11-27T14:44:19Z", "timestamp_committed": "2019-11-27T14:44:19Z", "principal_declared": { "issuer": "job.idp.server/1234", "subject": "bob@job" }, "principal_accepted": { "issuer": "job.idp.server/1234", "subject": "bob@job" }, "confirmation_status": "CONFIRMED", "block_number": 12, "transaction_index": 5, "transaction_id": "0x07569", "tenant_identity": "tenant/8e0b600c-8234-43e4-860c-e95bdcd695a9" }, { "identity": "assets/bf330235-1424-4fda-840a-d5ef82c4c96f/events/23c06c48-e0b8-42e0-8dcf-dc8c4fdad123", "asset_identity": "assets/bf330235-1424-4fda-840a-d5ef82c4c96f", "operation": "Record", "behaviour": "RecordEvidence", "event_attributes": { "arc_display_type": "Update Firmware" }, "asset_attributes": { "arc_firmware_version": "3.2.1" }, "timestamp_accepted": "2019-07-27T14:44:19Z", "timestamp_declared": "2019-07-27T14:44:19Z", "timestamp_committed": "2019-07-27T14:44:19Z", "principal_declared": { "issuer": "job.idp.server/1234", "subject": "bob@job" }, "principal_accepted": { "issuer": "job.idp.server/1234", "subject": "bob@job" }, "confirmation_status": "CONFIRMED", "block_number": 13, "transaction_index": 6, "transaction_id": "0x12569", "tenant_identity": "tenant/8e0b600c-8234-43e4-860c-e95bdcd695a9" } ], "next_page_token": "abcd" }, "properties": { "events": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/v2EventResponse" } }, "next_page_token": { "type": "string", "description": "Token to retrieve the next page of results or empty if there are none." } }, "description": "A list of event records returned data identical to `EventRecord`" }, "v2MerkleLogCommit": { "type": "object", "properties": { "index": { "type": "string", "format": "uint64", "title": "The mmr index" }, "idtimestamp": { "type": "string", "description": "time ordered and strictly unique per tenant. system wide unique with very\nreasonable operational assumptions. prefixed with time epoch if len > 8\nbytes (after conversion back from hex)." } }, "description": "MerkeLogCommit provides the log entry details for a single mmr leaf." }, "v2MerkleLogConfirm": { "type": "object", "properties": { "mmr_size": { "type": "string", "format": "uint64", "title": "The following correspond to mmrblobs.MMRState" }, "root": { "type": "string", "format": "byte" }, "timestamp": { "type": "string", "format": "int64", "title": "The regular unix time the root was signed" }, "idtimestamp": { "type": "string", "title": "The idtimestamp of the last leaf under mmr_size. prefixed with time epoch if len > 8 bytes (after conversion back from hex)" }, "signed_tree_head": { "type": "string", "format": "byte", "description": "The signed merkle tree head state at mmr_size. Contains COSE Sign1 formatted message." } } }, "v2MerkleLogEntry": { "type": "object", "properties": { "commit": { "$ref": "#/definitions/v2MerkleLogCommit", "title": "Event trust level COMMITTED details" }, "confirm": { "$ref": "#/definitions/v2MerkleLogConfirm", "title": "Event trust level CONFIRMED details" }, "unequivocal": { "$ref": "#/definitions/v2MerkleLogUnequivocal", "title": "Event trust level UNEQUIVOCAL details" } }, "title": "The details stored in the SaaS db for a proof mech MERKLE_LOG commitment" }, "v2MerkleLogUnequivocal": { "type": "object" }, "v2Principal": { "type": "object", "example": { "issuer": "job.idp.server/1234", "subject": "bob@job" }, "properties": { "issuer": { "type": "string", "description": "optional issuer of the principal identity. Where the issuer is not provided the subject is treated as a free string", "maxLength": 1024 }, "subject": { "type": "string", "description": "unique identifier of the principal (within issuer context)", "maxLength": 1024 }, "display_name": { "type": "string", "description": "The displayable name of the end-user. The name claim is prefered, followed by email claims, then a composite of given_name, middle_name, family_name", "maxLength": 1024 }, "email": { "type": "string", "description": "The email for the end-user if available. If email_verified is available it is preferd. Empty if neither email_verified or email are provided by the IdP", "maxLength": 1024 } }, "description": "The principal description assured by the configured Identity Provider. All values are according to OIDC id token claims and standard claims. See https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims" }, "v2Privacy": { "type": "string", "enum": [ "PRIVACY_UNSPECIFIED", "RESTRICTED", "PUBLIC" ], "default": "PRIVACY_UNSPECIFIED" }, "v2ProofMechanism": { "type": "string", "enum": [ "PROOF_MECHANISM_UNSPECIFIED", "RESERVED1", "SIMPLE_HASH", "MERKLE_LOG" ], "default": "PROOF_MECHANISM_UNSPECIFIED" }, "v2PublicAssetURLResponse": { "type": "object", "example": { "publicurl": "https://app.datatrails.ai/archivist/v2/publicassets/add30235-1424-4fda-840a-d5ef82c4c96f" }, "properties": { "publicurl": { "type": "string" } }, "description": "A url that can be used to access the public asset.", "title": "PublicAssetURLResponse is the public url response when calling the :publicurl verb" }, "v2PublicEventURLResponse": { "type": "object", "example": { "publicurl": "https://app.datatrails.ai/archivist/v2/publicassets/add30235-1424-4fda-840a-d5ef82c4c96f/events/11bf5b37-e0b8-42e0-8dcf-dc8c4aefc000" }, "properties": { "publicurl": { "type": "string" } }, "description": "A url that can be used to access the public event.", "title": "PublicEventURLResponse is the public url response when calling the :publicurl verb" }, "v2TrackedStatus": { "type": "string", "enum": [ "TRACKED_STATUS_UNSPECIFIED", "TRACKED", "NOT_TRACKED", "ANY" ], "default": "TRACKED_STATUS_UNSPECIFIED" } } }