# Create

Launch stage: GA

`POST /api/2.0/apps`

Creates a new app.

API scopes: apps

## Query parameters

- `no_compute` (boolean, optional)
  If true, the app will not be started after creation.

## Request body

- `app` (object, optional)
  - `name` (string, optional)
    The name of the app. The name must contain only lowercase alphanumeric characters and hyphens.
     It must be unique within the workspace.
    Example: `my-custom-app`
    Constraints: `[ 2 .. 30 ] characters`
  - `description` (string, optional)
    The description of the app.
    Example: `My app description.`
    Constraints: `<= 500 characters`
  - `compute_status` (object, optional)
    - `state` (string, optional)
      State of the app compute.
      Possible values: `COMPUTE_STATE_UNSPECIFIED`, `ERROR`, `DELETING`, `STARTING`, `STOPPING`, `UPDATING`, `STOPPED`, `ACTIVE`
    - `message` (string, optional)
      Compute status message
      Example: `App compute is active.`
  - `app_status` (object, optional)
    - `state` (string, optional)
      State of the application.
      Possible values: `APPLICATION_STATE_UNSPECIFIED`, `DEPLOYING`, `RUNNING`, `CRASHED`, `UNAVAILABLE`
    - `message` (string, optional)
      Application status message
      Example: `Application is running.`
  - `url` (string, optional)
    The URL of the app once it is deployed.
    Example: `my-custom-app-123.cloud.databricksapps.com`
  - `active_deployment` (object, optional)
    The active deployment of the app. A deployment is considered active when it has been deployed
     to the app compute.
    - `deployment_id` (string, optional)
      The unique id of the deployment.
      Example: `01ef0bda89f21f08a8351f41e4a9b948`
    - `source_code_path` (string, optional)
      The workspace file system path of the source code used to create the app deployment. This is different from
       `deployment_artifacts.source_code_path`, which is the path used by the deployed app. The former refers
       to the original source code location of the app in the workspace during deployment creation, whereas
       the latter provides a system generated stable snapshotted source code path used by the deployment.
      Example: `/Workspace/user@test.com/my_custom_app`
    - `git_source` (object, optional)
      Git repository to use as the source for the app deployment.
      - `git_repository` (object, optional)
        Git repository configuration. Populated from the app's git_repository configuration.
      - `branch` (string, required)
        Git branch to checkout.
        Example: `main`
        Constraints: `<= 255 characters`
      - `tag` (string, required)
        Git tag to checkout.
        Example: `v1.0.0`
        Constraints: `<= 255 characters`
      - `commit` (string, required)
        Git commit SHA to checkout.
        Example: `abc123def456`
        Constraints: `<= 64 characters`
      - `source_code_path` (string, optional)
        Relative path to the app source code within the Git repository. If not specified, the root
         of the repository is used.
        Example: `my-app`
        Constraints: `<= 500 characters`
      - `resolved_commit` (string, optional)
        The resolved commit SHA that was actually used for the deployment. This is populated by the
         system after resolving the reference (branch, tag, or commit). If commit is specified
         directly, this will match commit. If a branch or tag is specified, this contains the
         commit SHA that the branch or tag pointed to at deployment time.
        Example: `abc123def456789012345678901234567890abcd`
        Constraints: `<= 64 characters`
    - `mode` (string, optional)
      The mode of which the deployment will manage the source code.
      Possible values: `MODE_UNSPECIFIED`, `SNAPSHOT`, `AUTO_SYNC`
    - `deployment_artifacts` (object, optional)
      The deployment artifacts for an app.
      - `source_code_path` (string, optional)
        The snapshotted workspace file system path of the source code loaded by the deployed app.
        Example: `/Workspace/Users/9627a015-e892-43f7-9085-eec3892da408/src/01ef1a1ed75d1964b62234a35efa61fc`
    - `status` (object, optional)
      Status and status message of the deployment
      - `state` (string, optional)
        State of the deployment.
        Possible values: `STATE_UNSPECIFIED`, `SUCCEEDED`, `FAILED`, `IN_PROGRESS`, `CANCELLED`
      - `message` (string, optional)
        Message corresponding with the deployment state.
        Example: `Deployment is in progress.`
    - `create_time` (string, optional)
      The creation time of the deployment. Formatted timestamp in ISO 6801.
    - `creator` (string, optional)
      The email of the user creates the deployment.
      Example: `user@test.com`
    - `update_time` (string, optional)
      The update time of the deployment. Formatted timestamp in ISO 6801.
    - `command` (array of string, optional)
      The command with which to run the app. This will override the command specified in the app.yaml file.
      Example: `python app.py`
    - `env_vars` (array of object, optional)
      The environment variables to set in the app runtime environment. This will override the environment variables specified in the app.yaml file.
      - `name` (string, optional)
        The name of the environment variable.
        Example: `VOLUME_URI`
      - `value` (string, required)
        The value for the environment variable.
        Example: `/Volumes/catalog-name/schema-name/dir-name`
      - `value_from` (string, required)
        The name of an external <Databricks> resource that contains the value, such as a secret or a database table.
        Example: `volume`
  - `create_time` (string, optional)
    The creation time of the app. Formatted timestamp in ISO 6801.
  - `creator` (string, optional)
    The email of the user that created the app.
    Example: `user@test.com`
  - `update_time` (string, optional)
    The update time of the app. Formatted timestamp in ISO 6801.
  - `updater` (string, optional)
    The email of the user that last updated the app.
    Example: `user@test.com`
  - `pending_deployment` (object, optional)
    The pending deployment of the app. A deployment is considered pending when it is being prepared
     for deployment to the app compute.
    - `deployment_id` (string, optional)
      The unique id of the deployment.
      Example: `01ef0bda89f21f08a8351f41e4a9b948`
    - `source_code_path` (string, optional)
      The workspace file system path of the source code used to create the app deployment. This is different from
       `deployment_artifacts.source_code_path`, which is the path used by the deployed app. The former refers
       to the original source code location of the app in the workspace during deployment creation, whereas
       the latter provides a system generated stable snapshotted source code path used by the deployment.
      Example: `/Workspace/user@test.com/my_custom_app`
    - `git_source` (object, optional)
      Git repository to use as the source for the app deployment.
      - `git_repository` (object, optional)
        Git repository configuration. Populated from the app's git_repository configuration.
      - `branch` (string, required)
        Git branch to checkout.
        Example: `main`
        Constraints: `<= 255 characters`
      - `tag` (string, required)
        Git tag to checkout.
        Example: `v1.0.0`
        Constraints: `<= 255 characters`
      - `commit` (string, required)
        Git commit SHA to checkout.
        Example: `abc123def456`
        Constraints: `<= 64 characters`
      - `source_code_path` (string, optional)
        Relative path to the app source code within the Git repository. If not specified, the root
         of the repository is used.
        Example: `my-app`
        Constraints: `<= 500 characters`
      - `resolved_commit` (string, optional)
        The resolved commit SHA that was actually used for the deployment. This is populated by the
         system after resolving the reference (branch, tag, or commit). If commit is specified
         directly, this will match commit. If a branch or tag is specified, this contains the
         commit SHA that the branch or tag pointed to at deployment time.
        Example: `abc123def456789012345678901234567890abcd`
        Constraints: `<= 64 characters`
    - `mode` (string, optional)
      The mode of which the deployment will manage the source code.
      Possible values: `MODE_UNSPECIFIED`, `SNAPSHOT`, `AUTO_SYNC`
    - `deployment_artifacts` (object, optional)
      The deployment artifacts for an app.
      - `source_code_path` (string, optional)
        The snapshotted workspace file system path of the source code loaded by the deployed app.
        Example: `/Workspace/Users/9627a015-e892-43f7-9085-eec3892da408/src/01ef1a1ed75d1964b62234a35efa61fc`
    - `status` (object, optional)
      Status and status message of the deployment
      - `state` (string, optional)
        State of the deployment.
        Possible values: `STATE_UNSPECIFIED`, `SUCCEEDED`, `FAILED`, `IN_PROGRESS`, `CANCELLED`
      - `message` (string, optional)
        Message corresponding with the deployment state.
        Example: `Deployment is in progress.`
    - `create_time` (string, optional)
      The creation time of the deployment. Formatted timestamp in ISO 6801.
    - `creator` (string, optional)
      The email of the user creates the deployment.
      Example: `user@test.com`
    - `update_time` (string, optional)
      The update time of the deployment. Formatted timestamp in ISO 6801.
    - `command` (array of string, optional)
      The command with which to run the app. This will override the command specified in the app.yaml file.
      Example: `python app.py`
    - `env_vars` (array of object, optional)
      The environment variables to set in the app runtime environment. This will override the environment variables specified in the app.yaml file.
      - `name` (string, optional)
        The name of the environment variable.
        Example: `VOLUME_URI`
      - `value` (string, required)
        The value for the environment variable.
        Example: `/Volumes/catalog-name/schema-name/dir-name`
      - `value_from` (string, required)
        The name of an external <Databricks> resource that contains the value, such as a secret or a database table.
        Example: `volume`
  - `resources` (array of object, optional)
    Resources for the app.
    - `name` (string, optional)
      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, required)
      - `scope` (string, optional)
        Scope of the secret to grant permission on.
        Example: `my-scope`
      - `key` (string, optional)
        Key of the secret to grant permission on.
        Example: `my-key`
      - `permission` (string, optional)
        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, required)
      - `id` (string, optional)
        Id of the SQL warehouse to grant permission on.
        Example: `e9ca293f79a74b5c`
      - `permission` (string, optional)
        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, required)
      - `name` (string, optional)
        Name of the serving endpoint to grant permission on.
        Example: `databricks-meta-llama-3-1-70b-instruct`
      - `permission` (string, optional)
        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, required)
      - `id` (string, optional)
        Id of the job to grant permission on.
        Example: `1234`
      - `permission` (string, optional)
        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, required)
      - `securable_full_name` (string, optional)
        Example: `my-catalog.my-schema.my-volume`
      - `securable_type` (string, optional)
        Possible values: `VOLUME`, `TABLE`, `FUNCTION`, `CONNECTION`
        Example: `VOLUME`
      - `permission` (string, optional)
        Possible values: `READ_VOLUME`, `WRITE_VOLUME`, `SELECT`, `EXECUTE`, `USE_CONNECTION`, `MODIFY`
      - `securable_kind` (string, optional)
        The securable kind from Unity Catalog.
         See https://docs.databricks.com/api/workspace/tables/get#securable_kind_manifest-securable_kind.
    - `database` (object, required)
      - `instance_name` (string, optional)
        Example: `my-database-instance`
      - `database_name` (string, optional)
        Example: `my-database`
      - `permission` (string, optional)
        Possible values: `CAN_CONNECT_AND_CREATE`
        Example: `CAN_CONNECT_AND_CREATE`
    - `genie_space` (object, required)
      - `name` (string, optional)
        Example: `my-genie-space`
      - `space_id` (string, optional)
        Example: `550e8400-e29b-41d4-a716-446655440000`
      - `permission` (string, optional)
        Possible values: `CAN_MANAGE`, `CAN_EDIT`, `CAN_RUN`, `CAN_VIEW`
        Example: `CAN_MANAGE`
    - `experiment` (object, required)
      - `experiment_id` (string, optional)
        Example: `1021971371025173`
      - `permission` (string, optional)
        Possible values: `CAN_MANAGE`, `CAN_EDIT`, `CAN_READ`
        Example: `CAN_MANAGE`
    - `app` (object, required)
      - `name` (string, optional)
        Example: `my-app`
      - `permission` (string, optional)
        Possible values: `CAN_USE`
        Example: `CAN_USE`
    - `postgres` (object, required)
      - `branch` (string, optional)
        Example: `projects/proj-abc123/branches/branch-xyz789`
      - `database` (string, optional)
        Example: `projects/proj-abc123/branches/branch-xyz789/databases/db-456`
      - `permission` (string, optional)
        Possible values: `CAN_CONNECT_AND_CREATE`
        Example: `CAN_CONNECT_AND_CREATE`
  - `service_principal_id` (int64, optional)
  - `service_principal_name` (string, optional)
  - `default_source_code_path` (string, optional)
    The default workspace file system path of the source code from which app deployment are
     created. This field tracks the workspace source code path of the last active deployment.
    Example: `/Workspace/user@test.com/my_custom_app`
  - `default_git_source` (object, optional, Beta)
    The Git source of the app's most recent active deployment, including the repository
     configuration and the resolved reference. Populated by the system after a Git-based
     deployment and used as the default reference when automatic deployments are enabled.
    - `git_repository` (object, optional)
      Git repository configuration. Populated from the app's git_repository configuration.
      - `url` (string, optional)
        URL of the Git repository.
        Example: `https://github.com/databricks/git_app_repo.git`
        Constraints: `<= 300 characters`
      - `provider` (string, optional)
        Git provider. Case insensitive. Supported values: gitHub, gitHubEnterprise, bitbucketCloud,
         bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit.
        Example: `gitHub`
      - `auto_deploy` (boolean, optional, Beta)
        When true, automatically deploys the app on push events to the branch configured in
         the app's deployment_source.git_source.
      - `caller_credential_id` (int64, optional, Beta)
        ID of a personal access token Git credential owned by the caller, used to
         grant the app's service principal access to this repository.
        Example: `93488329053511`
    - `branch` (string, required)
      Git branch to checkout.
      Example: `main`
      Constraints: `<= 255 characters`
    - `tag` (string, required)
      Git tag to checkout.
      Example: `v1.0.0`
      Constraints: `<= 255 characters`
    - `commit` (string, required)
      Git commit SHA to checkout.
      Example: `abc123def456`
      Constraints: `<= 64 characters`
    - `source_code_path` (string, optional)
      Relative path to the app source code within the Git repository. If not specified, the root
       of the repository is used.
      Example: `my-app`
      Constraints: `<= 500 characters`
    - `resolved_commit` (string, optional)
      The resolved commit SHA that was actually used for the deployment. This is populated by the
       system after resolving the reference (branch, tag, or commit). If commit is specified
       directly, this will match commit. If a branch or tag is specified, this contains the
       commit SHA that the branch or tag pointed to at deployment time.
      Example: `abc123def456789012345678901234567890abcd`
      Constraints: `<= 64 characters`
  - `budget_policy_id` (string, optional, Public Preview)
    Constraints: `= 36 characters`
  - `effective_budget_policy_id` (string, optional, Public Preview)
  - `service_principal_client_id` (string, optional)
  - `user_api_scopes` (array of string, optional, Public Preview)
  - `id` (string, optional)
    The unique identifier of the app.
  - `effective_user_api_scopes` (array of string, optional, Public Preview)
    The effective api scopes granted to the user access token.
  - `oauth2_app_integration_id` (string, optional, Public Preview)
  - `oauth2_app_client_id` (string, optional, Public Preview)
  - `compute_size` (string, optional)
    Possible values: `MEDIUM`, `LARGE`, `XLARGE`
  - `usage_policy_id` (string, optional, Public Preview)
    Constraints: `= 36 characters`
  - `effective_usage_policy_id` (string, optional, Public Preview)
  - `git_repository` (object, optional)
    Git repository configuration for app deployments. When specified, deployments can
     reference code from this repository by providing only the git reference (branch, tag, or commit).
    - `url` (string, optional)
      URL of the Git repository.
      Example: `https://github.com/databricks/git_app_repo.git`
      Constraints: `<= 300 characters`
    - `provider` (string, optional)
      Git provider. Case insensitive. Supported values: gitHub, gitHubEnterprise, bitbucketCloud,
       bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit.
      Example: `gitHub`
    - `auto_deploy` (boolean, optional, Beta)
      When true, automatically deploys the app on push events to the branch configured in
       the app's deployment_source.git_source.
    - `caller_credential_id` (int64, optional, Beta)
      ID of a personal access token Git credential owned by the caller, used to
       grant the app's service principal access to this repository.
      Example: `93488329053511`
  - `telemetry_export_destinations` (array of object, optional, Public Preview)
    - `unity_catalog` (object, required, Public Preview)
      - `logs_table` (string, optional, Public Preview)
        Unity Catalog table for OTEL logs.
      - `metrics_table` (string, optional, Public Preview)
        Unity Catalog table for OTEL metrics.
      - `traces_table` (string, optional, Public Preview)
        Unity Catalog table for OTEL traces (spans).
  - `thumbnail_url` (string, optional)
    The URL of the thumbnail image for the app.
    Example: `/ajax-api/2.0/thumbnails/raw/apps/{id}/SMALL_DEFAULT.png`
  - `source_code_path` (string, required, Beta)
    Example: `/Workspace/user@test.com/my_custom_app`
  - `git_source` (object, required, Beta)
    The Git source to deploy from, specifying the reference to check out (branch, tag, or
     commit) and an optional path to the app source code within the repository configured in
     git_repository.
    - `git_repository` (object, optional)
      Git repository configuration. Populated from the app's git_repository configuration.
      - `url` (string, optional)
        URL of the Git repository.
        Example: `https://github.com/databricks/git_app_repo.git`
        Constraints: `<= 300 characters`
      - `provider` (string, optional)
        Git provider. Case insensitive. Supported values: gitHub, gitHubEnterprise, bitbucketCloud,
         bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit.
        Example: `gitHub`
      - `auto_deploy` (boolean, optional, Beta)
        When true, automatically deploys the app on push events to the branch configured in
         the app's deployment_source.git_source.
      - `caller_credential_id` (int64, optional, Beta)
        ID of a personal access token Git credential owned by the caller, used to
         grant the app's service principal access to this repository.
        Example: `93488329053511`
    - `branch` (string, required)
      Git branch to checkout.
      Example: `main`
      Constraints: `<= 255 characters`
    - `tag` (string, required)
      Git tag to checkout.
      Example: `v1.0.0`
      Constraints: `<= 255 characters`
    - `commit` (string, required)
      Git commit SHA to checkout.
      Example: `abc123def456`
      Constraints: `<= 64 characters`
    - `source_code_path` (string, optional)
      Relative path to the app source code within the Git repository. If not specified, the root
       of the repository is used.
      Example: `my-app`
      Constraints: `<= 500 characters`
    - `resolved_commit` (string, optional)
      The resolved commit SHA that was actually used for the deployment. This is populated by the
       system after resolving the reference (branch, tag, or commit). If commit is specified
       directly, this will match commit. If a branch or tag is specified, this contains the
       commit SHA that the branch or tag pointed to at deployment time.
      Example: `abc123def456789012345678901234567890abcd`
      Constraints: `<= 64 characters`

## Returns

Returns the App object.

## Response

```json
{
  "name": "my-custom-app",
  "description": "My app description.",
  "compute_status": {
    "state": "string",
    "message": "App compute is active."
  },
  "app_status": {
    "state": "string",
    "message": "Application is running."
  },
  "url": "my-custom-app-123.cloud.databricksapps.com",
  "active_deployment": {
    "deployment_id": "01ef0bda89f21f08a8351f41e4a9b948",
    "source_code_path": "/Workspace/user@test.com/my_custom_app",
    "git_source": {},
    "mode": "string",
    "deployment_artifacts": {},
    "status": {},
    "create_time": "string",
    "creator": "user@test.com",
    "update_time": "string",
    "command": "python app.py",
    "env_vars": [
      {}
    ]
  },
  "create_time": "string",
  "creator": "user@test.com",
  "update_time": "string",
  "updater": "user@test.com",
  "pending_deployment": {
    "deployment_id": "01ef0bda89f21f08a8351f41e4a9b948",
    "source_code_path": "/Workspace/user@test.com/my_custom_app",
    "git_source": {},
    "mode": "string",
    "deployment_artifacts": {},
    "status": {},
    "create_time": "string",
    "creator": "user@test.com",
    "update_time": "string",
    "command": "python app.py",
    "env_vars": [
      {}
    ]
  },
  "resources": [
    {
      "name": "api-key",
      "description": "API key for external service.",
      "secret": {},
      "sql_warehouse": {},
      "serving_endpoint": {},
      "job": {},
      "uc_securable": {},
      "database": {},
      "genie_space": {},
      "experiment": {},
      "app": {},
      "postgres": {}
    }
  ],
  "service_principal_id": 0,
  "service_principal_name": "string",
  "default_source_code_path": "/Workspace/user@test.com/my_custom_app",
  "default_git_source": {
    "git_repository": {},
    "branch": "main",
    "tag": "v1.0.0",
    "commit": "abc123def456",
    "source_code_path": "my-app",
    "resolved_commit": "abc123def456789012345678901234567890abcd"
  },
  "budget_policy_id": "string",
  "effective_budget_policy_id": "string",
  "service_principal_client_id": "string",
  "user_api_scopes": [
    "string"
  ],
  "id": "string",
  "effective_user_api_scopes": [
    "string"
  ],
  "oauth2_app_integration_id": "string",
  "oauth2_app_client_id": "string",
  "compute_size": "string",
  "usage_policy_id": "string",
  "effective_usage_policy_id": "string",
  "git_repository": {
    "url": "https://github.com/databricks/git_app_repo.git",
    "provider": "gitHub",
    "auto_deploy": true,
    "caller_credential_id": 93488329053511
  },
  "telemetry_export_destinations": [
    {
      "unity_catalog": {}
    }
  ],
  "thumbnail_url": "/ajax-api/2.0/thumbnails/raw/apps/{id}/SMALL_DEFAULT.png",
  "source_code_path": "/Workspace/user@test.com/my_custom_app",
  "git_source": {
    "git_repository": {},
    "branch": "main",
    "tag": "v1.0.0",
    "commit": "abc123def456",
    "source_code_path": "my-app",
    "resolved_commit": "abc123def456789012345678901234567890abcd"
  }
}
```

