Patterns
Create, update, delete, import, export, version, and clone patterns through the DRAGOPS API.
Patterns are the core resource in DRAGOPS. Each pattern is a visual automation workflow composed of connected nodes. All pattern endpoints require authentication and enforce ownership validation.
Authentication required for all endpoints.
List patterns
GET /api/patterns
Return a paginated list of patterns owned by the authenticated user.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
search | string | No | Filter by name (partial match) |
isPublic | boolean | No | Filter by visibility (true or false) |
isTemplate | boolean | No | Filter by template status |
tags | string | No | Filter by tag (repeat for multiple) |
limit | integer | No | Items per page (default: 20, max: 100) |
offset | integer | No | Number of items to skip |
sortBy | string | No | Sort field: name, createdAt, or updatedAt |
sortOrder | string | No | Sort direction: asc or desc |
Response
{
"success": true,
"data": [
{
"id": "pat_abc123",
"name": "Webhook Logger",
"description": "Logs incoming webhook payloads",
"isPublic": false,
"isTemplate": false,
"tags": ["webhooks", "logging"],
"createdAt": "2026-02-20T10:00:00.000Z",
"updatedAt": "2026-03-01T14:30:00.000Z"
}
],
"meta": {
"total": 12,
"limit": 20,
"offset": 0
}
}Get pattern
GET /api/patterns/:id
Return a single pattern by ID, including the full graph data.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Pattern ID |
Response
{
"id": "pat_abc123",
"name": "Webhook Logger",
"description": "Logs incoming webhook payloads",
"isPublic": false,
"isTemplate": false,
"tags": ["webhooks", "logging"],
"graphData": {
"nodes": [ ... ],
"edges": [ ... ]
},
"versionNumber": 3,
"createdAt": "2026-02-20T10:00:00.000Z",
"updatedAt": "2026-03-01T14:30:00.000Z"
}Create pattern
POST /api/patterns
Create a new pattern. The pattern starts as an empty graph that you can edit in the visual editor or update through the API.
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Pattern name |
description | string | No | Pattern description |
isPublic | boolean | No | Whether the pattern is publicly visible (default: false) |
tags | string[] | No | Tags for organization |
{
"name": "Webhook Logger",
"description": "Logs incoming webhook payloads",
"tags": ["webhooks", "logging"]
}Response
201 Created
{
"id": "pat_abc123",
"name": "Webhook Logger",
"description": "Logs incoming webhook payloads",
"isPublic": false,
"isTemplate": false,
"tags": ["webhooks", "logging"],
"versionNumber": 1,
"createdAt": "2026-03-05T12:00:00.000Z",
"updatedAt": "2026-03-05T12:00:00.000Z"
}Update pattern
PUT /api/patterns/:id
Update an existing pattern. Each update creates a new version in the version history.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Pattern ID |
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No | Updated name |
description | string | No | Updated description |
graphData | object | No | Updated graph (nodes and edges) |
isPublic | boolean | No | Updated visibility |
tags | string[] | No | Updated tags |
{
"name": "Webhook Logger v2",
"graphData": {
"nodes": [ ... ],
"edges": [ ... ]
}
}Response
{
"id": "pat_abc123",
"name": "Webhook Logger v2",
"versionNumber": 4,
"updatedAt": "2026-03-05T12:00:00.000Z"
}Delete pattern
DELETE /api/patterns/:id
Permanently delete a pattern and all of its version history.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Pattern ID |
Response
204 No Content
Clone pattern
POST /api/patterns/:id/clone
Create a copy of an existing pattern. The clone belongs to the authenticated user and is independent of the original.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Pattern ID to clone |
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No | Name for the cloned pattern (defaults to "Copy of" followed by the original name) |
{
"name": "Webhook Logger (copy)"
}Response
201 Created
{
"id": "pat_def456",
"name": "Webhook Logger (copy)",
"versionNumber": 1,
"createdAt": "2026-03-05T12:00:00.000Z"
}Import pattern
POST /api/patterns/import
Import a pattern from a JSON export. This creates a new pattern from the exported data.
Request body
Send the full JSON object from a previous export. The import process assigns a new ID and resets the version history.
{
"name": "Imported Pattern",
"description": "A pattern imported from JSON",
"graphData": {
"nodes": [ ... ],
"edges": [ ... ]
}
}Response
201 Created
{
"id": "pat_ghi789",
"name": "Imported Pattern",
"versionNumber": 1,
"createdAt": "2026-03-05T12:00:00.000Z"
}Export pattern
GET /api/patterns/:id/export
Export a pattern as a JSON file. The response includes a Content-Disposition header for file download.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Pattern ID |
Response
Returns the pattern as a JSON file download with Content-Type: application/json.
{
"name": "Webhook Logger",
"description": "Logs incoming webhook payloads",
"graphData": {
"nodes": [ ... ],
"edges": [ ... ]
},
"exportedAt": "2026-03-05T12:00:00.000Z"
}Get statistics
GET /api/patterns/stats
Return aggregate statistics about all patterns in the system.
Admin role required.
Response
{
"totalPatterns": 156,
"publicPatterns": 23,
"templatePatterns": 8,
"totalVersions": 1204
}Get version history
GET /api/patterns/:id/versions
Return the version history for a pattern. Each save creates a new version.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Pattern ID |
Response
[
{
"versionNumber": 3,
"createdAt": "2026-03-01T14:30:00.000Z",
"summary": "Updated graph with new Log node"
},
{
"versionNumber": 2,
"createdAt": "2026-02-25T09:15:00.000Z",
"summary": "Added webhook trigger"
},
{
"versionNumber": 1,
"createdAt": "2026-02-20T10:00:00.000Z",
"summary": "Initial version"
}
]Compare versions
GET /api/patterns/:id/versions/compare
Compare two versions of a pattern and return the differences.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Pattern ID |
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
v1 | integer | Yes | First version number |
v2 | integer | Yes | Second version number |
Response
{
"v1": 2,
"v2": 3,
"changes": {
"nodesAdded": 1,
"nodesRemoved": 0,
"edgesAdded": 2,
"edgesRemoved": 0
}
}Rollback to version
POST /api/patterns/:id/rollback
Restore a pattern to a previous version. This creates a new version with the content of the specified version.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Pattern ID |
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
versionNumber | integer | Yes | The version to restore |
{
"versionNumber": 2
}Response
{
"id": "pat_abc123",
"versionNumber": 4,
"restoredFrom": 2,
"updatedAt": "2026-03-05T12:00:00.000Z"
}Star / unstar pattern
POST /api/patterns/:id/star
Toggle the star (favorite) status on a pattern for the authenticated user.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Pattern ID |
Response
{
"starred": true
}Get call interface
GET /api/patterns/:id/call-interface
Return the typed call interface for a pattern that supports the Call Pattern node.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Pattern ID |
Response
{
"callInterface": {
"inputs": [
{ "name": "url", "type": "string" },
{ "name": "retries", "type": "integer" }
],
"outputs": [
{ "name": "status", "type": "integer" },
{ "name": "body", "type": "object" }
]
}
}Set call interface
PUT /api/patterns/:id/call-interface
Define or update the typed call interface for a pattern.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Pattern ID |
Request body
{
"inputs": [
{ "name": "url", "type": "string" },
{ "name": "retries", "type": "integer" }
],
"outputs": [
{ "name": "status", "type": "integer" },
{ "name": "body", "type": "object" }
]
}Response
{
"callInterface": {
"inputs": [
{ "name": "url", "type": "string" },
{ "name": "retries", "type": "integer" }
],
"outputs": [
{ "name": "status", "type": "integer" },
{ "name": "body", "type": "object" }
]
}
}Remove call interface
DELETE /api/patterns/:id/call-interface
Remove the call interface from a pattern.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Pattern ID |
Response
204 No Content