Skip to main content
POST
/
target-materials
/
{target_material_id}
/
layers
curl -X POST "https://api.atomscale.ai/target-materials/42/layers" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "layer_id": 1,
      "composition_string": "BaTiO3",
      "orientation": "001"
    },
    {
      "layer_id": 2,
      "composition_string": "SrTiO3"
    }
  ]'
{}
Replaces a target material’s entire layer stack. Send an array of layer objects, and they become the new stack for the target material.
target_material_id
integer
required
ID of the target material whose layers you are replacing
The request body is an array of layer objects. Each layer supports the fields below.
layer_id
integer
required
Layer position within the stack
sample_id
integer
ID of the parent target material
composition_string
string
Chemical composition of the layer (e.g., BaTiO3)
element_dict
object
Element counts or fractions that make up the layer
orientation
string
Crystallographic orientation of the layer
space_group
string
Space group of the layer
mp_id
string
Materials Project ID for the layer material
id
integer
Explicit record ID for the layer

Response

Returns an empty response on success.
curl -X POST "https://api.atomscale.ai/target-materials/42/layers" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "layer_id": 1,
      "composition_string": "BaTiO3",
      "orientation": "001"
    },
    {
      "layer_id": 2,
      "composition_string": "SrTiO3"
    }
  ]'
{}