How to archive a field using GraphQL mutation
Overview
This guide explains how to archive a field using Pipefy's GraphQL API. The archiveField mutation allows you to archive a field by setting its archivedAt timestamp, which marks the field as archived without deleting it.
Prerequisites
- Authentication: Use a Service Account token (Personal Access Tokens are deprecated).
- Permissions: Ensure you have permission to manage the pipe (Pipe admin).
- Field UUID: Required. You must provide the UUID of the field you want to archive.
Step 1: Find Your Field UUID
To execute this mutation, you'll need the UUID of the field you want to archive.
- Refer to our Get resource IDs page for guidance on retrieving UUIDs using GraphQL queries.
- You can also use the
pipequery to list fields in a pipe:
{
pipe(id: 1234) {
phases {
name
fields {
uuid
label
}
}
}
}
Step 2: Archive Field
Use the archiveField mutation to archive a field. You must provide the uuid of the field.
mutation ArchiveField(
$uuid: String!
) {
archiveField(input: {
uuid: $uuid
}) {
success
}
}
Variables example:
{
"uuid": "1ea56732-9009-4b8f-a112-cafe4ec057fe"
}
Arguments Explained
Required Arguments
uuid: The UUID of the field to archive
Key Fields Returned
success: Boolean indicating whether the mutation was successfultrue: The field was archived successfullyfalse: The field archiving failed
Error Handling
If the mutation fails, you'll receive an error response:
{
"data": {
"archiveField": null
},
"errors": [
{
"message": "Permission denied",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"archiveField"
]
}
]
}
Common Error Scenarios
- Permission Denied: User doesn't have the required permissions to manage the pipe
- Field Not Found: Field UUID doesn't exist or user doesn't have access
- Authentication Issues: Missing or invalid authentication token
Notes
- Archiving a field sets the
archivedAttimestamp but does not delete the field - If a field is already archived, calling this mutation will have no impact in the field
