> ## Documentation Index
> Fetch the complete documentation index at: https://support.tulip.co/llms.txt
> Use this file to discover all available pages before exploring further.

# /api/machines/v1/machines/{machineId}/attributes/{attributeId}/write

> Write to a machine attribute.

Requires the `attributes:write-value` API key scope.


## OpenAPI

````json POST /api/machines/v1/machines/{machineId}/attributes/{attributeId}/write
{
  "openapi": "3.0.3",
  "info": {
    "title": "Tulip API",
    "version": "v1"
  },
  "tags": [
    {
      "name": "machines",
      "description": "An API for managing machines and their types"
    },
    {
      "name": "stations",
      "description": "An API for managing and updating stations."
    },
    {
      "name": "users",
      "description": "An API for managing users and their roles/permissions."
    }
  ],
  "paths": {
    "/api/machines/v1/machines/{machineId}/attributes/{attributeId}/write": {
      "post": {
        "operationId": "writeMachineAttribute",
        "description": "Write to a machine attribute.\n\nRequires the `attributes:write-value` API key scope.\n",
        "tags": [
          "machines"
        ],
        "x-tulip-visibility": "public",
        "requestBody": {
          "description": "The value to write to the machine attribute.",
          "required": "true",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "value"
                ],
                "properties": {
                  "value": {
                    "description": "The value to write. Must be congruent with the attribute's type.",
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "machineId",
            "description": "The ID of the machine.",
            "in": "path",
            "required": "true",
            "schema": {
              "$ref": "#/components/schemas/MachineId"
            }
          },
          {
            "name": "attributeId",
            "description": "The ID of the machine attribute to write to.",
            "in": "path",
            "required": "true",
            "schema": {
              "$ref": "#/components/schemas/MachineAttributeId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The machine attribute value was written successfully.\n",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "An error occurred. The Tulip error codes `generic.customerIdRequired`, `generic.workspaceIdRequired`, `generic.invalidParams`, `http.invalidBodyJson`, `http.invalidHeaders`, `http.multiValueHeader`, `machines.attributeIsNotWritableError`, `machines.missingDataSourceIdOnSubscriptionError`, and `machines.unsupportedMachineSubscriptionTypeError` all use the 400 HTTP status code. See the documentation of the response content schema for details on these specific Tulip errors that could result in this status code.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/ApiError"
                        },
                        {
                          "type": "object",
                          "description": "The request was missing information about the Tulip customer context.\n\nThis error is not automatically retryable.",
                          "properties": {
                            "errorCode": {
                              "enum": [
                                "generic.customerIdRequired"
                              ]
                            },
                            "retryable": {
                              "enum": [
                                "false"
                              ]
                            }
                          },
                          "required": [
                            "errorCode",
                            "retryable"
                          ]
                        }
                      ]
                    },
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/ApiError"
                        },
                        {
                          "type": "object",
                          "description": "The request was missing information about the Tulip workspace context.\n\nThis error is not automatically retryable.",
                          "properties": {
                            "errorCode": {
                              "enum": [
                                "generic.workspaceIdRequired"
                              ]
                            },
                            "retryable": {
                              "enum": [
                                "false"
                              ]
                            }
                          },
                          "required": [
                            "errorCode",
                            "retryable"
                          ]
                        }
                      ]
                    },
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/ApiError"
                        },
                        {
                          "type": "object",
                          "description": "The request parameters were invalid.\n\nThis error is not automatically retryable.",
                          "properties": {
                            "errorCode": {
                              "enum": [
                                "generic.invalidParams"
                              ]
                            },
                            "retryable": {
                              "enum": [
                                "false"
                              ]
                            }
                          },
                          "required": [
                            "errorCode",
                            "retryable"
                          ]
                        }
                      ]
                    },
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/ApiError"
                        },
                        {
                          "type": "object",
                          "description": "The HTTP request body could not be decoded as JSON.\n\nThis error is not automatically retryable.",
                          "properties": {
                            "errorCode": {
                              "enum": [
                                "http.invalidBodyJson"
                              ]
                            },
                            "retryable": {
                              "enum": [
                                "false"
                              ]
                            }
                          },
                          "required": [
                            "errorCode",
                            "retryable"
                          ]
                        }
                      ]
                    },
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/ApiError"
                        },
                        {
                          "type": "object",
                          "description": "The HTTP request headers were invalid.\n\nThis error is not automatically retryable.",
                          "properties": {
                            "errorCode": {
                              "enum": [
                                "http.invalidHeaders"
                              ]
                            },
                            "retryable": {
                              "enum": [
                                "false"
                              ]
                            }
                          },
                          "required": [
                            "errorCode",
                            "retryable"
                          ]
                        }
                      ]
                    },
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/ApiError"
                        },
                        {
                          "type": "object",
                          "description": "An HTTP request header contained multiple values.\n\nThis error is not automatically retryable.",
                          "properties": {
                            "errorCode": {
                              "enum": [
                                "http.multiValueHeader"
                              ]
                            },
                            "details": {
                              "type": "object",
                              "properties": {
                                "headerName": {
                                  "description": "The name of the given HTTP header which had multiple values.\n",
                                  "type": "string"
                                }
                              },
                              "required": [
                                "headerName"
                              ]
                            },
                            "retryable": {
                              "enum": [
                                "false"
                              ]
                            }
                          },
                          "required": [
                            "errorCode",
                            "retryable",
                            "details"
                          ]
                        }
                      ]
                    },
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/ApiError"
                        },
                        {
                          "type": "object",
                          "description": "Machine attribute is not writable.\n\nThis error is not automatically retryable.",
                          "properties": {
                            "errorCode": {
                              "enum": [
                                "machines.attributeIsNotWritableError"
                              ]
                            },
                            "retryable": {
                              "enum": [
                                "false"
                              ]
                            }
                          },
                          "required": [
                            "errorCode",
                            "retryable"
                          ]
                        }
                      ]
                    },
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/ApiError"
                        },
                        {
                          "type": "object",
                          "description": "Machine subscription does not have a data source ID\n\nThis error is not automatically retryable.",
                          "properties": {
                            "errorCode": {
                              "enum": [
                                "machines.missingDataSourceIdOnSubscriptionError"
                              ]
                            },
                            "retryable": {
                              "enum": [
                                "false"
                              ]
                            }
                          },
                          "required": [
                            "errorCode",
                            "retryable"
                          ]
                        }
                      ]
                    },
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/ApiError"
                        },
                        {
                          "type": "object",
                          "description": "Unsupported subscription type for machine attribute write\n\nThis error is not automatically retryable.",
                          "properties": {
                            "errorCode": {
                              "enum": [
                                "machines.unsupportedMachineSubscriptionTypeError"
                              ]
                            },
                            "retryable": {
                              "enum": [
                                "false"
                              ]
                            }
                          },
                          "required": [
                            "errorCode",
                            "retryable"
                          ]
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "The request was missing required authentication information.\n\nThis error is not automatically retryable.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "type": "object",
                      "description": "The request was missing required authentication information.\n\nThis error is not automatically retryable.",
                      "properties": {
                        "errorCode": {
                          "enum": [
                            "generic.authRequired"
                          ]
                        },
                        "retryable": {
                          "enum": [
                            "false"
                          ]
                        }
                      },
                      "required": [
                        "errorCode",
                        "retryable"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "An error occurred. The Tulip error codes `machines.machineNotFoundError`, `machines.machineSubscriptionNotFoundError`, and `machines.machineAttributeNotFoundError` all use the 404 HTTP status code. See the documentation of the response content schema for details on these specific Tulip errors that could result in this status code.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/ApiError"
                        },
                        {
                          "type": "object",
                          "description": "Machine not found.\n\nThis error is not automatically retryable.",
                          "properties": {
                            "errorCode": {
                              "enum": [
                                "machines.machineNotFoundError"
                              ]
                            },
                            "retryable": {
                              "enum": [
                                "false"
                              ]
                            }
                          },
                          "required": [
                            "errorCode",
                            "retryable"
                          ]
                        }
                      ]
                    },
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/ApiError"
                        },
                        {
                          "type": "object",
                          "description": "Machine not found.\n\nThis error is not automatically retryable.",
                          "properties": {
                            "errorCode": {
                              "enum": [
                                "machines.machineSubscriptionNotFoundError"
                              ]
                            },
                            "retryable": {
                              "enum": [
                                "false"
                              ]
                            }
                          },
                          "required": [
                            "errorCode",
                            "retryable"
                          ]
                        }
                      ]
                    },
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/ApiError"
                        },
                        {
                          "type": "object",
                          "description": "Machine attribute not found.\n\nThis error is not automatically retryable.",
                          "properties": {
                            "errorCode": {
                              "enum": [
                                "machines.machineAttributeNotFoundError"
                              ]
                            },
                            "retryable": {
                              "enum": [
                                "false"
                              ]
                            }
                          },
                          "required": [
                            "errorCode",
                            "retryable"
                          ]
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests have been made to this endpoint in a short time period.\n\nThis error is not automatically retryable.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "type": "object",
                      "description": "Too many requests have been made to this endpoint in a short time period.\n\nThis error is not automatically retryable.",
                      "properties": {
                        "errorCode": {
                          "enum": [
                            "http.endpointRateLimitExceeded"
                          ]
                        },
                        "details": {
                          "type": "object",
                          "properties": {
                            "details": {
                              "description": "Additional details about this endpoint's rate limits.\n",
                              "type": "string"
                            }
                          }
                        },
                        "retryable": {
                          "enum": [
                            "false"
                          ]
                        }
                      },
                      "required": [
                        "errorCode",
                        "retryable",
                        "details"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred. Please contact [support@tulip.co](mailto:support@tulip.co)\nif the error persists.\n\nThis error is not automatically retryable.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "type": "object",
                      "description": "An internal server error occurred. Please contact [support@tulip.co](mailto:support@tulip.co)\nif the error persists.\n\nThis error is not automatically retryable.",
                      "properties": {
                        "errorCode": {
                          "enum": [
                            "generic.internal"
                          ]
                        },
                        "retryable": {
                          "enum": [
                            "false"
                          ]
                        }
                      },
                      "required": [
                        "errorCode",
                        "retryable"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "MachineId": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RandomId"
          },
          {
            "description": "A random string which uniquely identifies a machine.\n"
          }
        ]
      },
      "MachineAttributeId": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RandomId"
          },
          {
            "description": "A random string which uniquely identifies a machine attribute.\n"
          }
        ]
      },
      "ApiError": {
        "description": "An error response returned by a Tulip API.\n",
        "type": "object",
        "properties": {
          "errorCode": {
            "description": "A machine-readable code identifying the type of error.\n",
            "type": "string",
            "pattern": "^[a-zA-Z0-9.]$"
          },
          "message": {
            "description": "A human-readable description of the error intended for debugging purposes only.\n\nThe exact content of this message is not stable.\n",
            "type": "string"
          },
          "retryable": {
            "description": "Whether the request can be automatically retried by the client.\n",
            "type": "boolean"
          }
        },
        "required": [
          "errorCode",
          "retryable"
        ]
      },
      "RandomId": {
        "description": "A randomly generated unique identifier.\n\nTypically has ~98 bits of entropy.\n",
        "example": "g56RCoZCtzv7borvp",
        "type": "string",
        "pattern": "^[a-zA-Z0-9_]+$"
      }
    }
  }
}
````

