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

# Create Workspace

> Create a new workspace

## Overview

Creates a new workspace. The authenticated user becomes the workspace owner automatically.

## Request Body

<ParamField body="name" type="string" required>
  Name for the new workspace
</ParamField>

## Response

<ResponseField name="workspace" type="object">
  The newly created workspace object

  <Expandable title="Workspace properties">
    <ResponseField name="id" type="integer">
      Unique workspace identifier
    </ResponseField>

    <ResponseField name="name" type="string">
      Workspace name
    </ResponseField>

    <ResponseField name="owner_id" type="integer">
      ID of the workspace owner
    </ResponseField>

    <ResponseField name="members_count" type="integer">
      Number of members (starts at 1)
    </ResponseField>

    <ResponseField name="currentUser" type="object">
      Current user's membership details
    </ResponseField>

    <ResponseField name="owner" type="object">
      Workspace owner details
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="status" type="string">
  Request status (`success`)
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://app.drime.cloud/api/v1/workspace \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "My New Workspace"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://app.drime.cloud/api/v1/workspace', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'My New Workspace'
    })
  });

  const { workspace } = await response.json();
  console.log(`Created workspace: ${workspace.name} (ID: ${workspace.id})`);
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://app.drime.cloud/api/v1/workspace',
      headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'},
      json={'name': 'My New Workspace'}
  )

  workspace = response.json()['workspace']
  print(f"Created workspace: {workspace['name']} (ID: {workspace['id']})")
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "workspace": {
      "owner_id": 15843,
      "name": "My New Workspace",
      "updated_at": "2025-12-18T18:39:45.000000Z",
      "created_at": "2025-12-18T18:39:45.000000Z",
      "id": 1874,
      "members_count": 1,
      "currentUser": {
        "role_name": "Workspace Owner",
        "email": "user@example.com",
        "workspace_id": 1874,
        "role_id": 3,
        "is_owner": true
      },
      "owner": {
        "role_name": "Workspace Owner",
        "email": "user@example.com",
        "is_owner": true
      }
    },
    "status": "success"
  }
  ```

  ```json 422 - Validation Error theme={null}
  {
    "status": "error",
    "message": "The given data was invalid.",
    "errors": {
      "name": "The name field is required."
    }
  }
  ```
</ResponseExample>
