GET /v1/topics/{id}
from metadata.sdk import configure
from metadata.sdk.entities import Topics
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Get by ID
topic = Topics.retrieve("0a021819-982e-4ee4-a5a2-4af30eaa3016")
print(f"{topic.fullyQualifiedName}: {topic.description}")
# Get by ID with fields
topic = Topics.retrieve(
"0a021819-982e-4ee4-a5a2-4af30eaa3016",
fields=["owners", "tags", "messageSchema"]
)
# Get by fully qualified name
topic = Topics.retrieve_by_name("sample_kafka.address_book")
# Get by name with fields
topic = Topics.retrieve_by_name(
"sample_kafka.address_book",
fields=["owners", "tags", "domain"]
)
import static org.openmetadata.sdk.fluent.Topics.*;
// Get by ID
var topic = Topics.retrieve("0a021819-982e-4ee4-a5a2-4af30eaa3016");
// Get by ID with fields
var topic = Topics.retrieve(
"0a021819-982e-4ee4-a5a2-4af30eaa3016",
"owners,tags,messageSchema"
);
// Get by fully qualified name
var topic = Topics.retrieveByName(
"sample_kafka.address_book"
);
// Get by name with fields
var topic = Topics.retrieveByName(
"sample_kafka.address_book",
"owners,tags,domain"
);
# Get by ID
curl "{base_url}/api/v1/topics/0a021819-982e-4ee4-a5a2-4af30eaa3016" \
-H "Authorization: Bearer {access_token}"
# Get by ID with fields
curl "{base_url}/api/v1/topics/0a021819-982e-4ee4-a5a2-4af30eaa3016?fields=owners,tags,domains" \
-H "Authorization: Bearer {access_token}"
# Get by fully qualified name
curl "{base_url}/api/v1/topics/name/sample_kafka.address_book" \
-H "Authorization: Bearer {access_token}"
# Get by name with fields
curl "{base_url}/api/v1/topics/name/sample_kafka.address_book?fields=owners,tags,domains" \
-H "Authorization: Bearer {access_token}"
{
"id": "0a021819-982e-4ee4-a5a2-4af30eaa3016",
"name": "address_book",
"fullyQualifiedName": "sample_kafka.address_book",
"description": "All Protobuf record related events gets captured in this topic",
"version": 0.1,
"updatedAt": 1769982663546,
"updatedBy": "admin",
"service": {
"id": "469ef25e-9bdf-4d5f-8553-eb0ce8581f30",
"type": "messagingService",
"name": "sample_kafka",
"fullyQualifiedName": "sample_kafka",
"displayName": "sample_kafka",
"deleted": false
},
"serviceType": "Kafka",
"messageSchema": {
"schemaText": "syntax = \"proto2\";\npackage tutorial;\nmessage Person { ... }",
"schemaType": "Protobuf",
"schemaFields": [
{
"name": "AddressBook",
"dataType": "RECORD",
"fullyQualifiedName": "sample_kafka.address_book.AddressBook",
"children": []
}
]
},
"partitions": 1,
"cleanupPolicies": ["delete"],
"replicationFactor": 1,
"maximumMessageSize": 1,
"retentionSize": -1,
"href": "http://localhost:8585/api/v1/topics/0a021819-982e-4ee4-a5a2-4af30eaa3016",
"deleted": false,
"owners": [],
"tags": [],
"followers": [],
"votes": {
"upVotes": 0,
"downVotes": 0,
"upVoters": [],
"downVoters": []
},
"domains": []
}
Retrieve a Topic
Get a topic by ID or fully qualified name
GET
/
v1
/
topics
/
{id}
GET /v1/topics/{id}
from metadata.sdk import configure
from metadata.sdk.entities import Topics
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Get by ID
topic = Topics.retrieve("0a021819-982e-4ee4-a5a2-4af30eaa3016")
print(f"{topic.fullyQualifiedName}: {topic.description}")
# Get by ID with fields
topic = Topics.retrieve(
"0a021819-982e-4ee4-a5a2-4af30eaa3016",
fields=["owners", "tags", "messageSchema"]
)
# Get by fully qualified name
topic = Topics.retrieve_by_name("sample_kafka.address_book")
# Get by name with fields
topic = Topics.retrieve_by_name(
"sample_kafka.address_book",
fields=["owners", "tags", "domain"]
)
import static org.openmetadata.sdk.fluent.Topics.*;
// Get by ID
var topic = Topics.retrieve("0a021819-982e-4ee4-a5a2-4af30eaa3016");
// Get by ID with fields
var topic = Topics.retrieve(
"0a021819-982e-4ee4-a5a2-4af30eaa3016",
"owners,tags,messageSchema"
);
// Get by fully qualified name
var topic = Topics.retrieveByName(
"sample_kafka.address_book"
);
// Get by name with fields
var topic = Topics.retrieveByName(
"sample_kafka.address_book",
"owners,tags,domain"
);
# Get by ID
curl "{base_url}/api/v1/topics/0a021819-982e-4ee4-a5a2-4af30eaa3016" \
-H "Authorization: Bearer {access_token}"
# Get by ID with fields
curl "{base_url}/api/v1/topics/0a021819-982e-4ee4-a5a2-4af30eaa3016?fields=owners,tags,domains" \
-H "Authorization: Bearer {access_token}"
# Get by fully qualified name
curl "{base_url}/api/v1/topics/name/sample_kafka.address_book" \
-H "Authorization: Bearer {access_token}"
# Get by name with fields
curl "{base_url}/api/v1/topics/name/sample_kafka.address_book?fields=owners,tags,domains" \
-H "Authorization: Bearer {access_token}"
{
"id": "0a021819-982e-4ee4-a5a2-4af30eaa3016",
"name": "address_book",
"fullyQualifiedName": "sample_kafka.address_book",
"description": "All Protobuf record related events gets captured in this topic",
"version": 0.1,
"updatedAt": 1769982663546,
"updatedBy": "admin",
"service": {
"id": "469ef25e-9bdf-4d5f-8553-eb0ce8581f30",
"type": "messagingService",
"name": "sample_kafka",
"fullyQualifiedName": "sample_kafka",
"displayName": "sample_kafka",
"deleted": false
},
"serviceType": "Kafka",
"messageSchema": {
"schemaText": "syntax = \"proto2\";\npackage tutorial;\nmessage Person { ... }",
"schemaType": "Protobuf",
"schemaFields": [
{
"name": "AddressBook",
"dataType": "RECORD",
"fullyQualifiedName": "sample_kafka.address_book.AddressBook",
"children": []
}
]
},
"partitions": 1,
"cleanupPolicies": ["delete"],
"replicationFactor": 1,
"maximumMessageSize": 1,
"retentionSize": -1,
"href": "http://localhost:8585/api/v1/topics/0a021819-982e-4ee4-a5a2-4af30eaa3016",
"deleted": false,
"owners": [],
"tags": [],
"followers": [],
"votes": {
"upVotes": 0,
"downVotes": 0,
"upVoters": [],
"downVoters": []
},
"domains": []
}
Retrieve a Topic
Get a single topic by its unique ID or fully qualified name.Get by ID
string
required
UUID of the topic to retrieve.
string
Comma-separated list of fields to include (e.g.,
owners,tags,followers,votes,extension,domains,sourceHash).string
default:"non-deleted"
Include
all, deleted, or non-deleted entities.Get by Fully Qualified Name
UseGET /v1/topics/name/{fqn} to retrieve by fully qualified name.
string
required
Fully qualified name of the topic (e.g.,
sample_kafka.address_book).string
Comma-separated list of fields to include:
owners, tags, followers, votes, extension, domains, sourceHash.string
default:"non-deleted"
Include
all, deleted, or non-deleted entities.GET /v1/topics/{id}
from metadata.sdk import configure
from metadata.sdk.entities import Topics
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Get by ID
topic = Topics.retrieve("0a021819-982e-4ee4-a5a2-4af30eaa3016")
print(f"{topic.fullyQualifiedName}: {topic.description}")
# Get by ID with fields
topic = Topics.retrieve(
"0a021819-982e-4ee4-a5a2-4af30eaa3016",
fields=["owners", "tags", "messageSchema"]
)
# Get by fully qualified name
topic = Topics.retrieve_by_name("sample_kafka.address_book")
# Get by name with fields
topic = Topics.retrieve_by_name(
"sample_kafka.address_book",
fields=["owners", "tags", "domain"]
)
import static org.openmetadata.sdk.fluent.Topics.*;
// Get by ID
var topic = Topics.retrieve("0a021819-982e-4ee4-a5a2-4af30eaa3016");
// Get by ID with fields
var topic = Topics.retrieve(
"0a021819-982e-4ee4-a5a2-4af30eaa3016",
"owners,tags,messageSchema"
);
// Get by fully qualified name
var topic = Topics.retrieveByName(
"sample_kafka.address_book"
);
// Get by name with fields
var topic = Topics.retrieveByName(
"sample_kafka.address_book",
"owners,tags,domain"
);
# Get by ID
curl "{base_url}/api/v1/topics/0a021819-982e-4ee4-a5a2-4af30eaa3016" \
-H "Authorization: Bearer {access_token}"
# Get by ID with fields
curl "{base_url}/api/v1/topics/0a021819-982e-4ee4-a5a2-4af30eaa3016?fields=owners,tags,domains" \
-H "Authorization: Bearer {access_token}"
# Get by fully qualified name
curl "{base_url}/api/v1/topics/name/sample_kafka.address_book" \
-H "Authorization: Bearer {access_token}"
# Get by name with fields
curl "{base_url}/api/v1/topics/name/sample_kafka.address_book?fields=owners,tags,domains" \
-H "Authorization: Bearer {access_token}"
{
"id": "0a021819-982e-4ee4-a5a2-4af30eaa3016",
"name": "address_book",
"fullyQualifiedName": "sample_kafka.address_book",
"description": "All Protobuf record related events gets captured in this topic",
"version": 0.1,
"updatedAt": 1769982663546,
"updatedBy": "admin",
"service": {
"id": "469ef25e-9bdf-4d5f-8553-eb0ce8581f30",
"type": "messagingService",
"name": "sample_kafka",
"fullyQualifiedName": "sample_kafka",
"displayName": "sample_kafka",
"deleted": false
},
"serviceType": "Kafka",
"messageSchema": {
"schemaText": "syntax = \"proto2\";\npackage tutorial;\nmessage Person { ... }",
"schemaType": "Protobuf",
"schemaFields": [
{
"name": "AddressBook",
"dataType": "RECORD",
"fullyQualifiedName": "sample_kafka.address_book.AddressBook",
"children": []
}
]
},
"partitions": 1,
"cleanupPolicies": ["delete"],
"replicationFactor": 1,
"maximumMessageSize": 1,
"retentionSize": -1,
"href": "http://localhost:8585/api/v1/topics/0a021819-982e-4ee4-a5a2-4af30eaa3016",
"deleted": false,
"owners": [],
"tags": [],
"followers": [],
"votes": {
"upVotes": 0,
"downVotes": 0,
"upVoters": [],
"downVoters": []
},
"domains": []
}
Returns
Returns a topic object with all requested fields populated.Response
string
Unique identifier for the topic (UUID format).
string
Topic name.
string
Fully qualified name in format
service.topicName.string
Human-readable display name.
string
Description of the topic in Markdown format.
object
object
string
Type of messaging service (e.g., Kafka, Redpanda, Kinesis).
number
Version number for the entity.
array
List of owners. Only included when
fields contains owners.array
Classification tags. Only included when
fields contains tags.array
Domain assignments. Only included when
fields contains domains.Error Handling
| Code | Error Type | Description |
|---|---|---|
401 | UNAUTHORIZED | Invalid or missing authentication token |
403 | FORBIDDEN | User lacks permission to view this topic |
404 | NOT_FOUND | Topic with given ID or FQN does not exist |
Was this page helpful?
⌘I