Advanced
This guide covers advanced Directus features in Zapier, including raw request actions and advanced filtering in Find actions.
Raw Request Actions
Raw Request actions provide full HTTP method control for Items, Users, and Files, and let you use Directus's native JSON syntax for the request body.
Available Raw Request Actions
Quick reference of all available raw request actions:
| Resource | Operation | HTTP Methods | Description |
|---|---|---|---|
| Items | Raw Request | POST, PATCH, DELETE | Full HTTP method control for items |
| Users | Raw Request | POST, PATCH, DELETE | Full HTTP method control for users |
| Files | Raw Request | PATCH, DELETE | Full HTTP method control for files |
Using Raw Request Actions
Raw Request actions allow you to make custom Directus API calls with full control over the HTTP method and request body.
Setting Up a Raw Request Action
- Add Directus as an action step
- Select Raw Request operation (Items, Users, or Files)
- Choose the HTTP Method (POST, PATCH, or DELETE)
- For Items, select the Collection
- Configure the request:
- Item/User/File: Select from dropdown (required for PATCH only)
- Request Body (JSON): JSON data for POST/PATCH requests
- Filter (JSON): Filter conditions (required for DELETE operations)
Items - Raw Request
POST - Create items with full JSON control:
{
"title": "My New Post",
"content": "Post content here",
"status": "published",
"author": "author-uuid-here",
"categories": ["category-uuid-1", "category-uuid-2"]
}
PATCH - Update items with complex data structures:
{
"title": "Updated Title",
"status": "archived",
"metadata": {
"tags": ["updated", "archived"],
"notes": "Item has been archived"
}
}
DELETE - Delete items by ID or using Filter (JSON) for bulk deletion
version parameter on this endpoint. Updating a draft in a versioned collection requires the dedicated Versions API (POST /versions/{id}/save), which Item Raw Request can't call since it's scoped to the standard Items endpoint. See Content Versioning for workarounds.Users - Raw Request
POST - Create users with full JSON control:
{
"email": "user@example.com",
"first_name": "John",
"last_name": "Doe",
"role": "role-uuid-here"
}
PATCH - Update users with complex data structures:
{
"status": "suspended",
"metadata": {
"reason": "Account violation"
}
}
DELETE - Delete users by ID or using Filter (JSON) for bulk deletion
Files - Raw Request
PATCH - Update file metadata with complex data structures:
{
"title": "Updated Title",
"description": "New description",
"tags": ["tag1", "tag2"]
}
DELETE - Delete files by ID or using Filter (JSON) for bulk deletion
Working with Relations
When using Raw Request actions or creating items with relations:
Many-to-One:
{
"title": "My Post",
"author": "author-uuid-here"
}
Many-to-Many:
{
"title": "My Post",
"categories": ["category-uuid-1", "category-uuid-2"]
}
One-to-Many:
{
"title": "My Post",
"comments": [{ "text": "Great post!", "user": "user-uuid-here" }]
}
Advanced Tips
Using Dynamic Values in Filters
You can use data from previous steps in your filters by using Zapier's field mapping in the filter fields.
Batch Processing
For bulk operations:
- Use Find to get all items
- Enable "Return all results as line items"
- Add a Filter step if needed
- Add Update Item to process each item
Performance Tips
- Select only needed fields: Use field mapping to reduce data transfer
- Use pagination: Use the Limit field in search actions, process in batches
- Filter in Directus: Always use Directus filters rather than Filter steps when possible
Example:
{
"filter": {
"status": { "_eq": "published" },
"date_created": { "_gte": "$NOW(-30 days)" }
},
"limit": 100
}
Whether to filter on status or archived depends on your collection's schema. Collections created in Directus v12 may use the boolean archived field instead of a string status field.
Next Steps
- ← Back to Integration Return to the integration overview
- Learn about Actions → Basic operations guide
- Learn about Triggers → Automation workflows
Additional Resources
- Directus Filter Rules - Complete filter syntax and operators
- Directus Query Parameters - All available query parameters
Get once-a-month release notes & real‑world code tips...no fluff. 🐰