---
agentTools:
  projectIndex: https://somnio.readme.io/llms.txt
---

# Update a Layer

The `/v1/layer/{id}` route is a robust interface for interacting with individual layers within a Metafuse project, offering functionalities to fetch, update, or delete a specific layer. Here’s a detailed breakdown of the available operations on this route:

- **GET Method:**
  Retrieves the details of a specified layer.
  - `id` (required, path): Identifies the layer to fetch.
  - `lastEvaluatedKey` (optional, query): Fetches paginated data if returned from a previous query.
  A successful query returns a `200` status code along with the layer's details, while a `400` status code denotes client-side errors like missing required parameters or incorrect query format.

- **PUT Method:**
  Updates the specified layer’s details with the provided JSON payload adhering to the schema (`MetafuApiDepAONIR6hxU6Q`).
  - `id` (required, path): Identifies the layer to update.
  - `regenerate` (optional, path): Regenerate items that utilized the updated layer.
  A successful update returns a `200` status code, indicating the successful modification of the layer. A `400` status code is returned for client-side errors like missing required parameters or incorrect data format.

- **DELETE Method:**
  Deletes the specified layer from the Metafuse platform.
  - `id` (required, path): Identifies the layer to delete.
  - `regenerate` (optional, path): Regenerate items that utilized the deleted layer to no longer include it.
  A successful deletion returns a `200` status code, indicating the successful removal of the layer. A `400` status code is returned for client-side errors like missing required parameters.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Metafuse Gateway",
    "description": "This API is a comprehensive service designed to enable smooth interaction with our asset management system. This includes operations at the project, item, and layer levels, catering to a wide array of functionalities ranging from image uploading to specific attribute modifications. It's particularly crafted for handling digital assets, especially images, providing users with the flexibility to manage their resources efficiently.",
    "version": "2023-06-20T18:00:42Z"
  },
  "servers": [
    {
      "url": "https://gateway.metafuse.me"
    }
  ],
  "paths": {
    "/v1/layer/{id}": {
      "summary": "Manage Layer Details",
      "description": "The `/v1/layer/{id}` route is a robust interface for interacting with individual layers within a Metafuse project, offering functionalities to fetch, update, or delete a specific layer. Here’s a detailed breakdown of the available operations on this route:\n\n- **GET Method:**\n  Retrieves the details of a specified layer.\n  - `id` (required, path): Identifies the layer to fetch.\n  - `lastEvaluatedKey` (optional, query): Fetches paginated data if returned from a previous query.\n  A successful query returns a `200` status code along with the layer's details, while a `400` status code denotes client-side errors like missing required parameters or incorrect query format.\n\n- **PUT Method:**\n  Updates the specified layer’s details with the provided JSON payload adhering to the schema (`MetafuApiDepAONIR6hxU6Q`).\n  - `id` (required, path): Identifies the layer to update.\n  - `regenerate` (optional, path): Regenerate items that utilized the updated layer.\n  A successful update returns a `200` status code, indicating the successful modification of the layer. A `400` status code is returned for client-side errors like missing required parameters or incorrect data format.\n\n- **DELETE Method:**\n  Deletes the specified layer from the Metafuse platform.\n  - `id` (required, path): Identifies the layer to delete.\n  - `regenerate` (optional, path): Regenerate items that utilized the deleted layer to no longer include it.\n  A successful deletion returns a `200` status code, indicating the successful removal of the layer. A `400` status code is returned for client-side errors like missing required parameters.\n",
      "put": {
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The ID of the layer to update.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "regenerate",
            "in": "query",
            "description": "If true, all items that utilize the target layer will regenerate to include the changes to the target layer.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MetafuApiDepAONIR6hxU6Q"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "200 response",
            "content": {}
          },
          "400": {
            "description": "400 response",
            "content": {}
          }
        },
        "security": [
          {
            "MetafuseDeveloperApiStackRequestAuthorizer1C886840": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "MetafuApiDepAONIR6hxU6Q": {
        "type": "object",
        "properties": {
          "traitName": {
            "type": "string",
            "description": "The name of the specific trait. This must be unique within a trait category."
          },
          "image": {
            "type": "string",
            "description": "A base64 encoded string representing the image of the layer.",
            "format": "base64"
          },
          "traitRarity": {
            "minimum": 0,
            "type": "number",
            "description": "This is the rarity score for the trait. It represents how rare or common a trait is during the generation process (eg 10 is 10%)."
          },
          "traitCategory": {
            "type": "string",
            "description": "The category this trait belongs to. This must be unique within a collection."
          },
          "generationOrder": {
            "minimum": 0,
            "type": "number",
            "description": "The generation order of the layer. This represents the sequence in which the layer was overlaid on the others."
          }
        },
        "description": "This model represents the schema for updating layer attributes. It includes properties related to traits, associated image, association and generation order."
      }
    },
    "securitySchemes": {
      "MetafuseDeveloperApiStackRequestAuthorizer1C886840": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header",
        "x-amazon-apigateway-authtype": "custom"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 100,
      "1": 144,
      "2": 178,
      "3": 32,
      "4": 71,
      "5": 34,
      "6": 16,
      "7": 7,
      "8": 88,
      "9": 94,
      "10": 157,
      "11": 150
    }
  }
}
```