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

# CREATE Building Space

> Creates a Building Space representing a unit, space, floor, room, or area in the Building.

**Required capabilities:** `WRITE:BUILDING_SPACE`



## OpenAPI

````yaml /api-reference/openapi.json post /rest/v2/accounts/{accountId}/buildings/{buildingId}/spaces
openapi: 3.1.0
info:
  title: Prophia API Documentation
  license:
    name: Apache 2.0
    url: http://springdoc.org
  version: v2.495.0
servers:
  - url: https://api.prophia.com
    description: Prophia API
security:
  - apiKey: []
tags:
  - name: Accounts
    description: >-
      Accounts are the top-level scope for everything in the API. Start here:
      list your accounts to find the `accountId` every other path requires.
  - name: Properties
    description: >-
      Properties group one or more buildings under a single asset within an
      account.
  - name: Buildings
    description: Buildings are the physical structures where leases and spaces live.
  - name: Building Spaces
    description: >-
      Building spaces are the units inside a building — suites, floors, storage.
      A space's `suiteNumber` is the canonical name that tag `applicableSpaces`
      entries reference by string match.
  - name: Leases
    description: >-
      Leases are the agreements occupying building spaces. Each lease carries
      its source documents and the tags (structured terms) extracted from them.
  - name: Documents
    description: >-
      Documents are the source files attached to leases — original leases,
      amendments, memorandums, etc.
  - name: Tags
    description: >-
      Tags are the structured lease terms Prophia extracts from documents — a
      rent amount, a renewal option, a key date — each cited to its location in
      the source document. STANDARD tags carry a typed `value`; COMPLEX tags
      carry option details in `tagComponents`.
  - name: Custom Terms
    description: >-
      Custom terms are account-level definitions of extra lease terms your team
      tracks beyond Prophia's standard set. Tags created from them are ordinary
      tags with `isCustomTag: true` — the definition and its tag instances are
      separate resources.
  - name: Custom Fields
    description: >-
      Custom Fields are Account-level fields your team tracks on Buildings
      beyond Prophia's standard set. A `SINGLE` field holds free text per
      Building; a `MULTI` field holds one of a fixed list of options.
      Assignments set a field's value on a Building.
  - name: Loans
    description: >-
      Loans are the financing agreements secured by an account's buildings. Each
      loan carries its source documents and the terms read from them: summary
      terms, covenants and reporting deliverables. Loans is a Labs feature in
      beta, and its endpoints may change.
    x-beta: true
paths:
  /rest/v2/accounts/{accountId}/buildings/{buildingId}/spaces:
    post:
      tags:
        - Building Spaces
      summary: CREATE Building Space
      description: >-
        Creates a Building Space representing a unit, space, floor, room, or
        area in the Building.


        **Required capabilities:** `WRITE:BUILDING_SPACE`
      operationId: createBuildingSpace
      parameters:
        - name: accountId
          in: path
          required: true
          schema:
            type: string
        - name: buildingId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V2CreateBuildingSpaceRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/V2BuildingSpaceModel'
        '400':
          description: Invalid input — request body failed validation or business rules
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ErrorResponse'
              example:
                error: Invalid Input
                errorCode: InvalidInput
                message: dba cannot be blank
                status: 400 BAD_REQUEST
                timestamp: '2026-09-02T20:41:03.118Z'
                localizedMessage: dba cannot be blank
        '401':
          description: >-
            The credential was rejected before the request reached the endpoint
            — for example a JWT was presented where an API key is required. Only
            `error` is populated on this path
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ErrorResponse'
              example:
                error: JWT authentication is not supported. Use an API key.
        '403':
          description: >-
            The API key is valid but lacks a required capability or role, the
            account does not have the REST write module enabled, or the key's
            building permissions do not cover the requested resource. The
            message names the missing capabilities only in the first case
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ErrorResponse'
              example:
                error: Access Denied
                errorCode: AccessDenied
                message: 'Not authorized. Missing capabilities: WRITE:DOCUMENT'
                status: 403 FORBIDDEN
                timestamp: '2026-09-02T20:41:03.118Z'
                localizedMessage: 'Not authorized. Missing capabilities: WRITE:DOCUMENT'
        '404':
          description: No such resource is visible to the account named in the path
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ErrorResponse'
              example:
                error: Entity Not Found
                errorCode: EntityNotFound
                message: This entity is not found in the system.
                status: 404 NOT_FOUND
                timestamp: '2026-09-02T20:41:03.118Z'
                localizedMessage: This entity is not found in the system.
components:
  schemas:
    V2CreateBuildingSpaceRequest:
      type: object
      description: >-
        Fields for creating a Building Space. `suiteNumber` is the name Tag
        `applicableSpaces` entries match against, so choose it to match how the
        space is named in the lease documents.
      properties:
        floor:
          type: string
          description: >-
            Floor the space sits on. Building Spaces that have exact string
            matches for their floors will be grouped together on the Stacking
            Plan and will affect how FLOOR level Tag `encumberedSpaces` apply.
          minLength: 1
        suiteNumber:
          type: string
          description: >-
            Canonical space name. Tag `applicableSpaces` entries match this by
            string, so renaming it breaks those associations. To reflect
            Building layout changes without affecting historical Tag
            associations, archive the space and make a new space to represent
            the current layout.
          minLength: 1
        squareFootage:
          type: integer
          format: int32
          description: >-
            Base square footage of the space. When viewing the space in various
            locations, if a lease is active for the space the square footage Tag
            in the Lease is preferred, using this square footage value as a
            fallback.
        type:
          type: string
          description: >-
            What kind of unit this is. There are in-app configurations that may
            be set per space type that can affect how a space applies its square
            footage to particular metrics or occasionally its presence in
            certain reports. Be default all types are included in which case the
            value here is purely for reference.
          enum:
            - Office
            - Retail
            - Industrial
            - Storage
            - Telecom
            - Parking
            - Conference Room
            - Lobby
            - Elevator
            - Fitness Center
            - License Agreement
            - Management Office
            - Amenity
            - Cafe
            - Bike Storage
            - Lounge
            - Other
            - zSuite
        rentable:
          type: boolean
          description: >-
            Defaulted to true. Represents whether the space counts as rentable
            inventory. A non-rentable space can still have a lease applied to
            it, but the non-rentable nature may prevent the space and/or lease
            from displaying properly in certain reports. A false value is
            typically used for spaces such as lobbies or elevators that are not
            expected to be leased, but may still be of interest on a stacking
            plan without applying its square footage to occupancy metrics.
        occupied:
          type: boolean
          description: >-
            Defaulted to false. Purely an override value. Setting false does not
            mean the space is vacant — it only clears the override; derive real
            occupancy from leases. Typically used to denote spaces that aren't
            traditionally leased as occupied, such as conference rooms or
            fitness centers, etc. Even if this value is false, an active lease
            applied to the space will cause the space to appear as occupied on
            reports like the stacking plan.
        archived:
          type: boolean
          description: >-
            Archive the space. Archived spaces still appear in responses unless
            filtered with `archived=false`. An archived space is Prophia's
            mechanism to retain space references for historical leases that are
            still in the system and require the tether, but are no longer
            active.
      required:
        - floor
        - suiteNumber
        - type
    V2BuildingSpaceModel:
      type: object
      description: >-
        Representation of a space or unit in a Building. Some example uses: a
        rentable suite, a conference room, storage space, or a full floor.
      properties:
        id:
          type: string
          description: Prophia internal Building Space ID (UUID).
          readOnly: true
        buildingId:
          type: string
          description: The buildingId (UUID) of the Building this space belongs to.
          readOnly: true
        floor:
          type: string
          description: >-
            Floor the space sits on. This value primarily affects the grouping
            of Building Spaces in the Stacking Plan, but also governs which
            spaces have floor level encumbrances applied to them. For example if
            a ROFO Tag's offeredSpace component references 'FLOOR1' as its
            `encumbranceSpaces` value, all spaces having space.floor=1 will show
            as encumbered in the Stacking Plan.
        suiteNumber:
          type: string
          description: >-
            Canonical name of the space. This is the value that Tag
            `applicableSpaces` entries match against, by string — renaming it
            breaks those associations.
        squareFootage:
          type: integer
          format: int32
          description: Rentable square footage of the space.
        type:
          type: string
          description: >-
            What kind of unit this is. This is a referential value and does not
            affect how a space operates in the system.
          enum:
            - Office
            - Retail
            - Industrial
            - Storage
            - Telecom
            - Parking
            - Conference Room
            - Lobby
            - Elevator
            - Fitness Center
            - License Agreement
            - Management Office
            - Amenity
            - Cafe
            - Bike Storage
            - Lounge
            - Other
            - zSuite
        rentable:
          type: boolean
          description: >-
            Whether the space counts as rentable inventory. If marked as
            non-rentable, the space and leases associated with it, if you've
            chosen to continue associating leases with the space, may cease
            being present in reports like the Rent Roll. Marking a space as
            non-rentable is normally used in cases like Lobbies, Elevators, and
            like shared public spaces of the Building that are not eligible to
            be leased.
        archived:
          type: boolean
          description: >-
            Archived spaces still appear in listings unless filtered with
            `archived=false`. It's best to archive a Building Space when it is
            referenced by historical leases but is no longer representative of a
            discrete space in the Building.
        createdAt:
          type: string
          format: date-time
          description: When the space was created.
          readOnly: true
        updatedAt:
          type: string
          format: date-time
          description: When the space was last modified.
          readOnly: true
        occupied:
          type: boolean
          description: >-
            An override value: Allows the space to be marked as occupied, even
            when lacking an active lease associated with the space. A value of
            false does not mean that there are no associated active leases, only
            that the override is not currently marking the space as occupied.
            Best used for spaces that are not traditionally leased but you still
            want to show as occupied in the Stacking Plan and count towards
            occupied square footage statistics.
    V2ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Stable error category
          example: Invalid Input
        errorCode:
          type: string
          description: Stable error code suitable for programmatic handling
          example: InvalidInput
        message:
          type: string
          description: Human-readable detail; may aggregate multiple field errors
        status:
          type: string
          description: >-
            HTTP status of the response as code and reason phrase, matching the
            response's own status line
          example: 404 NOT_FOUND
        timestamp:
          type: string
          format: date-time
          description: When the error was produced, as an ISO-8601 UTC instant
          example: '2026-09-02T20:41:03.118Z'
        localizedMessage:
          type: string
          description: >-
            Same text as `message`; present because the body is a serialized
            exception. Prefer `message`
  securitySchemes:
    apiKey:
      type: apiKey
      description: >-
        Prophia API key — either an account key (grants admin level permissions)
        or a user key with the REST scope. Send it in the `X-API-Key` header, or
        equivalently as `Authorization: Bearer <api-key>`. JWTs are rejected on
        /rest endpoints with 401.
      name: X-API-Key
      in: header

````

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