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

# Create a space

> Creates a space from the supplied identifier, name, purpose, and terms agreement, along with its initial users and data engine allocations. Returns the created space.



## OpenAPI

````yaml /schema.json post /spaces
openapi: 3.1.0
info:
  version: 01KV4EC0SHV95TK2YR66AMKFZC
  title: Alumio API
  description: Access Alumio through OpenAPI v3.1.
servers:
  - url: /api/v1
security: []
paths:
  /spaces:
    post:
      tags:
        - Spaces
      summary: Create a space
      description: >-
        Creates a space from the supplied identifier, name, purpose, and terms
        agreement, along with its initial users and data engine allocations.
        Returns the created space.
      operationId: createSpace
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpaceCreate'
      responses:
        '201':
          description: Created a space
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpaceResult'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    SpaceCreate:
      type: object
      additionalProperties: false
      properties:
        object:
          type: object
          properties:
            identifier:
              type: string
              title: Identifier
              description: Identifier
              pattern: ^[a-z0-9-]+$
              maxLength: 255
            name:
              type: string
              title: Name
              description: Name of the space
              maxLength: 255
            termsAgreed:
              type: boolean
              title: Terms agreed
              description: Terms and conditions agreed
            description:
              type: string
              title: Description
              description: Description of the space.
              maxLength: 64000
              default: ''
              ui:
                ui:widget: MarkdownWidget
            purpose:
              $ref: '#/components/schemas/SpacePurpose'
          required:
            - name
            - identifier
            - purpose
            - termsAgreed
        users:
          type: array
          items:
            $ref: '#/components/schemas/User'
        dataEngines:
          type: array
          items:
            $ref: '#/components/schemas/SpaceWorkerAllocation'
      required:
        - object
        - users
        - dataEngines
    SpaceResult:
      type: object
      properties:
        object:
          $ref: '#/components/schemas/Space'
    Error:
      type: object
      properties:
        status:
          type: string
        context:
          type: object
        type:
          type: string
        title:
          type: string
        detail:
          type: string
        violations:
          type: array
          items:
            type: object
            properties:
              title:
                type: string
              propertyPath:
                type: string
              type:
                type: string
    SpacePurpose:
      type: string
      title: Type
      enum:
        - prod
        - uat
        - test
        - dev
      enumNames:
        - Production
        - UAT
        - Test
        - Development
      ui:
        ui:widget: space-purpose
        ui:summary: purpose
        ui:information: |-
          **Space type recommendations**

          - **Production** - for live system serving real users
          - **UAT** - for validation by business users before production release
          - **Test** - for quality assurance testing
          - **Development** - to write, modify, and initially test code
    User:
      type: object
      properties:
        email:
          title: Email address
          type: string
          format: email
        roles:
          title: Roles
          type: array
          items:
            type: string
            anyOf:
              - const: ROLE_USER
                title: Viewer
                description: >-
                  This role is allowed to view configurations and logs, and run
                  configurations.
              - const: ROLE_EDITOR
                title: Editor
                description: >-
                  This role is allowed to edit configurations, view logs and run
                  configurations.
              - const: ROLE_ADMINISTRATOR
                title: Administrator
                description: >-
                  This role is allowed to edit configurations and manage users,
                  view logs and run configurations.
          minItems: 1
          uniqueItems: true
      required:
        - email
        - roles
    SpaceWorkerAllocation:
      type: object
      properties:
        spaceIdentifier:
          title: Space identifier
          description: The identifier of the space
          type: string
          pattern: ^[a-z0-9-]+$
          maxLength: 255
        workers:
          title: Workers
          description: Number of workers for the space
          type: integer
          min: 0
    Space:
      type: object
      properties:
        identifier:
          type: string
          title: Identifier
          description: Identifier
          pattern: ^[a-z0-9-]+$
          maxLength: 255
        name:
          type: string
          title: Name
          description: Name of the space
          maxLength: 255
        description:
          type: string
          title: Description
          description: Description of the space.
          maxLength: 64000
          default: ''
          ui:
            ui:widget: MarkdownWidget
        purpose:
          $ref: '#/components/schemas/SpacePurpose'
        workers:
          type: integer
          title: Data Engines
          description: The number of assigned data engines
          ui:
            ui:widget: hidden
        createdAt:
          type: string
          title: Created at
          format: date-time
          description: Creation date
          ui:
            ui:widget: hidden
        updatedAt:
          type: string
          title: Updated at
          format: date-time
          description: Update date
          ui:
            ui:widget: hidden
        isLocked:
          type: integer
          title: Locked
          default: 0
          description: Locked space
          ui:
            ui:widget: hidden
        termsAgreed:
          type: integer
          title: Terms agreed
          default: 0
          description: Terms agreed
          ui:
            ui:widget: hidden
        createUser:
          format: email
          type: string
          title: Created by
          description: The user that created the space
          maxLength: 255
        expireDate:
          type: string
          title: Expire date
          format: date-time
          description: The date the space license expires
          ui:
            ui:widget: hidden
        cancelUser:
          format: email
          type: string
          title: Canceled by
          description: The user that canceled the space
          maxLength: 255
          ui:
            ui:widget: hidden
        cancelDate:
          type: string
          title: Cancel date
          format: date-time
          description: The date the space is canceled
          ui:
            ui:widget: hidden
        status:
          $ref: '#/components/schemas/SpaceStatus'
      required:
        - name
        - identifier
        - purpose
    SpaceStatus:
      type: string
      title: Status
      oneOf:
        - const: new
          title: Pending
          description: This space will be created shortly.
        - const: creating
          title: Creating
          description: This space is currently being set up, this might take a few minutes.
        - const: ready
          title: Active
          description: This space is up and running!
        - const: error
          title: Error
          description: >-
            Something went wrong while setting up your space, please contact
            support.
        - const: deleting
          title: Deleting
          description: >-
            This space is currently being deleted, this might take a few
            minutes.
        - const: deleted
          title: Deleted
          description: This space has been deleted and can no longer be used.
        - const: canceled
          title: Canceled
          description: >-
            This space has been canceled, it will be deleted on the expiration
            date.
      default: new
      readOnly: true

````