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

# Get entity with fields

> Get a specific entity with all its fields



## OpenAPI

````yaml /api-reference/openapi.json get /v1/entities/{id}
openapi: 3.0.0
info:
  version: 0.0.1
  title: LithoBlocks API
  description: >-

    # LithoBlocks API


    Welcome to the LithoBlocks API documentation. This API enables you to manage
    templates, entities, and organizations with a powerful, scope-based
    authorization system.


    ## API versioning


    Documented operations are under the `/v1` path prefix (for example, `GET
    /v1/templates`). **Older integrations** may still call the same routes
    without the `/v1` prefix (for example, `GET /templates`); those URLs remain
    supported for backward compatibility but are not listed in this OpenAPI
    document. **New integrations** should use `/v1` URLs.


    ## JSON and query naming


    Canonical names in JSON bodies, query strings, and path parameter names
    documented here are **snake_case** (for example `organization_id`,
    `template_id`, `include_author`). During a deprecation window, many inputs
    still accept legacy **camelCase** keys for the same values (for example
    `templateId` in place of `template_id`). **Responses** use snake_case for
    multi-word keys. Prefer snake_case for new clients; camelCase on input may
    be removed in a future version.


    ## Authentication & Authorization


    This API uses **LithoBlocks API Keys** for authentication with **scope-based
    authorization** for granular access control.


    ### Getting Your API Key


    1. **Log into your LithoBlocks organization dashboard**

    2. **Navigate to API Keys** in your account settings

    3. **Create a new API key** and select the required scopes

    4. **Copy your API key** (it will only be shown once for security)


    ### Using Your API Key


    Include your API key in the Authorization header:


    ```

    Authorization: Bearer lb_live_sk_example_key_here

    ```


    ### API Key Scopes & Role Requirements


    Your available scopes depend on your **organization role**. When creating an
    API key, you can only select scopes your role permits:


    #### 👥 **All Roles** (Viewer, Member, Admin, Owner)

    | Scope | Description |

    |-------|-------------|

    | `templates:read` | Read access to organization templates |

    | `messages:create` | Compile templates into messages |

    | `entities:read` | Read access to data entities |


    #### ✏️ **Member+** (Member, Admin, Owner)

    | Scope | Description |

    |-------|-------------|

    | `templates:write` | Create, update, and manage templates |

    | `entities:write` | Create, update, and manage entities |


    #### 🔑 **Admin+** (Admin, Owner)

    | Scope | Description |

    |-------|-------------|

    | `organizations:admin` | Update organization settings, manage members |

    | `users:admin` | View and manage organization users |


    ### API Key Management


    - **Multiple Keys**: Create multiple API keys with different scopes for
    different use cases

    - **Key Rotation**: Regularly rotate your API keys for security

    - **Scope Limitation**: Only request the minimum scopes needed for your
    application

    - **Organization Scoped**: All API keys are scoped to your organization


    ### Security Best Practices


    - **Never share API keys** or commit them to version control

    - **Use environment variables** to store API keys in your applications

    - **Create separate keys** for development, staging, and production

    - **Revoke unused keys** from your dashboard regularly


    ### Multi-Tenant Isolation


    All API endpoints enforce **organization-level isolation**:

    - You can only access resources within your organization

    - API keys are tied to the organization where they were created

    - Cross-organization access is never permitted


    ## Role-Based Access Control


    ### 👀 **Viewer Role**

    - Can read templates and entities

    - Can compile templates into messages

    - **Cannot** create or modify resources

    - **Cannot** access admin functions


    ### ✏️ **Member Role** 

    - All Viewer permissions

    - Can create and update templates

    - Can create and update entities

    - **Cannot** access admin functions


    ### 🔧 **Admin Role**

    - All Member permissions  

    - Can manage organization settings

    - Can view and manage users

    - **Cannot** delete the organization


    ### 👑 **Owner Role**

    - All Admin permissions

    - Full organization control

    - Can delete the organization

    - Can transfer ownership
                
  contact:
    name: LithoBlocks
    url: https://lithoblocks.com
    email: support@lithoblocks.com
servers:
  - url: https://api.lithoblocks.com
    description: Production (paths in this spec are rooted at /v1/...)
  - url: https://staging.api.lithoblocks.com
    description: Staging (paths in this spec are rooted at /v1/...)
  - url: http://localhost:8787
    description: Local dev (paths in this spec are rooted at /v1/...)
security: []
paths:
  /v1/entities/{id}:
    get:
      tags:
        - Entities
      summary: Get entity with fields
      description: Get a specific entity with all its fields
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Entity with fields
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                  description:
                    type: string
                    nullable: true
                  organization_id:
                    type: string
                  created_at:
                    type: string
                  updated_at:
                    type: string
                  fields:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                        type:
                          type: string
                          enum:
                            - string
                            - number
                            - boolean
                            - date
                            - array
                            - object
                        description:
                          type: string
                          nullable: true
                        is_required:
                          type: boolean
                        parent_field_id:
                          type: string
                          nullable: true
                        array_item_type:
                          type: string
                          nullable: true
                          enum:
                            - string
                            - number
                            - boolean
                            - date
                            - array
                            - object
                        object_schema:
                          nullable: true
                        path:
                          type: array
                          nullable: true
                          items:
                            type: string
                        created_at:
                          type: string
                        updated_at:
                          type: string
                      required:
                        - id
                        - name
                        - type
                        - description
                        - is_required
                        - parent_field_id
                        - array_item_type
                        - path
                        - created_at
                        - updated_at
                required:
                  - id
                  - name
                  - description
                  - organization_id
                  - created_at
                  - updated_at
                  - fields
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
                  - message
        '403':
          description: Access denied
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
                  - message
        '404':
          description: Entity not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: string
                required:
                  - error
                  - details
      security:
        - bearerAuth:
            - entities:read
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: LithoBlocks API key obtained from your organization dashboard

````