curl --request POST \
--url https://api.ionworks.com/models \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"config": {},
"description": "<string>",
"pybamm_version": "<string>",
"chemistry": "lithium_ion",
"simulation_settings": {}
}
'import requests
url = "https://api.ionworks.com/models"
payload = {
"name": "<string>",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"config": {},
"description": "<string>",
"pybamm_version": "<string>",
"chemistry": "lithium_ion",
"simulation_settings": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
project_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
config: {},
description: '<string>',
pybamm_version: '<string>',
chemistry: 'lithium_ion',
simulation_settings: {}
})
};
fetch('https://api.ionworks.com/models', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ionworks.com/models",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'project_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'config' => [
],
'description' => '<string>',
'pybamm_version' => '<string>',
'chemistry' => 'lithium_ion',
'simulation_settings' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ionworks.com/models"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"config\": {},\n \"description\": \"<string>\",\n \"pybamm_version\": \"<string>\",\n \"chemistry\": \"lithium_ion\",\n \"simulation_settings\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ionworks.com/models")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"config\": {},\n \"description\": \"<string>\",\n \"pybamm_version\": \"<string>\",\n \"chemistry\": \"lithium_ion\",\n \"simulation_settings\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ionworks.com/models")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"config\": {},\n \"description\": \"<string>\",\n \"pybamm_version\": \"<string>\",\n \"chemistry\": \"lithium_ion\",\n \"simulation_settings\": {}\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"id": "<string>",
"organization_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"is_custom_model": true,
"description": "<string>",
"pybamm_version": "<string>",
"chemistry": "lithium_ion",
"simulation_settings": {},
"project_id": "<string>",
"user_id": "<string>",
"source_model_id": "<string>",
"created_by_email": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Create a new model within an organization
Create a new model in the specified organization.
curl --request POST \
--url https://api.ionworks.com/models \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"config": {},
"description": "<string>",
"pybamm_version": "<string>",
"chemistry": "lithium_ion",
"simulation_settings": {}
}
'import requests
url = "https://api.ionworks.com/models"
payload = {
"name": "<string>",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"config": {},
"description": "<string>",
"pybamm_version": "<string>",
"chemistry": "lithium_ion",
"simulation_settings": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
project_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
config: {},
description: '<string>',
pybamm_version: '<string>',
chemistry: 'lithium_ion',
simulation_settings: {}
})
};
fetch('https://api.ionworks.com/models', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ionworks.com/models",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'project_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'config' => [
],
'description' => '<string>',
'pybamm_version' => '<string>',
'chemistry' => 'lithium_ion',
'simulation_settings' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ionworks.com/models"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"config\": {},\n \"description\": \"<string>\",\n \"pybamm_version\": \"<string>\",\n \"chemistry\": \"lithium_ion\",\n \"simulation_settings\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ionworks.com/models")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"config\": {},\n \"description\": \"<string>\",\n \"pybamm_version\": \"<string>\",\n \"chemistry\": \"lithium_ion\",\n \"simulation_settings\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ionworks.com/models")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"config\": {},\n \"description\": \"<string>\",\n \"pybamm_version\": \"<string>\",\n \"chemistry\": \"lithium_ion\",\n \"simulation_settings\": {}\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"id": "<string>",
"organization_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"is_custom_model": true,
"description": "<string>",
"pybamm_version": "<string>",
"chemistry": "lithium_ion",
"simulation_settings": {},
"project_id": "<string>",
"user_id": "<string>",
"source_model_id": "<string>",
"created_by_email": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
Model for creating a new model.
The name of the model.
Project to create the model in. Must belong to the current organization.
Model configuration stored as JSON.
An optional description for the model.
PyBaMM version used for this model. If not provided, will be read from pybamm.version.
Model chemistry kind: 'lithium_ion' (default — assumes pybamm lithium-ion conventions), 'lithium_sulfur', 'ecm', or 'generic' (no chemistry-specific enrichment).
lithium_ion, lithium_sulfur, ecm, generic Optional persistent simulation kwargs (var_pts / submesh_types / spatial_methods / geometry / solver) in the flat canonical form, re-applied at simulation time. None uses the model defaults.
Response
Successful Response
Model representing a model as returned by the API (without config).
The name of the model.
The unique identifier for the model.
The ID of the organization this model belongs to.
Timestamp of when the model was created.
Timestamp of when the model was last updated.
Check if this is a custom model (has compressed model data).
An optional description for the model.
PyBaMM version used for this model. If not provided, will be read from pybamm.version.
Model chemistry kind: 'lithium_ion' (default — assumes pybamm lithium-ion conventions), 'lithium_sulfur', 'ecm', or 'generic' (no chemistry-specific enrichment).
lithium_ion, lithium_sulfur, ecm, generic Optional persistent simulation kwargs (var_pts / submesh_types / spatial_methods / geometry / solver) in the flat canonical form, re-applied at simulation time. None uses the model defaults.
Project this model belongs to. None only for the shared system catalog.
The ID of the user who created the model. None once that account is deleted.
For a project's copy of a system model, the system model it was copied from. None for a model the project made itself.
Email of the user who created the model.
Was this page helpful?