> For the complete documentation index, see [llms.txt](https://docs.pyck.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pyck.cloud/graphql-api/mutations.md).

# Mutations

GraphQL Mutations

This section documents all available mutations in the pyck GraphQL API. Mutations allow you to create, update, and delete data in the system.

## Available Mutations

### Management Service

#### Device Management

* [**createDevice**](https://github.com/pyck-ai/docs/blob/main/graphql/mutations/createDevice.md): Create a new device (scanner, printer, terminal)
* [**updateDevice**](https://github.com/pyck-ai/docs/blob/main/graphql/mutations/updateDevice.md): Update an existing device
* [**deleteDevice**](https://github.com/pyck-ai/docs/blob/main/graphql/mutations/deleteDevice.md): Delete a device from the system
* [**checkInUserDevice**](https://github.com/pyck-ai/docs/blob/main/graphql/mutations/checkInUserDevice.md): Assign a device to a user
* [**checkOutUserDevice**](https://github.com/pyck-ai/docs/blob/main/graphql/mutations/checkOutUserDevice.md): Return a device from a user

#### Location Management

* [**createLocation**](https://github.com/pyck-ai/docs/blob/main/graphql/mutations/createLocation.md): Create a new warehouse location
* [**updateLocation**](https://github.com/pyck-ai/docs/blob/main/graphql/mutations/updateLocation.md): Update an existing location
* [**deleteLocation**](https://github.com/pyck-ai/docs/blob/main/graphql/mutations/deleteLocation.md): Delete a location from the system
* [**setDeviceLocation**](https://github.com/pyck-ai/docs/blob/main/graphql/mutations/setDeviceLocation.md): Assign a device to a location
* [**unsetDeviceLocation**](https://github.com/pyck-ai/docs/blob/main/graphql/mutations/unsetDeviceLocation.md): Remove a device from a location

#### Customer & Supplier Management

* [**createCustomer**](/graphql-api/mutations/createcustomer.md): Create a new customer entity
* [**updateCustomer**](/graphql-api/mutations/updatecustomer.md): Update an existing customer with new data
* [**deleteCustomer**](/graphql-api/mutations/deletecustomer.md): Delete an existing customer from the system
* [**createSupplier**](/graphql-api/mutations/createsupplier.md): Create a new supplier entity
* [**updateSupplier**](/graphql-api/mutations/updatesupplier.md): Update an existing supplier with new data
* [**deleteSupplier**](/graphql-api/mutations/deletesupplier.md): Delete an existing supplier from the system

#### Data Types & Configuration

* [**createDataType**](/graphql-api/mutations/createdatatype.md): Create a new data type definition
* [**updateDataType**](/graphql-api/mutations/updatedatatype.md): Update an existing data type definition with new data
* [**deleteDataType**](/graphql-api/mutations/deletedatatype.md): Delete an existing data type definition from the system
* [**generateJsonSchema**](/graphql-api/mutations/generatejsonschema.md): Generate a JSON Schema definition from provided JSON data

#### System Management

* [**registerCompany**](/graphql-api/mutations/registercompany.md): Register a new company in the pyck system along with an initial admin user
* [**registerTenant**](/graphql-api/mutations/registertenant.md): Register a new tenant (organization) in the pyck system along with an initial admin user
* [**sendCustomEvent**](/graphql-api/mutations/sendcustomevent.md): Send a custom event to the pyck event system

### Inventory Service

* [**createInventoryItem**](/graphql-api/mutations/createinventoryitem.md): Create a new inventory item
* [**updateInventoryItem**](/graphql-api/mutations/updateinventoryitem.md): Update an existing inventory item with new data
* [**deleteInventoryItem**](/graphql-api/mutations/deleteinventoryitem.md): Delete an existing inventory item from the system
* [**createInventoryItemSet**](/graphql-api/mutations/createinventoryitemset.md): Create a new inventory item set for grouping related items
* [**updateInventoryItemSet**](/graphql-api/mutations/updateinventoryitemset.md): Update an existing inventory item set with new data
* [**deleteInventoryItemSet**](/graphql-api/mutations/deleteinventoryitemset.md): Delete an existing inventory item set from the system
* [**createInventoryCollectionMovement**](/graphql-api/mutations/createinventorycollectionmovement.md): Create a collection of related movements
* [**updateInventoryCollectionMovement**](/graphql-api/mutations/updateinventorycollectionmovement.md): Update an existing inventory collection movement with new data
* [**createInventoryItemMovement**](/graphql-api/mutations/createinventoryitemmovement.md): Create a movement to transfer items between repositories
* [**updateItemMovement**](https://github.com/pyck-ai/docs/blob/main/graphql/mutations/updateItemMovement.md): Update an existing item movement with new data
* [**deleteItemMovement**](https://github.com/pyck-ai/docs/blob/main/graphql/mutations/deleteItemMovement.md): Delete an existing item movement from the system
* [**executeItemMovement**](https://github.com/pyck-ai/docs/blob/main/graphql/mutations/executeItemMovement.md): Execute a pending movement
* [**createRepository**](https://github.com/pyck-ai/docs/blob/main/graphql/mutations/createRepository.md): Create a new storage location
* [**updateRepository**](https://github.com/pyck-ai/docs/blob/main/graphql/mutations/updateRepository.md): Update an existing repository with new data
* [**deleteInventoryRepository**](/graphql-api/mutations/deleteinventoryrepository.md): Delete an existing repository from the system
* [**updateRepositoryMovement**](https://github.com/pyck-ai/docs/blob/main/graphql/mutations/updateRepositoryMovement.md): Update an existing repository movement with new data
* [**deleteRepositoryMovement**](https://github.com/pyck-ai/docs/blob/main/graphql/mutations/deleteRepositoryMovement.md): Delete an existing repository movement from the system
* [**rebuildInventoryStock**](/graphql-api/mutations/rebuildinventorystock.md): Rebuild the inventory stock table to correct stock drift (admin only)

### Picking Service

* [**createPickingOrder**](/graphql-api/mutations/createpickingorder.md): Create a new picking order
* [**updatePickingOrder**](/graphql-api/mutations/updatepickingorder.md): Update an existing picking order with new data
* [**deletePickingOrder**](/graphql-api/mutations/deletepickingorder.md): Delete an existing picking order from the system
* [**createPickingOrderItem**](/graphql-api/mutations/createpickingorderitem.md): Create a new picking order item and associate it with an existing picking order
* [**updatePickingOrderItem**](/graphql-api/mutations/updatepickingorderitem.md): Update an existing picking order item with new data
* [**deletePickingOrderItem**](/graphql-api/mutations/deletepickingorderitem.md): Delete an existing picking order item from the system
* [**createPickingOutboundShipmentNotification**](/graphql-api/mutations/createpickingoutboundshipmentnotification.md): Create a new outbound shipment notification linked to a picking order
* [**updatePickingOutboundShipmentNotification**](/graphql-api/mutations/updatepickingoutboundshipmentnotification.md): Update an existing outbound shipment notification
* [**deletePickingOutboundShipmentNotification**](/graphql-api/mutations/deletepickingoutboundshipmentnotification.md): Delete an existing outbound shipment notification

### Receiving Service

* [**createReceivingInbound**](/graphql-api/mutations/createreceivinginbound.md): Create a new inbound receiving order
* [**updateReceivingInbound**](/graphql-api/mutations/updatereceivinginbound.md): Update an existing receiving inbound with new data
* [**deleteReceivingInbound**](/graphql-api/mutations/deletereceivinginbound.md): Delete an existing receiving inbound from the system
* [**createReceivingInboundItem**](/graphql-api/mutations/createreceivinginbounditem.md): Create a new receiving inbound item and associate it with an existing receiving order
* [**updateReceivingInboundItem**](/graphql-api/mutations/updatereceivinginbounditem.md): Update an existing receiving inbound item with new data
* [**deleteReceivingInboundItem**](/graphql-api/mutations/deletereceivinginbounditem.md): Delete an existing receiving inbound item from the system
* [**createReceivingInboundShipmentNotification**](/graphql-api/mutations/createreceivinginboundshipmentnotification.md): Create a new inbound shipment notification linked to a receiving inbound
* [**updateReceivingInboundShipmentNotification**](/graphql-api/mutations/updatereceivinginboundshipmentnotification.md): Update an existing inbound shipment notification
* [**deleteReceivingInboundShipmentNotification**](/graphql-api/mutations/deletereceivinginboundshipmentnotification.md): Delete an existing inbound shipment notification

### Workflow Service

* [**createWorkflow**](/graphql-api/mutations/createworkflow.md): Create a new workflow definition
* [**updateWorkflow**](/graphql-api/mutations/updateworkflow.md): Update an existing workflow definition with new data
* [**deleteWorkflow**](/graphql-api/mutations/deleteworkflow.md): Delete an existing workflow definition from the system
* [**createWorkflowSignal**](/graphql-api/mutations/createworkflowsignal.md): Create a new workflow signal event handler
* [**updateWorkflowSignal**](/graphql-api/mutations/updateworkflowsignal.md): Update an existing workflow signal with new data
* [**deleteWorkflowSignal**](/graphql-api/mutations/deleteworkflowsignal.md): Delete an existing workflow signal from the system
* [**checkWorkflowStatus**](/graphql-api/mutations/checkworkflowstatus.md): Check the status of a running workflow instance
* [**cancelWorkflow**](/graphql-api/mutations/cancelworkflow.md): Request graceful cancellation of a running workflow execution
* [**setAssignee**](/graphql-api/mutations/setassignee.md): Set or update the assignee for a running workflow instance
* [**setWorkflowTargets**](/graphql-api/mutations/setworkflowtargets.md): Replace the target surfaces of a running workflow execution

### File Service

* [**createFile**](/graphql-api/mutations/createfile.md): Upload and associate files with entities (the `size` input field is now optional)
* [**updateFile**](https://github.com/pyck-ai/docs/blob/main/graphql/mutations/updateFile.md): Update an existing file with new data
* [**deleteFile**](https://github.com/pyck-ai/docs/blob/main/graphql/mutations/deleteFile.md): Delete an existing file from the system
* [**finalizeFileUpload**](/graphql-api/mutations/finalize-file-upload.md): Finalize a file upload by reading the actual size from S3 and persisting it on the File record
* [**analyzeImageFile**](https://github.com/pyck-ai/docs/blob/main/graphql/mutations/analyzeImageFile.md): Analyze an image file using AI/ML services

## Mutation Structure

Mutations in GraphQL follow a standard structure:

```graphql
mutation {
  mutationName(input: {
    # Input fields specific to this mutation
    field1: value1
    field2: value2
  }) {
    # Return fields - what you want back after the mutation
    id
    field1
    field2
    createdAt
  }
}
```

## Working with Mutations

### Input Types

Most mutations use dedicated input types to specify the data for the operation. For example, the `createInventoryItem` mutation uses the `CreateInventoryItemInput` type.

### Return Types

Mutations typically return the affected entity, allowing you to retrieve updated values in the same operation.

### Error Handling

Mutations may return errors for various reasons:

* Invalid input data
* Insufficient permissions
* Conflicts with existing data
* Business rule violations

Refer to the [Error Handling](/graphql-api/error-handling.md) documentation for more information on handling errors.

## Example Mutation

Here's an example of creating a new inventory item:

```graphql
mutation {
  createInventoryItem(input: {
    name: "iPhone 13"
    sku: "IPHONE-13-BLACK"
    data: {
      weight: 173,
      color: "black",
      storage: "128GB"
    }
  }) {
    id
    name
    sku
    createdAt
    updatedAt
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pyck.cloud/graphql-api/mutations.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
