# Create an app space

Launch stage: Beta

`POST /api/2.0/app-spaces`

Creates a new app space.

API scopes: apps

## Request body

- `name` (string, required)
  The name of the app space. The name must contain only lowercase alphanumeric characters and hyphens.
   It must be unique within the workspace.
  Example: `my-space`
  Constraints: `[ 2 .. 30 ] characters`
- `description` (string, optional)
  The description of the app space.
  Example: `My app space for team applications.`
  Constraints: `<= 500 characters`
- `resources` (array of object, optional)
  Resources for the app space. Resources configured at the space level are available to all apps in the space.
  - `name` (string, required)
    Name of the App Resource.
    Example: `api-key`
    Constraints: `[ 2 .. 30 ] characters`
  - `description` (string, optional)
    Description of the App Resource.
    Example: `API key for external service.`
    Constraints: `<= 50 characters`
  - `secret` (object, optional)
    - `scope` (string, required)
      Scope of the secret to grant permission on.
      Example: `my-scope`
    - `key` (string, required)
      Key of the secret to grant permission on.
      Example: `my-key`
    - `permission` (string, required)
      Permission to grant on the secret scope. For secrets, only one permission is allowed. Permission must be one of: "READ", "WRITE", "MANAGE".
      Possible values:
      - `READ`
      - `WRITE`
      - `MANAGE`
      Example: `READ`
  - `sql_warehouse` (object, optional)
    - `id` (string, required)
      Id of the SQL warehouse to grant permission on.
      Example: `e9ca293f79a74b5c`
    - `permission` (string, required)
      Permission to grant on the SQL warehouse. Supported permissions are: "CAN_MANAGE", "CAN_USE", "IS_OWNER".
      Possible values:
      - `CAN_MANAGE`
      - `CAN_USE`
      - `IS_OWNER`
      Example: `CAN_USE`
  - `serving_endpoint` (object, optional)
    - `name` (string, required)
      Name of the serving endpoint to grant permission on.
      Example: `databricks-meta-llama-3-1-70b-instruct`
    - `permission` (string, required)
      Permission to grant on the serving endpoint. Supported permissions are: "CAN_MANAGE", "CAN_QUERY", "CAN_VIEW".
      Possible values:
      - `CAN_MANAGE`
      - `CAN_QUERY`
      - `CAN_VIEW`
      Example: `CAN_QUERY`
  - `job` (object, optional)
    - `id` (string, required)
      Id of the job to grant permission on.
      Example: `1234`
    - `permission` (string, required)
      Permissions to grant on the Job. Supported permissions are: "CAN_MANAGE", "IS_OWNER", "CAN_MANAGE_RUN", "CAN_VIEW".
      Possible values:
      - `CAN_MANAGE`
      - `IS_OWNER`
      - `CAN_MANAGE_RUN`
      - `CAN_VIEW`
      Example: `CAN_VIEW`
  - `uc_securable` (object, optional)
    - `securable_full_name` (string, required)
      Example: `my-catalog.my-schema.my-volume`
    - `securable_type` (string, required)
      Possible values:
      - `VOLUME`
      - `TABLE`
      - `FUNCTION`
      - `CONNECTION`
      - `MODEL_SERVICE`
      Example: `VOLUME`
    - `permission` (string, required)
      Possible values:
      - `READ_VOLUME`
      - `WRITE_VOLUME`
      - `SELECT`
      - `EXECUTE`
      - `USE_CONNECTION`
      - `MODIFY`
  - `database` (object, optional)
    - `instance_name` (string, required)
      Example: `my-database-instance`
    - `database_name` (string, required)
      Example: `my-database`
    - `permission` (string, required)
      Possible values:
      - `CAN_CONNECT_AND_CREATE`
      Example: `CAN_CONNECT_AND_CREATE`
  - `genie_space` (object, optional)
    - `name` (string, required)
      Example: `my-genie-space`
    - `space_id` (string, required)
      Example: `550e8400-e29b-41d4-a716-446655440000`
    - `permission` (string, required)
      Possible values:
      - `CAN_MANAGE`
      - `CAN_EDIT`
      - `CAN_RUN`
      - `CAN_VIEW`
      Example: `CAN_MANAGE`
  - `experiment` (object, optional)
    - `experiment_id` (string, required)
      Example: `1021971371025173`
    - `permission` (string, required)
      Possible values:
      - `CAN_MANAGE`
      - `CAN_EDIT`
      - `CAN_READ`
      Example: `CAN_MANAGE`
  - `app` (object, optional, GA)
    - `name` (string, optional, GA)
      Example: `my-app`
    - `permission` (string, optional, GA)
      Possible values:
      - `CAN_USE`
      Example: `CAN_USE`
  - `postgres` (object, optional, GA)
    - `branch` (string, optional, GA)
      Example: `projects/proj-abc123/branches/branch-xyz789`
    - `database` (string, optional, GA)
      Example: `projects/proj-abc123/branches/branch-xyz789/databases/db-456`
    - `permission` (string, optional, GA)
      Possible values:
      - `CAN_CONNECT_AND_CREATE`
      Example: `CAN_CONNECT_AND_CREATE`
- `user_api_scopes` (array of string, optional)
  OAuth scopes for apps in the space.
- `usage_policy_id` (string, uuid, optional)
  The usage policy ID for managing cost at the space level.
  Example: `550e8400-e29b-41d4-a716-446655440000`
  Constraints: `= 36 characters`

## Returns

- `name` (string, optional)
  The server-assigned name, which is only unique within the same service that
   originally returns it. If you use the default HTTP mapping, the
   `name` should be a resource name ending with `operations/{unique_id}`.
- `metadata` (object, optional)
  Service-specific metadata associated with the operation.  It typically
   contains progress information and common metadata such as create time.
   Some services might not provide such metadata.
- `done` (boolean, optional)
  If the value is `false`, it means the operation is still in progress.
   If `true`, the operation is completed, and either `error` or `response` is
   available.
- `error` (object, optional)
  The error result of the operation in case of failure or cancellation.
  - `error_code` (string, optional)
    Possible values:
    - `UNKNOWN`
    - `INTERNAL_ERROR`
    - `TEMPORARILY_UNAVAILABLE`
    - `IO_ERROR`
    - `BAD_REQUEST`
    - `SERVICE_UNDER_MAINTENANCE`
    - `WORKSPACE_TEMPORARILY_UNAVAILABLE`
    - `DEADLINE_EXCEEDED`
    - `CANCELLED`
    - `RESOURCE_EXHAUSTED`
    - `ABORTED`
    - `NOT_FOUND`
    - `ALREADY_EXISTS`
    - `UNAUTHENTICATED`
    - `UNAVAILABLE`
    - `INVALID_PARAMETER_VALUE`
    - `ENDPOINT_NOT_FOUND`
    - `MALFORMED_REQUEST`
    - `INVALID_STATE`
    - `PERMISSION_DENIED`
    - `FEATURE_DISABLED`
    - `CUSTOMER_UNAUTHORIZED`
    - `REQUEST_LIMIT_EXCEEDED`
    - `RESOURCE_CONFLICT`
    - `UNPARSEABLE_HTTP_ERROR`
    - `NOT_IMPLEMENTED`
    - `DATA_LOSS`
    - `INVALID_STATE_TRANSITION`
    - `COULD_NOT_ACQUIRE_LOCK`
    - `RESOURCE_ALREADY_EXISTS`
    - `RESOURCE_DOES_NOT_EXIST`
    - `QUOTA_EXCEEDED`
    - `MAX_BLOCK_SIZE_EXCEEDED`
    - `MAX_READ_SIZE_EXCEEDED`
    - `PARTIAL_DELETE`
    - `MAX_LIST_SIZE_EXCEEDED`
    - `DRY_RUN_FAILED`
    - `RESOURCE_LIMIT_EXCEEDED`
    - `DIRECTORY_NOT_EMPTY`
    - `DIRECTORY_PROTECTED`
    - `MAX_NOTEBOOK_SIZE_EXCEEDED`
    - `MAX_CHILD_NODE_SIZE_EXCEEDED`
    - `SEARCH_QUERY_TOO_LONG`
    - `SEARCH_QUERY_TOO_SHORT`
    - `MANAGED_RESOURCE_GROUP_DOES_NOT_EXIST`
    - `PERMISSION_NOT_PROPAGATED`
    - `DEPLOYMENT_TIMEOUT`
    - `GIT_CONFLICT`
    - `GIT_UNKNOWN_REF`
    - `GIT_SENSITIVE_TOKEN_DETECTED`
    - `GIT_URL_NOT_ON_ALLOW_LIST`
    - `GIT_REMOTE_ERROR`
    - `PROJECTS_OPERATION_TIMEOUT`
    - `IPYNB_FILE_IN_REPO`
    - `INSECURE_PARTNER_RESPONSE`
    - `MALFORMED_PARTNER_RESPONSE`
    - `METASTORE_DOES_NOT_EXIST`
    - `DAC_DOES_NOT_EXIST`
    - `CATALOG_DOES_NOT_EXIST`
    - `SCHEMA_DOES_NOT_EXIST`
    - `TABLE_DOES_NOT_EXIST`
    - `SHARE_DOES_NOT_EXIST`
    - `RECIPIENT_DOES_NOT_EXIST`
    - `STORAGE_CREDENTIAL_DOES_NOT_EXIST`
    - `EXTERNAL_LOCATION_DOES_NOT_EXIST`
    - `PRINCIPAL_DOES_NOT_EXIST`
    - `PROVIDER_DOES_NOT_EXIST`
    - `METASTORE_ALREADY_EXISTS`
    - `DAC_ALREADY_EXISTS`
    - `CATALOG_ALREADY_EXISTS`
    - `SCHEMA_ALREADY_EXISTS`
    - `TABLE_ALREADY_EXISTS`
    - `SHARE_ALREADY_EXISTS`
    - `RECIPIENT_ALREADY_EXISTS`
    - `STORAGE_CREDENTIAL_ALREADY_EXISTS`
    - `EXTERNAL_LOCATION_ALREADY_EXISTS`
    - `PROVIDER_ALREADY_EXISTS`
    - `CATALOG_NOT_EMPTY`
    - `SCHEMA_NOT_EMPTY`
    - `METASTORE_NOT_EMPTY`
    - `PROVIDER_SHARE_NOT_ACCESSIBLE`
  - `message` (string, optional)
  - `stack_trace` (string, optional)
  - `details` (array of object, optional)
- `response` (object, optional)
  The normal, successful response of the operation.

## Response

```json
{
  "name": "string",
  "metadata": {},
  "done": true,
  "error": {
    "error_code": "UNKNOWN",
    "message": "string",
    "stack_trace": "string",
    "details": [
      {}
    ]
  },
  "response": {}
}
```

