> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# List Topics

> List all topics with optional filtering and pagination

# List Topics

List all topics with optional filtering and pagination.

## Query Parameters

**service** `string`

Filter by messaging service fully qualified name.

**limit** `integer` (default: 10)

Maximum number of results to return (max: 1000000).

**before** `string`

Cursor for backward pagination.

**after** `string`

Cursor for forward pagination.

**fields** `string`

Comma-separated list of fields to include: `owners`, `tags`, `followers`, `votes`, `extension`, `domains`, `sourceHash`. See [Supported Fields](#supported-fields) below.

**include** `string` (default: non-deleted)

Include `all`, `deleted`, or `non-deleted` entities.

```python GET /v1/topics theme={null}
from metadata.generated.schema.entity.services.connections.metadata.openMetadataConnection import (
    AuthProvider,
    OpenMetadataConnection,
)
from metadata.generated.schema.security.client.openMetadataJWTClientConfig import (
    OpenMetadataJWTClientConfig,
)
from metadata.ingestion.ometa.ometa_api import OpenMetadata
from metadata.generated.schema.entity.data.topic import Topic

metadata = OpenMetadata(
    OpenMetadataConnection(
        hostPort="https://your-company.open-metadata.org/api",
        authProvider=AuthProvider.openmetadata,
        securityConfig=OpenMetadataJWTClientConfig(jwtToken="your-jwt-token"),
    )
)

# List first page
topics = metadata.list_entities(entity=Topic, limit=50)
for topic in topics.entities:
    print(f"{topic.fullyQualifiedName.root}")

# List all with auto-pagination
for topic in metadata.list_all_entities(entity=Topic):
    print(f"{topic.fullyQualifiedName.root}")

# Filter by service
topics = metadata.list_entities(
    entity=Topic,
    fields=["owners", "tags", "domains"],
    params={"service": "sample_kafka"},
    limit=50
)

for topic in topics.entities:
    print(f"{topic.fullyQualifiedName.root}")
    if topic.owners:
        print(f"  Owners: {[o.name for o in topic.owners.root]}")
    if topic.tags:
        print(f"  Tags: {[tag.tagFQN.root for tag in topic.tags]}")
```

```java GET /v1/topics theme={null}
import org.openmetadata.schema.entity.data.Topic;
import org.openmetadata.sdk.models.ListParams;
import org.openmetadata.sdk.models.ListResponse;

// client is an initialized OpenMetadataClient.

// List first page
ListResponse<Topic> firstPage = client.topics().list(new ListParams().setLimit(50));

for (Topic item : firstPage.getData()) {
    System.out.println(item.getFullyQualifiedName());
}

// Filter by service with fields
ListResponse<Topic> filtered = client.topics().list(
    new ListParams()
        .setService("sample_kafka")
        .setFields("owners,tags,domains")
        .setLimit(50)
);

for (Topic item : filtered.getData()) {
    System.out.println(item.getFullyQualifiedName());
}
```

```bash GET /v1/topics theme={null}
# List all
curl "{base_url}/api/v1/topics?limit=50" \
  -H "Authorization: Bearer {access_token}"

# Filter by service
curl "{base_url}/api/v1/topics?service=sample_kafka&limit=50" \
  -H "Authorization: Bearer {access_token}"

# With fields
curl "{base_url}/api/v1/topics?service=sample_kafka&fields=owners,tags,domains&limit=50" \
  -H "Authorization: Bearer {access_token}"
```

```json Response theme={null}
{
  "data": [
    {
      "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,
      "deleted": false,
      "owners": [],
      "tags": [],
      "domains": []
    }
  ],
  "paging": {
    "after": "...",
    "total": 12
  }
}
```

***

## Returns

Returns a paginated list of topic objects. By default, only basic fields are included. Use the `fields` parameter to request additional data.

## Response

**data** `array`

Array of topic objects.

**properties**

**id** `string`

Unique identifier for the topic (UUID format).

**name** `string`

Topic name.

**fullyQualifiedName** `string`

Fully qualified name in format `service.topicName`.

**displayName** `string`

Human-readable display name.

**service** `object`

Reference to the parent messaging service.

**serviceType** `string`

Type of messaging service, for example Kafka, Redpanda, Kinesis.

**messageSchema** `object`

Schema definition for messages in the topic.

**partitions** `integer`

Number of partitions.

**cleanupPolicies** `array`

Cleanup policies for the topic.

**replicationFactor** `integer`

Replication factor.

**owners** `array`

List of owners assigned to the topic. Only included when `fields` contains `owners`.

**tags** `array`

Classification tags applied. Only included when `fields` contains `tags`.

**domains** `array`

Domain assignments for governance. Only included when `fields` contains `domains`.

**followers** `array`

Users following this topic. Only included when `fields` contains `followers`.

**votes** `object`

User votes and ratings. Only included when `fields` contains `votes`.

**extension** `object`

Custom properties. Only included when `fields` contains `extension`.

**paging** `object`

Pagination information.

**properties**

**total** `integer`

Total count of topics matching the query.

**after** `string`

Cursor for the next page of results. Null if this is the last page.

**before** `string`

Cursor for the previous page of results. Null if this is the first page.

***

## Supported Fields

The following fields can be requested via the `fields` query parameter:

| Field | Description |
| - | - |
| `owners` | Owner references (users and teams) |
| `tags` | Classification tags |
| `followers` | Users following the topic |
| `votes` | User votes and ratings |
| `extension` | Custom property values |
| `domains` | Domain assignments for governance |
| `sourceHash` | Hash for change detection |

***

## Error Handling

| Code | Error Type | Description |
| - | - | - |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token |
| `403` | `FORBIDDEN` | User lacks permission to list topics |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.