Streams Metadata
- Last UpdatedApr 14, 2023
- 4 minute read
Stream metadata is represented as a dictionary of string keys and associated string values. It can be used to associate additional information with a stream. Stream tags are represented as a list of strings. Tags can be used to categorize or denote special attributes of streams. The Stream Metadata API And Stream Tags API do not accept the search query parameter in their respective GET methods. However, stream tags and metadata can be used as criteria in search query strings to return stream results with the Streams API.
Get Stream Metadata Value
Returns the value for the specified key in the metadata dictionary of the specified stream.
Request
GET /api/v1/Tenants/{tenantId}/Namespaces/{namespaceId}/Streams/{streamId}/Metadata/{key}
Parameters
string tenantId
Tenant identifier.string namespaceId
Namespace identifier.string streamId
Stream identifier.string key
Key specifying the metadata value of interest.
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | string | The value for the specified key in the metadata dictionary of the specified stream. |
| 400 | ErrorResponseBody | The request is malformed or invalid. |
| 401 | ErrorResponseBody | Unauthorized. |
| 403 | ErrorResponseBody | Forbidden. |
| 404 | ErrorResponseBody | The specified key was not found. |
| 500 | ErrorResponseBody | Internal server error. |
Example response body
200 Response
"value"
400 Response (ErrorResponseBody)
{
"OperationId": "string",
"Error": "string",
"Reason": "string",
"Resolution": "string",
"Parameters": {
"property1": "string",
"property2": "string"
}
}
Get Stream Metadata
Returns the metadata dictionary for the specified stream.
Request
GET /api/v1/Tenants/{tenantId}/Namespaces/{namespaceId}/Streams/{streamId}/Metadata
Parameters
string tenantId
Tenant identifier.string namespaceId
Namespace identifier.string streamId
Stream identifier.
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | Inline | The metadata dictionary for the specified stream. |
| 400 | ErrorResponseBody | The request is malformed or invalid. |
| 401 | ErrorResponseBody | Unauthorized. |
| 403 | ErrorResponseBody | Forbidden. |
| 404 | ErrorResponseBody | The specified stream was not found. |
| 500 | ErrorResponseBody | Internal server error. |
Example response body
200 Response
{
"key": "value"
}
400 Response (ErrorResponseBody)
{
"OperationId": "string",
"Error": "string",
"Reason": "string",
"Resolution": "string",
"Parameters": {
"property1": "string",
"property2": "string"
}
}
Update Stream Metadata
Replaces the metadata for the specified stream with the metadata in the request body. Overwrites any existing metadata; does not merge.
Request
PUT /api/v1/Tenants/{tenantId}/Namespaces/{namespaceId}/Streams/{streamId}/Metadata
Parameters
string tenantId
Tenant identifier.string namespaceId
Namespace identifier.string streamId
Stream identifier.
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | Inline | The updated metadata dictionary for the specified stream. |
| 400 | ErrorResponseBody | The request is malformed or invalid. |
| 401 | ErrorResponseBody | Unauthorized. |
| 403 | ErrorResponseBody | Forbidden. |
| 404 | ErrorResponseBody | The specified stream was not found. |
| 409 | ErrorResponseBody | Conflict. |
| 412 | ErrorResponseBody | Preconditioned failed. |
| 500 | ErrorResponseBody | Internal server error. |
Example response body
200 Response
{
"key": "value"
}
400 Response (ErrorResponseBody)
{
"OperationId": "string",
"Error": "string",
"Reason": "string",
"Resolution": "string",
"Parameters": {
"property1": "string",
"property2": "string"
}
}
Patch Stream Metadata
Modifies the metadata based on operations specified in the request body. The request body follows JSON Patch format.
Request
PATCH /api/v1/Tenants/{tenantId}/Namespaces/{namespaceId}/Streams/{streamId}/Metadata
Parameters
string tenantId
Tenant identifier.string namespaceId
Namespace identifier.string streamId
Stream identifier.
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | Inline | The modified metadata dictionary for the specified stream. |
| 400 | ErrorResponseBody | The request is malformed or invalid. |
| 401 | ErrorResponseBody | Unauthorized. |
| 403 | ErrorResponseBody | Forbidden. |
| 404 | ErrorResponseBody | The specified stream was not found. |
| 409 | ErrorResponseBody | Conflict. |
| 412 | ErrorResponseBody | Preconditioned failed. |
| 500 | ErrorResponseBody | Internal server error. |
Example response body
200 Response
{
"key": "value"
}
400 Response (ErrorResponseBody)
{
"OperationId": "string",
"Error": "string",
"Reason": "string",
"Resolution": "string",
"Parameters": {
"property1": "string",
"property2": "string"
}
}
Delete Stream Metadata
Deletes the metadata for the specified stream.
Request
DELETE /api/v1/Tenants/{tenantId}/Namespaces/{namespaceId}/Streams/{streamId}/Metadata
Parameters
string tenantId
Tenant identifier.string namespaceId
Namespace identifier.string streamId
Stream identifier.
Response
| Status Code | Body Type | Description |
|---|---|---|
| 204 | None | No content. |
| 400 | ErrorResponseBody | The request is malformed or invalid. |
| 401 | ErrorResponseBody | Unauthorized. |
| 403 | ErrorResponseBody | Forbidden. |
| 404 | ErrorResponseBody | The specified stream was not found. |
| 409 | ErrorResponseBody | Conflict. |
| 412 | ErrorResponseBody | Preconditioned failed. |
| 500 | ErrorResponseBody | Internal server error. |
Get Stream Metadata Changedata
Returns a dictionary of metadata keys and their associated ChangeData for the specified streamId.
Request
GET /api/v1/Tenants/{tenantId}/Namespaces/{namespaceId}/Streams/{streamId}/ChangeData/Metadata
Parameters
string tenantId
Tenant identifier.string namespaceId
Namespace identifier.string streamId
Stream identifier.
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | Inline | A dictionary of metadata keys and their associated ChangeData for the specified streamId. |
| 400 | ErrorResponseBody | The request is malformed or invalid. |
| 401 | ErrorResponseBody | Unauthorized. |
| 403 | ErrorResponseBody | Forbidden. |
| 404 | ErrorResponseBody | The specified stream was not found. |
| 500 | ErrorResponseBody | Internal server error. |
Example response body
200 Response
{
"Key1": {
"Value": "metadata value",
"ChangeData": {
"Timestamp": "0001-01-01T00:00:00",
"CreatorId": "00000000-0000-0000-0000-000000000000",
"CreatorType": "2"
}
},
"Key2": {
"Value": "metadata value",
"ChangeData": {
"Timestamp": "0001-01-01T00:00:00",
"CreatorId": "00000000-0000-0000-0000-000000000000",
"CreatorType": "2"
}
}
}
400 Response (ErrorResponseBody)
{
"OperationId": "string",
"Error": "string",
"Reason": "string",
"Resolution": "string",
"Parameters": {
"property1": "string",
"property2": "string"
}
}
Definitions
ErrorResponseBody
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| OperationId | string | false | true | None |
| Error | string | false | true | None |
| Reason | string | false | true | None |
| Resolution | string | false | true | None |
| Parameters | object | false | true | None |
{
"OperationId": "string",
"Error": "string",
"Reason": "string",
"Resolution": "string",
"Parameters": {
"property1": "string",
"property2": "string"
}
}
MetadataModel
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| Value | string | false | true | None |
| ChangeData | ChangeData | false | true | None |
{
"Value": "string",
"ChangeData": {
"Timestamp": "2019-08-24T14:15:22Z",
"CreatorId": "string",
"CreatorType": 0
}
}
ChangeData
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| Timestamp | date-time | false | false | The time that the parent MetaObject was created or updated. |
| CreatorId | string | false | true | The user, client or rule ID which created the parent MetaObject. The type of ID is specified by the CreatorType |
| CreatorType | CreatorType | false | false | The type of ID specified by the CreatorId |
{
"Timestamp": "2019-08-24T14:15:22Z",
"CreatorId": "string",
"CreatorType": 0
}
CreatorType
Enumerated Values
| Property | Value |
|---|---|
| Unknown | 0 |
| User | 1 |
| Client | 2 |
| Rule | 3 |