Skip to main content
POST
/
v4
/
application-variants
Python
import os
from scale_gp import SGPClient

client = SGPClient(
    api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
)
application_variant = client.application_variants.create(
    account_id="account_id",
    application_spec_id="application_spec_id",
    configuration={
        "edges": [{
            "from_field": "from_field",
            "from_node": "from_node",
            "to_field": "to_field",
            "to_node": "to_node",
        }],
        "nodes": [{
            "id": "id",
            "application_node_schema_id": "text_input_schema",
        }],
    },
    name="name",
    version="V0",
)
print(application_variant)
{
  "id": "<string>",
  "name": "<string>",
  "configuration": {
    "nodes": [
      {
        "id": "<string>",
        "application_node_schema_id": "text_input_schema",
        "configuration": {}
      }
    ],
    "edges": [
      {
        "from_node": "<string>",
        "to_node": "<string>",
        "from_field": "<string>",
        "to_field": "<string>"
      }
    ],
    "metadata": {}
  },
  "version": "<string>",
  "application_spec_id": "<string>",
  "draft": true,
  "account_id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "description": "<string>",
  "published_at": "2023-11-07T05:31:56Z",
  "created_by_user_id": "<string>",
  "created_by_identity_type": "user"
}

Authorizations

x-api-key
string
header
required

Headers

x-selected-account-id
string | null

Body

application/json
name
string
required
configuration
ApplicationConfigurationV0 · object
required
version
string
required
Allowed value: "V0"
application_spec_id
string
required
account_id
string
required

The ID of the account that owns the given entity.

description
string

Optional description of the application variant

draft
boolean

Boolean to indicate whether the variant is in draft mode

published_at
string<date-time>

The date and time that the variant was published.

Response

Successful Response

id
string
required
name
string
required
configuration
ApplicationConfigurationV0 · object
required
version
string
required
Allowed value: "V0"
application_spec_id
string
required
draft
boolean
required

Boolean to indicate whether the variant is in draft mode

account_id
string
required

The ID of the account that owns the given entity.

created_at
string<date-time>
required

The date and time when the entity was created in ISO format.

updated_at
string<date-time>
required

The date and time when the entity was last updated in ISO format.

description
string

Optional description of the application variant

published_at
string<date-time>

The date and time that the variant was published.

created_by_user_id
string

The user who originally created the entity.

created_by_identity_type
enum<string>

The type of identity that created the entity.

Available options:
user,
service_account