Company logoTrust Center Documentation

Create a variant

Create a new variant for the tenant. Options can be created inline via the `options` array. When `order` is omitted it is auto-assigned to the end of the list.

POST
/api/v1/variants

Create a new variant for the tenant. Options can be created inline via the options array. When order is omitted it is auto-assigned to the end of the list.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/variants" \  -H "Content-Type: application/json" \  -d '{    "title": "Industry",    "slug": "industry",    "enabled": true,    "translations": [      {        "languages_code": "en-US",        "title": "Industry"      },      {        "languages_code": "de-DE",        "title": "Branche"      }    ],    "options": [      {        "title": "FinTech",        "slug": "fintech",        "translations": [          {            "languages_code": "en-US",            "title": "FinTech"          }        ]      },      {        "title": "HealthTech",        "slug": "healthtech"      }    ]  }'
{
  "success": true,
  "data": {
    "variant": {
      "id": "string",
      "title": "string",
      "slug": "string",
      "enabled": true,
      "order": 0,
      "translations": [
        {
          "id": "string",
          "languages_code": "en-US",
          "title": "string"
        }
      ],
      "options": [
        {
          "id": "string",
          "title": "string",
          "slug": "string",
          "enabled": true,
          "order": 0,
          "translations": [
            {
              "id": "string",
              "languages_code": "en-US",
              "title": "string"
            }
          ]
        }
      ]
    }
  }
}
{
  "error": "string"
}
Empty
{
  "error": "slug_already_exists"
}
Empty

How is this guide?