Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Model Variables

List Model Variables

get

Retrieves a paginated list of variables associated with a model. Note: Model variables, filter values, and notes can all be attached to different entity types via model_type and model_id.

Authorizations
AuthorizationstringRequired

API key passed in the Authorization header. Format: <api-key>

Query parameters
filter[variable_id]string[]Optional

Filter results by variable_id.

filter[model_type]stringOptional

Filter results by model_type.

filter[model_id]stringOptional

Filter results by model_id.

pageinteger · min: 1Optional

Page number for pagination.

Default: 1
per_pageinteger · min: 1 · max: 100Optional

Number of results per page.

Responses
200

Successful response

application/json
get/api/v1/model-variables
GET /api/v1/model-variables HTTP/1.1
Host: core.wearepatchworks.com
Authorization: YOUR_API_KEY
Accept: */*
{
  "data": [
    {
      "id": 1,
      "variable_id": 1,
      "alias": "example_alias",
      "configurable": "example_configurable",
      "required": "example_required",
      "advanced": "example_advanced",
      "model_type": "example_model_type",
      "model_id": 1,
      "created_at": "2025-01-15T10:30:00.000000Z",
      "updated_at": "2025-01-15T10:30:00.000000Z",
      "variable": {},
      "modified": "example_modified"
    }
  ],
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "path": "https://api.example.com/api/v1/model-variables",
    "per_page": 25,
    "to": 1,
    "total": 1
  },
  "links": {
    "first": "https://api.example.com/api/v1/model-variables?page=1",
    "last": "https://api.example.com/api/v1/model-variables?page=1",
    "prev": null,
    "next": null
  }
}

Create Model Variable

post

Creates a new variable association for a model. Note: Model variables, filter values, and notes can all be attached to different entity types via model_type and model_id.

Authorizations
AuthorizationstringRequired

API key passed in the Authorization header. Format: <api-key>

Body
variable_idstringRequired
aliasstring · nullableOptional
configurablestringOptional
requiredstringOptional
advancedstringOptional
model_typestringRequired
model_idstringRequired
Responses
200

Successful response

application/json
post/api/v1/model-variables
POST /api/v1/model-variables HTTP/1.1
Host: core.wearepatchworks.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 186

{
  "variable_id": 1,
  "alias": "example_alias",
  "configurable": "example_configurable",
  "required": "example_required",
  "advanced": "example_advanced",
  "model_type": "example_model_type",
  "model_id": 1
}
{
  "data": {
    "id": 1,
    "variable_id": 1,
    "alias": "example_alias",
    "configurable": "example_configurable",
    "required": "example_required",
    "advanced": "example_advanced",
    "model_type": "example_model_type",
    "model_id": 1,
    "created_at": "2025-01-15T10:30:00.000000Z",
    "updated_at": "2025-01-15T10:30:00.000000Z",
    "variable": {},
    "modified": "example_modified"
  }
}

Get Model Variable

get

Retrieves the details of a specific model variable. Note: Model variables, filter values, and notes can all be attached to different entity types via model_type and model_id.

Authorizations
AuthorizationstringRequired

API key passed in the Authorization header. Format: <api-key>

Path parameters
model_variablestringRequired

The model variable identifier.

Query parameters
Responses
200

Successful response

application/json
get/api/v1/model-variables/{model_variable}
GET /api/v1/model-variables/{model_variable} HTTP/1.1
Host: core.wearepatchworks.com
Authorization: YOUR_API_KEY
Accept: */*
{
  "data": {
    "id": 1,
    "variable_id": 1,
    "alias": "example_alias",
    "configurable": "example_configurable",
    "required": "example_required",
    "advanced": "example_advanced",
    "model_type": "example_model_type",
    "model_id": 1,
    "created_at": "2025-01-15T10:30:00.000000Z",
    "updated_at": "2025-01-15T10:30:00.000000Z",
    "variable": {},
    "modified": "example_modified"
  }
}

Update Model Variable

put

Updates an existing model variable. Note: Model variables, filter values, and notes can all be attached to different entity types via model_type and model_id.

Authorizations
AuthorizationstringRequired

API key passed in the Authorization header. Format: <api-key>

Path parameters
model_variablestringRequired

The model variable identifier.

Body
aliasstring · nullableOptional
configurablestringOptional
requiredstringOptional
advancedstringOptional
Responses
200

Successful response

application/json
put/api/v1/model-variables/{model_variable}
PUT /api/v1/model-variables/{model_variable} HTTP/1.1
Host: core.wearepatchworks.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 123

{
  "alias": "example_alias",
  "configurable": "example_configurable",
  "required": "example_required",
  "advanced": "example_advanced"
}
{
  "data": {
    "id": 1,
    "variable_id": 1,
    "alias": "example_alias",
    "configurable": "example_configurable",
    "required": "example_required",
    "advanced": "example_advanced",
    "model_type": "example_model_type",
    "model_id": 1,
    "created_at": "2025-01-15T10:30:00.000000Z",
    "updated_at": "2025-01-15T10:30:00.000000Z",
    "variable": {},
    "modified": "example_modified"
  }
}

Delete Model Variable

delete

Permanently deletes a specific model variable. Note: Model variables, filter values, and notes can all be attached to different entity types via model_type and model_id.

Authorizations
AuthorizationstringRequired

API key passed in the Authorization header. Format: <api-key>

Path parameters
model_variablestringRequired

The model variable identifier.

Responses
200

Successful response

application/json
messagestringOptional
delete/api/v1/model-variables/{model_variable}
DELETE /api/v1/model-variables/{model_variable} HTTP/1.1
Host: core.wearepatchworks.com
Authorization: YOUR_API_KEY
Accept: */*
{
  "message": "Action completed successfully."
}

Last updated

Was this helpful?