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

# Get a table by FQN

> Get a specific table by its fully qualified name (FQN).

The FQN format is: service.database.schema.table
Example: PostgreSQL.dvdrental.public.customer

Args:
    fqn: Fully qualified name of the table.
    ctx: Request context for authentication.
    service: Data assets service instance.
    workflow_asset_service: Workflow asset integration service instance.
    include_pending_workflow: Whether to include pending workflow info (default: false).
    include_dq: Whether to include DQ tags, rules, and executions (default: false).

Returns:
    Table domain model with columns if requested, or TableWithWorkflowResponse
    if include_pending_workflow is true.

Raises:
    HTTPException: 404 if table not found.



## OpenAPI

````yaml /openapi/em-data-readiness-v2.yaml get /api/data-readiness/data-assets/tables/by-fqn
openapi: 3.1.0
info:
  title: EM Data Readiness Service
  description: Data Readiness Service API for managing workflows, metrics, and data quality
  version: 4.3.0-dev1
servers: []
security:
  - BearerAuth: []
tags:
  - name: Health
    description: Service health monitoring. Check service status and version information.
  - name: Root
    description: Root endpoint providing service information and navigation links.
  - name: Configuration
    description: Service configuration endpoints. View current configuration values.
  - name: Workflows
    description: >-
      Workflow configuration and execution management. Create, configure, and
      run data quality workflows including definitions, configurations, runs,
      and tasks.
  - name: Data Assets
    description: >-
      Data catalog entity management. Manage databases, schemas, and tables
      metadata.
  - name: Metrics
    description: >-
      Data quality metrics and scorecards. Calculate scores, view trends, and
      analyze dimensions.
  - name: Violations
    description: >-
      Data quality violation management. View, acknowledge, and remediate
      detected violations.
  - name: Glossary
    description: >-
      Business glossary management. Create, verify, and organize business terms
      and definitions.
paths:
  /api/data-readiness/data-assets/tables/by-fqn:
    get:
      tags:
        - Data Assets
      summary: Get a table by FQN
      description: |-
        Get a specific table by its fully qualified name (FQN).

        The FQN format is: service.database.schema.table
        Example: PostgreSQL.dvdrental.public.customer

        Args:
            fqn: Fully qualified name of the table.
            ctx: Request context for authentication.
            service: Data assets service instance.
            workflow_asset_service: Workflow asset integration service instance.
            include_pending_workflow: Whether to include pending workflow info (default: false).
            include_dq: Whether to include DQ tags, rules, and executions (default: false).

        Returns:
            Table domain model with columns if requested, or TableWithWorkflowResponse
            if include_pending_workflow is true.

        Raises:
            HTTPException: 404 if table not found.
      operationId: get_table_by_fqn
      parameters:
        - name: fqn
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            description: >-
              Fully qualified name of the table (e.g.,
              service.database.schema.table)
            title: Fqn
          description: >-
            Fully qualified name of the table (e.g.,
            service.database.schema.table)
        - name: include_pending_workflow
          in: query
          required: false
          schema:
            type: boolean
            description: Include pending workflow info and proposed changes
            default: false
            title: Include Pending Workflow
          description: Include pending workflow info and proposed changes
        - name: include_dq
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              Include DQ tags, rules, and execution results from the readiness
              DB
            default: false
            title: Include Dq
          description: Include DQ tags, rules, and execution results from the readiness DB
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Table'
                  - $ref: '#/components/schemas/TableWithWorkflowResponse'
                title: Response Get Table By Fqn
        '404':
          description: Table not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    Table:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Unique table identifier (UUID as string)
        name:
          type: string
          title: Name
          description: Table name
        fqn:
          type: string
          title: Fqn
          description: Fully qualified name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Table description
        summary_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Summary Text
          description: Summary text for semantic search embedding
        owners:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Owners
          description: List of owner names
        tags:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Tags
          description: List of tag dicts with tagFQN, name, justification, etc.
        domain:
          anyOf:
            - type: string
            - type: 'null'
          title: Domain
          description: Business domain this table belongs to
        version:
          anyOf:
            - type: number
            - type: 'null'
          title: Version
          description: Entity version number
        columns:
          anyOf:
            - items:
                $ref: '#/components/schemas/Column'
              type: array
            - type: 'null'
          title: Columns
          description: Nested columns (populated on creation or request)
        is_dq_tagged:
          type: boolean
          title: Is Dq Tagged
          description: Whether any column has DQ tags
          default: false
        is_dq_rules_generated:
          type: boolean
          title: Is Dq Rules Generated
          description: Whether any column has DQ rules generated
          default: false
        requires_approval:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Requires Approval
          description: >-
            Whether the pending workflow for this table requires human approval
            before saving
      type: object
      required:
        - name
        - fqn
      title: Table
      description: >-
        Table domain model for API responses and requests.


        Clean DTO representing a database table without ORM metadata. Tables can
        include

        nested columns for convenient creation. Supports business domain
        association and

        data quality rule definitions. Used in API layer, excludes
        infrastructure concerns.
    TableWithWorkflowResponse:
      properties:
        current:
          $ref: '#/components/schemas/Table'
          description: Current table state
        proposed:
          anyOf:
            - $ref: '#/components/schemas/Table'
            - type: 'null'
          description: Proposed table state after workflow output is applied
        pending_workflow:
          anyOf:
            - $ref: '#/components/schemas/PendingWorkflowInfo'
            - type: 'null'
          description: Pending workflow information
        change_summary:
          anyOf:
            - $ref: '#/components/schemas/ChangeSummary'
            - type: 'null'
          description: Summary of proposed changes
        workflow_output:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Workflow Output
          description: Raw workflow output for preview
      type: object
      required:
        - current
      title: TableWithWorkflowResponse
      description: Enhanced table response with pending workflow information.
    ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorInfo'
          description: >-
            Error information object containing code, message, and optional
            details
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
          description: Request ID for debugging and support
          examples:
            - req_abc123xyz
      type: object
      required:
        - error
      title: ErrorResponse
      description: >-
        Standard error response model for API errors.


        Matches the structure returned by _handle_service_error in
        workflows/routes.py.

        The actual API response format is:

        {
            "error": {
                "code": "ERROR_CODE",
                "message": "Error message",
                "details": {...}
            },
            "request_id": "optional-request-id"
        }
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Column:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Unique column identifier (UUID)
        name:
          type: string
          title: Name
          description: Column name
        fqn:
          anyOf:
            - type: string
            - type: 'null'
          title: Fqn
          description: Fully qualified name
        data_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Data Type
          description: SQL data type (e.g., VARCHAR(255), INTEGER, NUMERIC(15,2))
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Technical description of the column
        display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Name
          description: User-friendly display name
        data_type_display:
          anyOf:
            - type: string
            - type: 'null'
          title: Data Type Display
          description: Human-readable data type description
        business_rules:
          anyOf:
            - type: string
            - type: 'null'
          title: Business Rules
          description: Business rules governing this column (max 1000 chars)
        business_definition:
          anyOf:
            - type: string
            - type: 'null'
          title: Business Definition
          description: Business meaning and purpose (max 1000 chars)
        summary_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Summary Text
          description: Summary text for semantic search embedding
        constraint:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Constraint
          description: >-
            Column constraint as structured JSONB (constraintType,
            referenceTable, etc.)
        column_relationships:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Column Relationships
          description: Relationships to other columns (FK references, etc.)
        tags:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Tags
          description: List of tag dicts with tagFQN, name, justification, etc.
        data_quality:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Data Quality
          description: DQ tags with nested rules and execution results
      type: object
      required:
        - name
      title: Column
      description: >-
        Column domain model for API responses and requests.


        Clean DTO representing a table column with comprehensive technical and
        business

        metadata. Supports business context enrichment through business_rules
        and

        business_definition fields. Used for nested column creation within
        tables.
    PendingWorkflowInfo:
      properties:
        workflow_run_id:
          type: string
          title: Workflow Run Id
          description: Workflow run UUID
        workflow_type:
          type: string
          title: Workflow Type
          description: Type of workflow (e.g., generate-pii-tags)
        workflow_name:
          type: string
          title: Workflow Name
          description: Human-readable workflow name
        status:
          type: string
          title: Status
          description: Workflow run status (queued, running, completed)
        approval_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Approval Status
          description: Approval status (pending, approved, rejected)
        started_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Started At
          description: ISO 8601 timestamp when run started
        completed_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Completed At
          description: ISO 8601 timestamp when run completed
        triggered_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Triggered By
          description: Who/what triggered the workflow
      type: object
      required:
        - workflow_run_id
        - workflow_type
        - workflow_name
        - status
      title: PendingWorkflowInfo
      description: Information about a pending workflow for a data asset.
    ChangeSummary:
      properties:
        columns_affected:
          type: integer
          title: Columns Affected
          description: Number of columns with changes
          default: 0
        tags_added:
          type: integer
          title: Tags Added
          description: Number of tags added
          default: 0
        tags_removed:
          type: integer
          title: Tags Removed
          description: Number of tags removed
          default: 0
        descriptions_updated:
          type: integer
          title: Descriptions Updated
          description: Number of descriptions updated
          default: 0
        rules_added:
          type: integer
          title: Rules Added
          description: Number of DQ rules added
          default: 0
      type: object
      title: ChangeSummary
      description: Summary of changes from a workflow output.
    ErrorInfo:
      properties:
        code:
          type: string
          title: Code
          description: >-
            Error code identifier (e.g., 'WORKFLOW_NOT_FOUND',
            'VALIDATION_ERROR')
          examples:
            - WORKFLOW_NOT_FOUND
        message:
          type: string
          title: Message
          description: Human-readable error message
          examples:
            - >-
              Workflow configuration with id
              '123e4567-e89b-12d3-a456-426614174000' not found
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
          description: >-
            Additional error details as a dictionary (flexible structure for
            business logic errors)
          examples:
            - workflow_id: 123e4567-e89b-12d3-a456-426614174000
      type: object
      required:
        - code
        - message
      title: ErrorInfo
      description: >-
        Nested error information object.


        Note: This model uses an untyped dict for `details` to match the
        flexible error

        structure used throughout the service layer (see WorkflowServiceError
        and similar).

        This is distinct from ErrorDetail, which is used for structured
        validation errors.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Bearer token authentication. Include the token in the Authorization
        header as: `Authorization: Bearer <token>`. The JWT must contain valid
        client_id, and project_id claims for tenant isolation and SDK routing.

````