# Transition Model Version Stage Databricks

Launch stage: GA

`POST /api/2.0/mlflow/databricks/model-versions/transition-stage`

Transition a model version's stage.
 This is a <Databricks> workspace version of the [MLflow endpoint](https://www.mlflow.org/docs/latest/rest-api.html#transition-modelversion-stage)
 that also accepts a comment associated with the transition to be recorded.

API scopes: mlflow

## Request body

- `name` (string, optional)
  Name of the model.
  Example: `search_ads_model`
  Constraints: `[ 1 .. 100 ] characters`
- `version` (string, optional)
  Version of the model.
  Example: `1`
- `stage` (string, optional)
  Target stage of the transition. Valid values are:
   
   * `None`: The initial stage of a model version.
   
   * `Staging`: Staging or pre-production stage.
   
   * `Production`: Production stage.
   
   * `Archived`: Archived stage.
- `archive_existing_versions` (boolean, optional)
  Specifies whether to archive all current model versions in the target stage.
  Example: `true`
- `comment` (string, optional)
  User-provided comment on the action.
  Example: `This version is great!`
  Constraints: `[ 1 .. 65535 ] characters`

## Returns

- `model_version_databricks` (object, optional)
  Updated model version
  - `name` (string, optional)
    Name of the model.
    Example: `search_ads_model`
    Constraints: `[ 1 .. 100 ] characters`
  - `version` (string, optional)
    Version of the model.
    Example: `1`
  - `creation_timestamp` (int64, optional)
    Creation time of the object, as a Unix timestamp in milliseconds.
    Example: `1594437249910`
  - `last_updated_timestamp` (int64, optional)
    Time of the object at last update, as a Unix timestamp in milliseconds.
    Example: `1594437549910`
  - `user_id` (string, optional)
    The username of the user that created the object.
    Example: `jane.doe@example.com`
  - `current_stage` (string, optional)
  - `description` (string, optional)
    User-specified description for the object.
    Example: `Here's some extra info.`
    Constraints: `<= 65535 characters`
  - `source` (string, optional)
    URI that indicates the location of the source model artifacts. This is used when creating the model version.
    Example: `dbfs:/databricks/mlflow-tracking/run123/model`
  - `run_id` (string, optional)
    Unique identifier for the MLflow tracking run associated with the source model artifacts.
    Example: `6fc74c92704341aaa49e74dcc6031057`
  - `status` (string, optional)
    Possible values: `PENDING_REGISTRATION`, `FAILED_REGISTRATION`, `READY`
  - `status_message` (string, optional)
    Details on the current status, for example why registration failed.
    Example: `Source could not be found.`
  - `open_requests` (array of object, optional)
    Open requests for this `model_versions`.
     Gap in sequence number is intentional and is done in order to
     match field sequence numbers of `ModelVersion` proto message
    - `creation_timestamp` (int64, optional)
      Creation time of the object, as a Unix timestamp in milliseconds.
      Example: `1594437249910`
    - `user_id` (string, optional)
      The username of the user that created the object.
      Example: `jane.doe@example.com`
    - `activity_type` (string, optional)
      Possible values: `APPLIED_TRANSITION`, `REQUESTED_TRANSITION`, `CANCELLED_REQUEST`, `APPROVED_REQUEST`, `REJECTED_REQUEST`, `NEW_COMMENT`, `SYSTEM_TRANSITION`
    - `comment` (string, optional)
      User-provided comment associated with the activity, comment, or transition request.
      Example: `This version is great!`
      Constraints: `[ 1 .. 65535 ] characters`
    - `last_updated_timestamp` (int64, optional)
      Time of the object at last update, as a Unix timestamp in milliseconds.
      Example: `1594437549910`
    - `from_stage` (string, optional)
      Source stage of the transition (if the activity is stage transition related). Valid values are:
       
       * `None`: The initial stage of a model version.
       
       * `Staging`: Staging or pre-production stage.
       
       * `Production`: Production stage.
       
       * `Archived`: Archived stage.
    - `to_stage` (string, optional)
      Target stage of the transition (if the activity is stage transition related). Valid values are:
       
       * `None`: The initial stage of a model version.
       
       * `Staging`: Staging or pre-production stage.
       
       * `Production`: Production stage.
       
       * `Archived`: Archived stage.
    - `system_comment` (string, optional)
      Comment made by system, for example explaining an activity of type `SYSTEM_TRANSITION`. It usually describes a side effect, such as a version being archived as part of another version's stage transition, and may not be returned for some activity types.
    - `available_actions` (array of string, optional)
      Array of actions on the activity allowed for the current viewer.
      Possible values: `APPROVE_TRANSITION_REQUEST`, `REJECT_TRANSITION_REQUEST`, `CANCEL_TRANSITION_REQUEST`, `EDIT_COMMENT`, `DELETE_COMMENT`
    - `id` (string, optional)
      Unique identifier for the object.
      Example: `6fc74c92704341aaa49e74dcc6031057`
  - `permission_level` (string, optional)
    Possible values: `CAN_MANAGE`, `CAN_EDIT`, `CAN_READ`, `CAN_MANAGE_STAGING_VERSIONS`, `CAN_MANAGE_PRODUCTION_VERSIONS`, `CAN_CREATE_REGISTERED_MODEL`
  - `tags` (array of object, optional)
    Array of tags that are associated with the model version.
    - `key` (string, optional)
      The tag key.
    - `value` (string, optional)
      The tag value.
  - `run_link` (string, optional)
    URL of the run associated with the model artifacts. This field is set at model version creation time only for model versions whose source run is from a tracking server that is different from the registry server.
    Example: `https://<databricks-instance>/#mlflow/experiments/28774367/runs/6fc74c92704341aaa49e74dcc6031057`
  - `email_subscription_status` (string, optional)
    Email Subscription Status: This is the subscription status of the user to the model version
     Users get subscribed by interacting with the model version.
    Possible values: `ALL_EVENTS`, `DEFAULT`, `SUBSCRIBED`, `UNSUBSCRIBED`
  - `feature_list` (object, optional)
    Feature lineage of `model_version`.
    - `features` (array of object, optional)
      - `feature_table_name` (string, optional)
        Feature table name
      - `feature_name` (string, optional)
        Feature name
      - `feature_table_id` (string, optional)
        Feature table id

## Response

```json
{
  "model_version_databricks": {
    "name": "search_ads_model",
    "version": "1",
    "creation_timestamp": 1594437249910,
    "last_updated_timestamp": 1594437549910,
    "user_id": "jane.doe@example.com",
    "current_stage": "string",
    "description": "Here's some extra info.",
    "source": "dbfs:/databricks/mlflow-tracking/run123/model",
    "run_id": "6fc74c92704341aaa49e74dcc6031057",
    "status": "string",
    "status_message": "Source could not be found.",
    "open_requests": [
      {}
    ],
    "permission_level": "string",
    "tags": [
      {}
    ],
    "run_link": "https://\u003cdatabricks-instance\u003e/#mlflow/experiments/28774367/runs/6fc74c92704341aaa49e74dcc6031057",
    "email_subscription_status": "string",
    "feature_list": {}
  }
}
```

