Model Variables
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.
API key passed in the Authorization header. Format: <api-key>
Filter results by variable_id.
Filter results by model_type.
Filter results by model_id.
Page number for pagination.
1Number of results per page.
Successful response
Unauthenticated
Unauthorized
Too Many Requests. The rate limit for this user has been reached.
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
}
}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.
API key passed in the Authorization header. Format: <api-key>
Successful response
Unauthenticated
Unauthorized
Validation Error
Too Many Requests. The rate limit for this user has been reached.
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"
}
}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.
API key passed in the Authorization header. Format: <api-key>
The model variable identifier.
Successful response
Unauthenticated
Unauthorized
Not Found. The record does not exist.
Too Many Requests. The rate limit for this user has been reached.
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"
}
}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.
API key passed in the Authorization header. Format: <api-key>
The model variable identifier.
Successful response
Unauthenticated
Unauthorized
Not Found. The record does not exist.
Validation Error
Too Many Requests. The rate limit for this user has been reached.
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"
}
}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.
API key passed in the Authorization header. Format: <api-key>
The model variable identifier.
Successful response
Unauthenticated
Unauthorized
Not Found. The record does not exist.
Too Many Requests. The rate limit for this user has been reached.
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?