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

# GraphQL mutations

> Modify Manifest data using GraphQL mutations

Use GraphQL mutations to create, update, and delete data in the Manifest API. All mutations require authentication and appropriate permissions.

## Asset mutations

### Add asset

```graphql theme={null}
mutation {
  addAsset(
    input: {
      name: "Pump A-101"
      tag: "P-101"
      assetClassId: 123
      locationId: 456
      description: "Primary circulation pump"
    }
  ) {
    id
    name
    tag
  }
}
```

### Update asset

```graphql theme={null}
mutation {
  updateAsset(
    id: 123
    input: {
      name: "Pump A-101 Updated"
      description: "Updated description"
    }
  ) {
    id
    name
    description
  }
}
```

### Archive asset

```graphql theme={null}
mutation {
  archiveAsset(id: 123) {
    id
    status
  }
}
```

### Delete asset

```graphql theme={null}
mutation {
  deleteAsset(id: 123)
}
```

## Asset class mutations

### Add asset class

```graphql theme={null}
mutation {
  addAssetClass(
    input: {
      name: "Centrifugal Pump"
      description: "Standard centrifugal pump"
      frontFace: FRONT
    }
  ) {
    id
    name
    description
  }
}
```

### Update asset class

```graphql theme={null}
mutation {
  updateAssetClass(
    id: 123
    input: {
      name: "Updated name"
      description: "Updated description"
    }
  ) {
    id
    name
  }
}
```

### Add model to asset class

```graphql theme={null}
mutation {
  addAssetClassModel(
    assetClassId: 123
    input: {
      fileId: 456
      scale: 1.0
    }
  ) {
    id
    fileId
  }
}
```

### Delete asset class

```graphql theme={null}
mutation {
  deleteAssetClass(id: 123)
}
```

## Job mutations

### Add job

```graphql theme={null}
mutation {
  addJob(
    input: {
      name: "Maintenance inspection"
      templateId: 123
      assetId: 456
      priority: HIGH
      assignedUserIds: [789]
    }
  ) {
    id
    name
    status
    priority
  }
}
```

### Update job

```graphql theme={null}
mutation {
  updateJob(
    id: 123
    input: {
      name: "Updated job name"
      priority: MEDIUM
    }
  ) {
    id
    name
    priority
  }
}
```

### Start job

```graphql theme={null}
mutation {
  startJob(id: 123) {
    id
    status
    startedAt
  }
}
```

### Complete job

```graphql theme={null}
mutation {
  completeJob(id: 123) {
    id
    status
    completedAt
  }
}
```

### Assign user to job

```graphql theme={null}
mutation {
  assignUserToJob(
    jobId: 123
    userId: 456
  ) {
    id
    assignedUsers {
      id
      firstName
      lastName
    }
  }
}
```

### Add note to job

```graphql theme={null}
mutation {
  addJobNote(
    input: {
      jobId: 123
      stepId: 456
      content: "Note content"
      type: TEXT
    }
  ) {
    id
    content
    createdAt
  }
}
```

### Cancel job

```graphql theme={null}
mutation {
  cancelJob(id: 123) {
    id
    status
  }
}
```

## Template mutations

### Add template

```graphql theme={null}
mutation {
  addTemplate(
    input: {
      name: "Inspection procedure"
      description: "Standard inspection"
      type: PROCEDURE
    }
  ) {
    id
    name
    description
  }
}
```

### Update template

```graphql theme={null}
mutation {
  updateTemplate(
    id: 123
    input: {
      name: "Updated template name"
      description: "Updated description"
    }
  ) {
    id
    name
  }
}
```

### Copy template

```graphql theme={null}
mutation {
  copyTemplate(
    id: 123
    name: "Copy of template"
  ) {
    id
    name
  }
}
```

### Delete template

```graphql theme={null}
mutation {
  deleteTemplate(id: 123)
}
```

## Template version mutations

### Create template version

```graphql theme={null}
mutation {
  createTemplateVersion(
    input: {
      templateId: 123
      versionName: "v1.0"
    }
  ) {
    id
    versionName
    state
  }
}
```

### Update template version

```graphql theme={null}
mutation {
  updateTemplateVersion(
    id: 123
    input: {
      versionName: "v1.1"
    }
  ) {
    id
    versionName
  }
}
```

### Edit version state

```graphql theme={null}
mutation {
  editVersionState(
    input: {
      versionId: 123
      state: PUBLISHED
    }
  ) {
    id
    state
  }
}
```

## Location mutations

### Add location

```graphql theme={null}
mutation {
  addLocation(
    input: {
      name: "Building A"
      address: "123 Main St"
      latitude: 40.7128
      longitude: -74.0060
      parentLocationId: 456
    }
  ) {
    id
    name
    address
  }
}
```

### Update location

```graphql theme={null}
mutation {
  updateLocation(
    id: 123
    input: {
      name: "Building A - Updated"
      address: "123 Main St, Floor 2"
    }
  ) {
    id
    name
  }
}
```

### Delete location

```graphql theme={null}
mutation {
  deleteLocation(id: 123)
}
```

## User mutations

### Update user

```graphql theme={null}
mutation {
  updateUser(
    id: 123
    input: {
      firstName: "John"
      lastName: "Doe"
      email: "john.doe@example.com"
    }
  ) {
    id
    firstName
    lastName
    email
  }
}
```

### Add role to user

```graphql theme={null}
mutation {
  addRoleToUser(
    userId: 123
    roleId: 456
  ) {
    id
    roles {
      id
      name
    }
  }
}
```

### Remove role from user

```graphql theme={null}
mutation {
  removeRoleFromUser(
    userId: 123
    roleId: 456
  ) {
    id
    roles {
      id
      name
    }
  }
}
```

### Disable user

```graphql theme={null}
mutation {
  disableOrEnableUser(
    userId: 123
    disable: true
  ) {
    id
    status
  }
}
```

### Delete user

```graphql theme={null}
mutation {
  deleteUser(id: 123)
}
```

### Delete Maker user

Deletes a user that exists only in Manifest Maker.

```graphql theme={null}
mutation {
  deleteMakerUser(id: 123)
}
```

## Meter mutations

### Add meter

```graphql theme={null}
mutation {
  addMeter(
    input: {
      name: "Temperature sensor"
      assetClassId: 123
      unitId: 456
      evaluationType: NUMERIC
      position: { x: 0, y: 0, z: 0 }
    }
  ) {
    id
    name
    evaluationType
  }
}
```

### Update meter

```graphql theme={null}
mutation {
  updateMeter(
    id: 123
    input: {
      name: "Updated meter name"
    }
  ) {
    id
    name
  }
}
```

### Update meter position

```graphql theme={null}
mutation {
  updateMeterPosition(
    id: 123
    position: { x: 1.0, y: 2.0, z: 3.0 }
    rotation: { x: 0, y: 0, z: 0 }
  ) {
    id
    position
    rotation
  }
}
```

### Delete meter

```graphql theme={null}
mutation {
  deleteMeter(id: 123)
}
```

## Measurement mutations

### Add measurement

```graphql theme={null}
mutation {
  addMeasurement(
    input: {
      meterId: 123
      value: "75.5"
      timestamp: "2025-01-15T10:30:00Z"
      deviceId: 456
    }
  ) {
    id
    value
    timestamp
  }
}
```

### Add multiple measurements

```graphql theme={null}
mutation {
  addMultipleCustomMeasurements(
    input: [
      {
        meterId: 123
        value: "75.5"
        timestamp: "2025-01-15T10:30:00Z"
      },
      {
        meterId: 124
        value: "80.2"
        timestamp: "2025-01-15T10:30:00Z"
      }
    ]
  ) {
    id
    value
  }
}
```

### Update measurement

```graphql theme={null}
mutation {
  updateMeasurement(
    id: 123
    input: {
      value: "76.0"
    }
  ) {
    id
    value
  }
}
```

### Delete measurement

```graphql theme={null}
mutation {
  deleteMeasurement(id: 123)
}
```

## Organization mutations

### Add organization

```graphql theme={null}
mutation {
  addOrg(
    input: {
      name: "Engineering Team"
      parentOrgId: 123
    }
  ) {
    id
    name
    level
  }
}
```

### Update organization

```graphql theme={null}
mutation {
  updateOrg(
    id: 123
    input: {
      name: "Updated org name"
    }
  ) {
    id
    name
  }
}
```

### Assign users to organization

```graphql theme={null}
mutation {
  assignUsersToOrg(
    orgId: 123
    userIds: [456, 789]
  ) {
    id
    users {
      id
      firstName
      lastName
    }
  }
}
```

### Allocate licenses to organization

```graphql theme={null}
mutation {
  allocateLicenses(
    input: {
      orgId: 123
      licenses: {
        full: 10
        viewer: 5
      }
    }
  ) {
    id
    allocatedLicenses {
      full
      viewer
    }
  }
}
```

### Invite users to organization

Send invitations to one or more users for a specific org. Each invite must include the target email and the role to assign on acceptance.

```graphql theme={null}
mutation {
  inviteUsersToOrg(
    orgId: 123
    invites: [
      { email: "jane@example.com", role: ADMIN }
      { email: "joe@example.com", role: MEMBER }
    ]
  ) {
    message
  }
}
```

### Accept organization invite

Accept an invite using the token from the invitation email. `userId` is optional and used when accepting on behalf of an existing user.

```graphql theme={null}
mutation {
  acceptOrgInvite(token: "INVITE_TOKEN", userId: 456) {
    message
    org {
      id
      name
    }
  }
}
```

### Cancel organization invite

```graphql theme={null}
mutation {
  cancelOrgInvite(inviteId: 123)
}
```

### Resend organization invite

```graphql theme={null}
mutation {
  resendOrgInvite(inviteId: 123)
}
```

### Update user role in organization

```graphql theme={null}
mutation {
  updateUserRoleInOrg(
    orgId: 123
    userId: 456
    role: ADMIN
  ) {
    id
  }
}
```

### Remove user from team

```graphql theme={null}
mutation {
  removeUserFromTeam(orgId: 123, userId: 456)
}
```

### Leave team

Removes you from the specified org team.

```graphql theme={null}
mutation {
  leaveTeam(orgId: 123)
}
```

### Delete team organization

Permanently delete a team-type org.

```graphql theme={null}
mutation {
  deleteTeamOrg(orgId: 123)
}
```

## Folder mutations

Folders organize templates inside an organization. Every folder mutation requires `orgId` and is scoped to orgs you have access to.

### Create folder

```graphql theme={null}
mutation {
  createFolder(
    data: {
      name: "Inspections"
      parentId: 12
      orgId: 123
    }
  ) {
    id
    name
    parentId
  }
}
```

| Argument        | Type     | Required | Description                                                  |
| --------------- | -------- | -------- | ------------------------------------------------------------ |
| `data.name`     | `String` | Yes      | Folder name.                                                 |
| `data.parentId` | `Int`    | No       | Parent folder ID. Omit or pass `null` to create at the root. |
| `data.orgId`    | `Int`    | Yes      | Organization that owns the folder.                           |

### Update folder

```graphql theme={null}
mutation {
  updateFolder(
    id: 45
    data: {
      name: "Renamed folder"
      parentId: 12
      orgId: 123
    }
  ) {
    id
    name
  }
}
```

### Delete folder

```graphql theme={null}
mutation {
  deleteFolder(id: 45, orgId: 123)
}
```

Returns `true` on success.

### Move folder

```graphql theme={null}
mutation {
  moveFolder(
    folderId: 45
    newParentId: 12
    orgId: 123
  ) {
    id
    parentId
  }
}
```

Pass `newParentId: null` to move the folder to the root.

### Move template into folder

```graphql theme={null}
mutation {
  moveTemplate(
    templateId: 789
    targetFolderId: 45
    orgId: 123
  )
}
```

Pass `targetFolderId: null` to move the template out of any folder.

### Move multiple templates

```graphql theme={null}
mutation {
  moveTemplates(
    templateIds: [789, 790, 791]
    targetFolderId: 45
    orgId: 123
  )
}
```

### Get folders with template counts

Returns paginated folders along with template counts for the parent folder context.

```graphql theme={null}
mutation {
  getFoldersWithInfo(
    parentId: 12
    orgId: 123
    itemsPerPage: 20
    pageNumber: 1
  ) {
    folders {
      id
      name
      templatesCount
    }
    totalCount
  }
}
```

## LiveKit (Manifest Connect) mutations

### Create LiveKit token

Creates or joins a LiveKit room for a chat and returns an access token plus the LiveKit WebSocket URL. You must be a participant of the chat.

```graphql theme={null}
mutation {
  createLiveKitToken(chatId: 123) {
    token
    wsUrl
  }
}
```

### End LiveKit call

Ends the call and deletes the LiveKit room for a chat. You must be a participant.

```graphql theme={null}
mutation {
  endLiveKitCall(chatId: 123)
}
```

Returns `true` on success.

## Fault mutations

### Add fault

```graphql theme={null}
mutation {
  addFault(
    input: {
      description: "Leak detected"
      assetId: 123
      severity: HIGH
    }
  ) {
    id
    description
    status
  }
}
```

### Update fault

```graphql theme={null}
mutation {
  updateFault(
    id: 123
    input: {
      description: "Updated description"
      severity: MEDIUM
    }
  ) {
    id
    description
  }
}
```

### Resolve fault

```graphql theme={null}
mutation {
  resolveFault(
    id: 123
    resolution: "Repaired and tested"
  ) {
    id
    status
    resolvedAt
  }
}
```

### Reopen fault

```graphql theme={null}
mutation {
  reopenFault(id: 123) {
    id
    status
  }
}
```

## Message and chat mutations

### Send message

```graphql theme={null}
mutation {
  sendMessage(
    input: {
      chatId: 123
      content: "Message content"
    }
  ) {
    id
    content
    createdAt
  }
}
```

### Add group chat

```graphql theme={null}
mutation {
  addGroupChat(
    input: {
      name: "Project team"
      userIds: [123, 456, 789]
    }
  ) {
    id
    name
    participants {
      id
      firstName
    }
  }
}
```

### Read messages

```graphql theme={null}
mutation {
  readMessages(
    chatId: 123
    messageIds: [456, 789]
  )
}
```

## File mutations

### Add file

```graphql theme={null}
mutation {
  addFileId(
    input: {
      fileName: "document.pdf"
      contentType: "application/pdf"
      size: 1024000
    }
  ) {
    id
    fileName
    url
  }
}
```

### Delete file

```graphql theme={null}
mutation {
  deleteFileId(id: 123)
}
```

## Personal profile mutations

### Add favorite entity

```graphql theme={null}
mutation {
  addFavoriteEntity(
    entityType: ASSET
    entityId: 123
  )
}
```

### Remove favorite entity

```graphql theme={null}
mutation {
  removeFavoriteEntity(
    entityType: ASSET
    entityId: 123
  )
}
```

## Authentication mutations

### Sign in

```graphql theme={null}
mutation {
  signIn(
    input: {
      email: "user@example.com"
      password: "password"
    }
  ) {
    token
    user {
      id
      email
      firstName
      lastName
    }
  }
}
```

### Sign up

```graphql theme={null}
mutation {
  signUp(
    input: {
      email: "user@example.com"
      password: "password"
      firstName: "John"
      lastName: "Doe"
    }
  ) {
    token
    user {
      id
      email
    }
  }
}
```

## Next steps

* [Queries](/api-reference/graphql/queries) - Retrieve data with queries
* [Overview](/api-reference/graphql/overview) - GraphQL API overview
