VayaFlow
Playbooks

Get a playbook

Returns a single playbook by its playbook ID.

GET
/api/v1/playbooks/{playbookId}

Authorization

ApiKeyAuth
X-API-Key<token>

API key generated from your Vayaflow dashboard Settings page

In: header

Path Parameters

playbookId*string

The playbook ID (e.g., "MTM1")

Response Body

application/json

application/json

application/json

package mainimport (  "fmt"  "net/http"  "io/ioutil")func main() {  url := "https://api.vayaflow.com/api/v1/playbooks/string"  req, _ := http.NewRequest("GET", url, nil)    res, _ := http.DefaultClient.Do(req)  defer res.Body.Close()  body, _ := ioutil.ReadAll(res.Body)  fmt.Println(res)  fmt.Println(string(body))}
{
  "success": true,
  "data": {
    "playbookId": "string",
    "name": "string",
    "active": true,
    "managerId": "string",
    "brief": "string",
    "questionnaireId": "string",
    "documents": [
      {
        "documentId": "string",
        "kind": "esign",
        "documentTemplateId": "string",
        "staticAssetId": "string",
        "type": "string",
        "name": "string",
        "conditions": {
          "logicalOperator": "AND",
          "subRules": [
            {
              "logicalOperator": "AND",
              "conditions": [
                {
                  "field": "string",
                  "operator": "equals",
                  "value": [
                    null
                  ],
                  "lookup": {
                    "dataSourceId": "string",
                    "column": "string"
                  },
                  "prompt": "string",
                  "maxSeverity": "disqualify"
                }
              ]
            }
          ],
          "isActive": true,
          "name": "string"
        },
        "fieldMappingOverrides": [
          {
            "id": "string",
            "providerFieldName": "string",
            "providerFieldId": "string",
            "providerFieldLabel": "string",
            "providerFieldRequired": true,
            "providerFieldType": "string",
            "autoFill": true,
            "fallbackTemplate": "string",
            "sourceType": "field_library",
            "sourceValue": "string",
            "sourceLabel": "string"
          }
        ],
        "description": "string",
        "maxFiles": 1,
        "acceptedTypes": [
          "pdf"
        ],
        "isActive": true,
        "required": true,
        "includeByDefault": true,
        "expiresInDays": 0,
        "order": 0,
        "portal": {
          "after": [
            "string"
          ]
        }
      }
    ],
    "fieldRequirements": [
      {
        "key": "string",
        "requirement": "always",
        "requiredWhen": [
          {
            "logicalOperator": "AND",
            "subRules": [
              {
                "logicalOperator": "AND",
                "conditions": [
                  {
                    "field": "string",
                    "operator": "equals",
                    "value": [
                      null
                    ],
                    "lookup": {
                      "dataSourceId": "string",
                      "column": "string"
                    },
                    "prompt": "string",
                    "maxSeverity": "disqualify"
                  }
                ]
              }
            ],
            "isActive": true,
            "name": "string"
          }
        ]
      }
    ],
    "brandId": "string",
    "knowledgeBaseIds": [
      "string"
    ],
    "agents": {
      "rep": {
        "agentId": "string"
      },
      "repTest": {
        "agentId": "string"
      },
      "overlay": {
        "persona": {
          "mode": "inline",
          "value": "string"
        },
        "mission": {
          "mode": "inline",
          "value": "string"
        },
        "tone": {
          "mode": "inline",
          "value": "string"
        },
        "additionalRules": [
          {
            "id": "string",
            "type": "guardrail",
            "text": "string",
            "blockId": "string",
            "order": 0,
            "enabled": true
          }
        ]
      },
      "historyScope": "contact"
    },
    "goals": [
      {
        "goalId": "string",
        "order": 0,
        "start": {
          "kind": "on_join"
        },
        "deliver": {
          "deliveryEndpointId": "string",
          "workflowId": "string",
          "deliveryLimits": [
            {
              "active": true,
              "cap": 0,
              "type": "daily",
              "startDate": "string",
              "endDate": "string"
            }
          ],
          "whenFull": {
            "action": "queue",
            "routeToPlaybookId": "string"
          },
          "deliverySchedule": {
            "timezone": "string",
            "action": "queue",
            "specificDays": [
              {
                "active": true,
                "day": "Monday",
                "startTime": "string",
                "endTime": "string"
              }
            ],
            "routeToPlaybookId": "string"
          },
          "revenueMilestones": [
            {
              "contactStatus": "delivered",
              "amount": 0,
              "currency": "USD",
              "validFrom": "string",
              "validTo": "string",
              "conditions": {
                "logicalOperator": "AND",
                "subRules": [
                  {
                    "logicalOperator": "AND",
                    "conditions": [
                      {
                        "field": "string",
                        "operator": "equals",
                        "value": [
                          null
                        ],
                        "lookup": {
                          "dataSourceId": "string",
                          "column": "string"
                        },
                        "prompt": "string",
                        "maxSeverity": "disqualify"
                      }
                    ]
                  }
                ],
                "isActive": true,
                "name": "string"
              },
              "notes": "string",
              "active": true
            }
          ],
          "discrepancyHold": "off",
          "requireConsent": true
        }
      }
    ],
    "eligibility": {
      "rules": [
        {
          "logicalOperator": "AND",
          "subRules": [
            {
              "logicalOperator": "AND",
              "conditions": [
                {
                  "field": "string",
                  "operator": "equals",
                  "value": [
                    null
                  ],
                  "lookup": {
                    "dataSourceId": "string",
                    "column": "string"
                  },
                  "prompt": "string",
                  "maxSeverity": "disqualify"
                }
              ]
            }
          ],
          "isActive": true,
          "name": "string"
        }
      ]
    },
    "enrollment": {
      "sources": [
        {
          "sourceId": "string",
          "kind": "partner",
          "name": "string",
          "supplierId": "string",
          "postingSpecId": "string",
          "mode": "direct_post",
          "apiKey": "string",
          "apiKeyEncrypted": {
            "ciphertext": "string",
            "encryptedDataKey": "string",
            "iv": "string",
            "authTag": "string",
            "kmsKeyId": "string"
          },
          "keyPrefix": "string",
          "specShareHash": "string",
          "caps": [
            {
              "active": true,
              "cap": 0,
              "type": "daily",
              "startDate": "string",
              "endDate": "string"
            }
          ],
          "costMilestones": [
            {
              "contactStatus": "contact_ingested",
              "amount": 0,
              "currency": "USD",
              "validFrom": "string",
              "validTo": "string",
              "conditions": {
                "logicalOperator": "AND",
                "subRules": [
                  {
                    "logicalOperator": "AND",
                    "conditions": [
                      {
                        "field": "string",
                        "operator": "equals",
                        "value": [
                          null
                        ],
                        "lookup": {
                          "dataSourceId": "string",
                          "column": "string"
                        },
                        "prompt": "string",
                        "maxSeverity": "disqualify"
                      }
                    ]
                  }
                ],
                "isActive": true,
                "name": "string"
              },
              "notes": "string",
              "active": true
            }
          ],
          "shortCircuitSyncEvaluation": true,
          "placement": {
            "applyRoutingRules": true,
            "applyFallbackPlaybooks": true
          },
          "active": true,
          "createdAt": "string",
          "updatedAt": "string"
        }
      ],
      "routingRules": [
        {
          "routeName": "string",
          "active": true,
          "priority": 0,
          "logicalOperator": "AND",
          "subRules": [
            {
              "logicalOperator": "AND",
              "conditions": [
                {
                  "field": "string",
                  "operator": "equals",
                  "value": [
                    null
                  ],
                  "lookup": {
                    "dataSourceId": "string",
                    "column": "string"
                  },
                  "prompt": "string",
                  "maxSeverity": "disqualify"
                }
              ]
            }
          ],
          "routeTo": {
            "playbookId": "string"
          }
        }
      ],
      "fallbackPlaybookIds": [
        "string"
      ],
      "autoRoutingEnabled": true,
      "dedupeOverride": {
        "enabled": true,
        "window": 3650,
        "matchFields": {
          "email": true,
          "phone": true,
          "matchLogic": "AND"
        }
      }
    },
    "notes": "string",
    "tags": [
      "string"
    ],
    "createdAt": "string",
    "updatedAt": "string",
    "archivedAt": "string"
  }
}
{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Authentication required"
  }
}
{
  "success": false,
  "error": {
    "code": "NOT_FOUND",
    "message": "Resource not found"
  }
}