Download OpenAPI specification:Download
A REST API providing HTTP/JSON interface to Grid.
This endpoint can be used to submit batches to the underlying distributed ledger. The operation called by this endpoint will depend on which distributed ledger is supporting this deployment of Grid. Regardless of the underlying ledger, the body of this request must be a valid list of Sabre batches.
If the Grid Daemon is running against a Sawtooth distributed ledger,
then the batches are forwarded to the /batches endpoint of the
Sawtooth REST API.
If the Grid Daemon is running against Splinter, then the service_id
query parameter is required for this request. The Grid Daemon will use
the service ID to forward the transaction to an endpoint on the Splinter
Daemon for the Scabbard service corresponding to the provided service
ID.
The API will return immediately with a status of 202. There will be
no data object, only a link to a /batch_statuses endpoint to be
polled to check the status of submitted batches.
| service_id | string The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id> |
| wait | integer The number of seconds to wait for batches to be committed before returning. |
A binary encoded protobuf BatchList
Array of objects (Batch) |
Fetches an array of objects with a status and id for each batch
requested. There are four possible statuses with string values
'COMMITTED', 'INVALID', 'PENDING', and 'UNKNOWN'.
The batch(es) you want to check can be specified using the id filter
parameter. If a wait time is specified in the URL, the API will wait
to respond until all batches are committed, or the time in seconds has
elapsed. If the value of wait is not set (i.e., ?wait&id=...), or
it is set to any non-integer value other than false, the wait time
will be just under the API's specified timeout (usually 300).
Note that because this route does not return full resources, the
response will not be paginated, and there will be no head or
paging properties.
| id required | string A comma-separated list of batch IDs |
| wait | integer The number of seconds to wait for batches to be committed before returning. |
| service_id | string The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id> |
[- {
- "id": "89807bfc9089e37e00d87d97357de14cfbc455cd608438d426a625a30a0da9a31c406983803c4aa27e1f32a3ff61709e8ec4b56abbc553d7d330635b5d27029c",
- "status": "INVALID",
- "invalid_transactions": [
- {
- "id": "540a6803971d1880ec73a96cb97815a95d374cbad5d865925e5aa0432fcf1931539afe10310c122c5eaae15df61236079abbf4f258889359c4d175516934484a",
- "message": "Verb is \\\"inc\\\" but name \\\"foo\\\" not in state\n",
- "extended_data": "ZXJyb3IgZGF0YQ==",
}
]
}
]| service_id | string The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id> |
| offset | integer The index of the first element to be in the page |
| limit | integer The maximum number of elements in a page |
{- "data": [
- {
- "location_id": 99474000005,
- "location_namespace": "UNSET_NAMESPACE",
- "owner": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
- "properties": [
- {
- "name": "brand_name",
- "data_type": "boolean",
- "bytes_value": "AQIDBA==",
- "boolean_value": false,
- "number_value": 0,
- "string_value": "mybrand",
- "enum_value": 0,
- "struct_values": [
- {
- "name": "location",
- "type": "BYTES",
- "value": "AQIDBA=="
}
], - "lat_long_value": {
- "latitude": 46786299,
- "longitude": -92051336
}, - "service_id": "12345-QWERTY:gsAA"
}
], - "service_id": "12345-QWERTY:gsAA"
}
], - "paging": {
- "current": "/agent?offset0&limit=10",
- "offset": 0,
- "limit": 10,
- "total": 1000,
- "prev": "/agent?offset=0&limit=10",
- "next": "/agent?offset=10&limit=10",
- "last": "/agent?offset100&limit=10"
}
}| location_id required | string ID of the location to fetch |
| service_id | string The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id> |
{- "location_id": 99474000005,
- "location_namespace": "UNSET_NAMESPACE",
- "owner": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
- "properties": [
- {
- "name": "brand_name",
- "data_type": "boolean",
- "bytes_value": "AQIDBA==",
- "boolean_value": false,
- "number_value": 0,
- "string_value": "mybrand",
- "enum_value": 0,
- "struct_values": [
- {
- "name": "location",
- "type": "BYTES",
- "value": "AQIDBA=="
}
], - "lat_long_value": {
- "latitude": 46786299,
- "longitude": -92051336
}, - "service_id": "12345-QWERTY:gsAA"
}
], - "service_id": "12345-QWERTY:gsAA"
}| service_id | string The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id> |
| offset | integer The index of the first element to be in the page |
| limit | integer The maximum number of elements in a page |
{- "data": [
- {
- "public_key": "038bba5708acc262464c9fe30d3de9e905a9a5fa30cedd151dd9cd09ea26d46d00",
- "org_id": 13600,
- "active": "true",
- "roles": [
- {
- "name": "alpha.Drivers",
- "org_id": 314156,
- "permissions": [
- "tank::can_drive"
], - "allowed_organizations": [
- "beta"
], - "super_roles": [
- "beta.Drivers"
], - "inherit_from": [
- "beta.Tank"
]
}
], - "metadata": [
- {
- "key": "industry",
- "value": "electronics"
}
], - "service_id": "12345-QWERTY:gsAA"
}
], - "paging": {
- "current": "/agent?offset0&limit=10",
- "offset": 0,
- "limit": 10,
- "total": 1000,
- "prev": "/agent?offset=0&limit=10",
- "next": "/agent?offset=10&limit=10",
- "last": "/agent?offset100&limit=10"
}
}| public_key required | string Public key of the agent to fetch |
| service_id | string The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id> |
{- "public_key": "038bba5708acc262464c9fe30d3de9e905a9a5fa30cedd151dd9cd09ea26d46d00",
- "org_id": 13600,
- "active": "true",
- "roles": [
- {
- "name": "alpha.Drivers",
- "org_id": 314156,
- "permissions": [
- "tank::can_drive"
], - "allowed_organizations": [
- "beta"
], - "super_roles": [
- "beta.Drivers"
], - "inherit_from": [
- "beta.Tank"
]
}
], - "metadata": [
- {
- "key": "industry",
- "value": "electronics"
}
], - "service_id": "12345-QWERTY:gsAA"
}| service_id | string The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id> |
| offset | integer The index of the first element to be in the page |
| limit | integer The maximum number of elements in a page |
{- "data": [
- {
- "id": "philips001",
- "name": "Philips",
- "locations": [
- 12276598822
], - "alternate_ids": [
- "test:test"
], - "metadata": [
- {
- "key": "industry",
- "value": "electronics"
}
], - "service_id": "12345-QWERTY:gsAA"
}
], - "paging": {
- "current": "/agent?offset0&limit=10",
- "offset": 0,
- "limit": 10,
- "total": 1000,
- "prev": "/agent?offset=0&limit=10",
- "next": "/agent?offset=10&limit=10",
- "last": "/agent?offset100&limit=10"
}
}| id required | string ID of the organization to fetch |
| service_id | string The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id> |
{- "id": "philips001",
- "name": "Philips",
- "locations": [
- 12276598822
], - "alternate_ids": [
- "test:test"
], - "metadata": [
- {
- "key": "industry",
- "value": "electronics"
}
], - "service_id": "12345-QWERTY:gsAA"
}| org_id required | string Org ID of the organization to list roles for |
| service_id | string The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id> |
| offset | integer The index of the first element to be in the page |
| limit | integer The maximum number of elements in a page |
{- "data": [
- {
- "name": "alpha.Drivers",
- "org_id": 314156,
- "permissions": [
- "tank::can_drive"
], - "allowed_organizations": [
- "beta"
], - "super_roles": [
- "beta.Drivers"
], - "inherit_from": [
- "beta.Tank"
]
}
], - "paging": {
- "current": "/agent?offset0&limit=10",
- "offset": 0,
- "limit": 10,
- "total": 1000,
- "prev": "/agent?offset=0&limit=10",
- "next": "/agent?offset=10&limit=10",
- "last": "/agent?offset100&limit=10"
}
}| org_id required | string Org ID of the organization that the role belongs to |
| name required | string Name of the role to fetch |
| service_id | string The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id> |
{- "name": "alpha.Drivers",
- "org_id": 314156,
- "permissions": [
- "tank::can_drive"
], - "allowed_organizations": [
- "beta"
], - "super_roles": [
- "beta.Drivers"
], - "inherit_from": [
- "beta.Tank"
]
}| service_id | string The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id> |
| offset | integer The index of the first element to be in the page |
| limit | integer The maximum number of elements in a page |
{- "data": [
- {
- "product_id": 122765988220,
- "product_address": "621dee0201000000000000000000000000000000000000000000000012276598822000",
- "product_namespace": "UNSET_NAMESPACE",
- "owner": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
- "properties": [
- {
- "name": "brand_name",
- "data_type": "boolean",
- "bytes_value": "AQIDBA==",
- "boolean_value": false,
- "number_value": 0,
- "string_value": "mybrand",
- "enum_value": 0,
- "struct_values": [
- {
- "name": "location",
- "type": "BYTES",
- "value": "AQIDBA=="
}
], - "lat_long_value": {
- "latitude": 46786299,
- "longitude": -92051336
}, - "service_id": "12345-QWERTY:gsAA"
}
], - "service_id": "12345-QWERTY:gsAA"
}
], - "paging": {
- "current": "/agent?offset0&limit=10",
- "offset": 0,
- "limit": 10,
- "total": 1000,
- "prev": "/agent?offset=0&limit=10",
- "next": "/agent?offset=10&limit=10",
- "last": "/agent?offset100&limit=10"
}
}| product_id required | string ID of the product to fetch |
| service_id | string The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id> |
{- "product_id": 122765988220,
- "product_address": "621dee0201000000000000000000000000000000000000000000000012276598822000",
- "product_namespace": "UNSET_NAMESPACE",
- "owner": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
- "properties": [
- {
- "name": "brand_name",
- "data_type": "boolean",
- "bytes_value": "AQIDBA==",
- "boolean_value": false,
- "number_value": 0,
- "string_value": "mybrand",
- "enum_value": 0,
- "struct_values": [
- {
- "name": "location",
- "type": "BYTES",
- "value": "AQIDBA=="
}
], - "lat_long_value": {
- "latitude": 46786299,
- "longitude": -92051336
}, - "service_id": "12345-QWERTY:gsAA"
}
], - "service_id": "12345-QWERTY:gsAA"
}| service_id | string The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id> |
| offset | integer The index of the first element to be in the page |
| limit | integer The maximum number of elements in a page |
{- "data": [
- {
- "name": "Lightbulb",
- "description": "Example Lightbulb schema",
- "owner": "philips001",
- "properties": [
- {
- "name": "size",
- "data_type": "BYTES",
- "description": "Lightbulb radius, in millimeters",
- "required": true,
- "number_exponent": -6,
- "enum_options": [
- "filament",
- "CF",
- "LED"
], - "struct_properties": [
- { }
], - "service_id": "12345-QWERTY:gsAA"
}
], - "service_id": "12345-QWERTY:gsAA"
}
], - "paging": {
- "current": "/agent?offset0&limit=10",
- "offset": 0,
- "limit": 10,
- "total": 1000,
- "prev": "/agent?offset=0&limit=10",
- "next": "/agent?offset=10&limit=10",
- "last": "/agent?offset100&limit=10"
}
}| schema_name required | string Name of the schema to fetch |
| service_id | string The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id> |
{- "name": "Lightbulb",
- "description": "Example Lightbulb schema",
- "owner": "philips001",
- "properties": [
- {
- "name": "size",
- "data_type": "BYTES",
- "description": "Lightbulb radius, in millimeters",
- "required": true,
- "number_exponent": -6,
- "enum_options": [
- "filament",
- "CF",
- "LED"
], - "struct_properties": [
- { }
], - "service_id": "12345-QWERTY:gsAA"
}
], - "service_id": "12345-QWERTY:gsAA"
}| service_id | string The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id> |
| offset | integer The index of the first element to be in the page |
| limit | integer The maximum number of elements in a page |
{- "data": [
- {
- "record_id": "7h15-45537-15-br173",
- "schema": "Lightbulb",
- "owner": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
- "custodian": "02fb5b3a093e20e420ecf9c5839215e74c97f49eb51889069eb87bc6f62ceca8dd",
- "properties": [
- {
- "name": "location",
- "record_id": "7h15-45537-15-br173",
- "data_type": "BYTES",
- "authorized_reporters": [
- [
- "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
- "0364edd42bd9b2dea1315e2da820b569665f96e36c44b267ceeac488cfdc03bf61"
]
], - "value": {
- "timestamp": 1557949075,
- "value": "string",
- "reporter": {
- "metadata": {
- "agent_name": "Smith"
}, - "public_key": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
- "service_id": "01234567-0123-0123-0123-012345678901::grid-scabbard-a"
}, - "service_id": "12345-QWERTY:gsAA"
}, - "updates": [
- {
- "timestamp": 1557949075,
- "value": "string",
- "reporter": {
- "metadata": {
- "agent_name": "Smith"
}, - "public_key": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
- "service_id": "01234567-0123-0123-0123-012345678901::grid-scabbard-a"
}, - "service_id": "12345-QWERTY:gsAA"
}
], - "service_id": "12345-QWERTY:gsAA"
}
], - "proposals": [
- {
- "receiving_agent": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
- "issuing_agent": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
- "role": "OWNER",
- "properties": [
- "string"
], - "status": "OPEN",
- "timestamp": 1557949075,
- "service_id": "12345-QWERTY:gsAA"
}
], - "owner_updates": [
- {
- "agent_id": "02fb5b3a093e20e420ecf9c5839215e74c97f49eb51889069eb87bc6f62ceca8dd",
- "timestamp": 1557949075,
- "service_id": "12345-QWERTY:gsAA"
}
], - "custodian_updates": [
- {
- "agent_id": "02fb5b3a093e20e420ecf9c5839215e74c97f49eb51889069eb87bc6f62ceca8dd",
- "timestamp": 1557949075,
- "service_id": "12345-QWERTY:gsAA"
}
], - "final": true,
- "service_id": "12345-QWERTY:gsAA"
}
], - "paging": {
- "current": "/agent?offset0&limit=10",
- "offset": 0,
- "limit": 10,
- "total": 1000,
- "prev": "/agent?offset=0&limit=10",
- "next": "/agent?offset=10&limit=10",
- "last": "/agent?offset100&limit=10"
}
}Fetches a single record with the given record ID
| record_id required | string ID of the record to fetch |
| service_id | string The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id> |
{- "record_id": "7h15-45537-15-br173",
- "schema": "Lightbulb",
- "owner": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
- "custodian": "02fb5b3a093e20e420ecf9c5839215e74c97f49eb51889069eb87bc6f62ceca8dd",
- "properties": [
- {
- "name": "location",
- "record_id": "7h15-45537-15-br173",
- "data_type": "BYTES",
- "authorized_reporters": [
- [
- "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
- "0364edd42bd9b2dea1315e2da820b569665f96e36c44b267ceeac488cfdc03bf61"
]
], - "value": {
- "timestamp": 1557949075,
- "value": "string",
- "reporter": {
- "metadata": {
- "agent_name": "Smith"
}, - "public_key": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
- "service_id": "01234567-0123-0123-0123-012345678901::grid-scabbard-a"
}, - "service_id": "12345-QWERTY:gsAA"
}, - "updates": [
- {
- "timestamp": 1557949075,
- "value": "string",
- "reporter": {
- "metadata": {
- "agent_name": "Smith"
}, - "public_key": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
- "service_id": "01234567-0123-0123-0123-012345678901::grid-scabbard-a"
}, - "service_id": "12345-QWERTY:gsAA"
}
], - "service_id": "12345-QWERTY:gsAA"
}
], - "proposals": [
- {
- "receiving_agent": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
- "issuing_agent": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
- "role": "OWNER",
- "properties": [
- "string"
], - "status": "OPEN",
- "timestamp": 1557949075,
- "service_id": "12345-QWERTY:gsAA"
}
], - "owner_updates": [
- {
- "agent_id": "02fb5b3a093e20e420ecf9c5839215e74c97f49eb51889069eb87bc6f62ceca8dd",
- "timestamp": 1557949075,
- "service_id": "12345-QWERTY:gsAA"
}
], - "custodian_updates": [
- {
- "agent_id": "02fb5b3a093e20e420ecf9c5839215e74c97f49eb51889069eb87bc6f62ceca8dd",
- "timestamp": 1557949075,
- "service_id": "12345-QWERTY:gsAA"
}
], - "final": true,
- "service_id": "12345-QWERTY:gsAA"
}| record_id required | string ID of the record to fetch a property from |
| property_name required | string Name of the property to fetch |
| service_id | string The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id> |
{- "name": "location",
- "record_id": "7h15-45537-15-br173",
- "data_type": "BYTES",
- "authorized_reporters": [
- [
- "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
- "0364edd42bd9b2dea1315e2da820b569665f96e36c44b267ceeac488cfdc03bf61"
]
], - "value": {
- "timestamp": 1557949075,
- "value": "string",
- "reporter": {
- "metadata": {
- "agent_name": "Smith"
}, - "public_key": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
- "service_id": "01234567-0123-0123-0123-012345678901::grid-scabbard-a"
}, - "service_id": "12345-QWERTY:gsAA"
}, - "updates": [
- {
- "timestamp": 1557949075,
- "value": "string",
- "reporter": {
- "metadata": {
- "agent_name": "Smith"
}, - "public_key": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
- "service_id": "01234567-0123-0123-0123-012345678901::grid-scabbard-a"
}, - "service_id": "12345-QWERTY:gsAA"
}
], - "service_id": "12345-QWERTY:gsAA"
}