### Successful API Response Example Source: https://context7.com/qwilr/openapi/llms.txt A successful GET request to retrieve a page returns a 200 OK status with page details. ```json { "id": "6ee0f841f3cc8900090d82dc", "name": "Sales Proposal", "status": "live", "tags": ["sales", "q4"], "ownerId": "6ee0f841f3cc8900090d82dc", "links": { "collaboratorUrl": "https://app.qwilr.com/", "editorUrl": "https://app.qwilr.com/", "publicUrl": "https://pages.qwilr.com/", "pdfUrl": "https://api.qwilr.com/" } } ``` -------------------------------- ### Retrieve Page Details Source: https://context7.com/qwilr/openapi/llms.txt Example of a successful 200 OK response when fetching details for an accepted page. ```json { "id": "6ee0f841f3cc8900090d82dc", "name": "Q4 Sales Proposal - Acme Corp", "status": "accepted", "tags": ["sales", "enterprise", "q4-2024"], "ownerId": "5dd0e730e2bb7800080a71cb", "metadata": { "crmId": "SF-12345", "dealSize": "enterprise", "salesRep": "john.doe@company.com" }, "links": { "collaboratorUrl": "https://app.qwilr.com/collaborate/6ee0f841f3cc8900090d82dc", "editorUrl": "https://app.qwilr.com/edit/6ee0f841f3cc8900090d82dc", "publicUrl": "https://pages.qwilr.com/Q4-Sales-Proposal-Acme-Corp-6ee0f841f3cc", "pdfUrl": "https://api.qwilr.com/v1/pages/6ee0f841f3cc8900090d82dc/pdf", "agreementPdfUrl": "https://api.qwilr.com/v1/pages/6ee0f841f3cc8900090d82dc/agreement-pdf" }, "acceptance": { "acceptersTotal": 2, "acceptersCount": 2, "accepters": [ { "name": "Jane Smith", "email": "jane.smith@acme.com", "legalEntity": "Acme Corporation", "esigned": true, "acceptedAt": "2024-01-20T14:30:00.000Z", "customForm": [ {"field": "Title", "value": "VP of Operations"}, {"field": "Purchase Order", "value": "PO-2024-001"} ], "postAcceptance": { "url": "https://yourapp.com/thank-you?deal=SF-12345" } }, { "name": "Bob Wilson", "email": "bob.wilson@acme.com", "legalEntity": "Acme Corporation", "esigned": true, "acceptedAt": "2024-01-21T09:15:00.000Z", "customForm": null, "postAcceptance": null } ], "auditTrailPdf": "https://api.qwilr.com/v1/pages/6ee0f841f3cc8900090d82dc/audit-trail.pdf", "agreementAuditTrailPdf": "https://api.qwilr.com/v1/pages/6ee0f841f3cc8900090d82dc/agreement-audit-trail.pdf", "quote": { "amount": 78000, "amountExcludingTax": 70909.09, "quoteSections": [ { "selected": true, "metadata": null, "lineItems": [ { "type": "fixedCost", "unitPrice": 5000, "quantity": 12, "billingSchedule": "monthly", "selected": true, "metadata": {"sku": "PLT-001"} }, { "type": "fixedCost", "unitPrice": 15000, "quantity": 1, "billingSchedule": "one-off", "selected": true, "metadata": null } ] }, { "selected": true, "metadata": null, "lineItems": [ { "type": "fixedCost", "unitPrice": 1500, "quantity": 1, "billingSchedule": "monthly", "selected": true, "metadata": null } ] } ] } } } ``` -------------------------------- ### Authenticate API Requests with Bearer Token Source: https://context7.com/qwilr/openapi/llms.txt All API requests must include the 'Authorization' header with your bearer token. This example shows how to make a GET request to retrieve a page. ```bash # All requests must include the Authorization header curl -X GET "https://api.qwilr.com/v1/pages/6ee0f841f3cc8900090d82dc" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" ``` -------------------------------- ### API Error Handling Examples Source: https://context7.com/qwilr/openapi/llms.txt Illustrates common API error responses, including Not Found (404) for missing resources and Bad Request (400) for malformed requests. Pay attention to the 'type' and 'message' fields for debugging. ```bash # Example: Creating a page with invalid block ID curl -X POST "https://api.qwilr.com/v1/pages" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Test Page", "blocks": [ {"id": "invalid-block-id"} ] }' ``` ```json # Response (404 Not Found): { "statusCode": 404, "timestamp": "2024-01-15T10:30:00.000Z", "type": "NotFoundError", "message": "Saved block with id 'invalid-block-id' not found" } ``` ```json # Response (400 Bad Request) - malformed request: { "statusCode": 400, "timestamp": "2024-01-15T10:30:00.000Z", "type": "ValidationError", "message": "Request body must contain either 'blocks' or 'templateId'" } ``` -------------------------------- ### GET /v1/webhooks Source: https://context7.com/qwilr/openapi/llms.txt Retrieves all active webhook subscriptions for your account. ```APIDOC ## Get Webhook Subscriptions ### Description Retrieves all active webhook subscriptions for your account. ### Method GET ### Endpoint /v1/webhooks ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```bash curl -X GET "https://api.qwilr.com/v1/webhooks" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" ``` ### Response #### Success Response (200 OK) - **id** (string) - The unique identifier for the webhook subscription. - **event** (string) - The type of event subscribed to. - **url** (string) - The target URL for webhook notifications. #### Response Example ```json [ { "id": "wh_abc123def456", "event": "pageAccepted", "url": "https://yourapp.com/webhooks/qwilr/accepted" } ] ``` ``` -------------------------------- ### Get All Users Source: https://context7.com/qwilr/openapi/llms.txt Retrieves all users in your account, including their roles and team assignments. Useful for specifying the ownerId when creating pages. ```bash # Get all users in the account curl -X GET "https://api.qwilr.com/v1/users" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" ``` ```json [ { "id": "5dd0e730e2bb7800080a71cb", "email": "john.doe@company.com", "firstName": "John", "lastName": "Doe", "createdAt": "2021-07-22T06:09:09.816Z", "roles": [ {"name": "admin"} ], "teams": [ {"name": "Sales"}, {"name": "Enterprise"} ] }, { "id": "6ee0f841f3cc8900090d82dc", "email": "jane.smith@company.com", "firstName": "Jane", "lastName": "Smith", "createdAt": "2022-03-15T10:20:30.000Z", "roles": [ {"name": "member"} ], "teams": [ {"name": "Sales"} ] }, { "id": "7ff1g952h4dd9a00091e93ed", "email": "bob.wilson@company.com", "firstName": "Bob", "lastName": "Wilson", "createdAt": "2023-01-10T08:45:00.000Z", "roles": [ {"name": "member"} ], "teams": [ {"name": "Marketing"} ] } ] ``` -------------------------------- ### GET /pages/{pageId} Source: https://context7.com/qwilr/openapi/llms.txt Retrieves the details of a specific Qwilr Page by its unique identifier. ```APIDOC ## GET /pages/{pageId} ### Description Retrieves the details of a specific Qwilr Page, including its status, owner, and various access URLs. ### Method GET ### Endpoint https://api.qwilr.com/v1/pages/{pageId} ### Parameters #### Path Parameters - **pageId** (string) - Required - The unique identifier of the Qwilr Page. ### Response #### Success Response (200) - **id** (string) - The page ID - **name** (string) - The name of the page - **status** (string) - The current status of the page - **tags** (array) - List of tags associated with the page - **ownerId** (string) - The ID of the page owner - **links** (object) - Object containing collaboratorUrl, editorUrl, publicUrl, and pdfUrl #### Response Example { "id": "6ee0f841f3cc8900090d82dc", "name": "Sales Proposal", "status": "live", "tags": ["sales", "q4"], "ownerId": "6ee0f841f3cc8900090d82dc", "links": { "collaboratorUrl": "https://app.qwilr.com/...", "editorUrl": "https://app.qwilr.com/...", "publicUrl": "https://pages.qwilr.com/...", "pdfUrl": "https://api.qwilr.com/..." } } ``` -------------------------------- ### Get All Webhook Subscriptions Source: https://context7.com/qwilr/openapi/llms.txt Retrieves a list of all active webhook subscriptions configured for your account. This helps in managing or verifying existing subscriptions. ```bash # Get all webhook subscriptions curl -X GET "https://api.qwilr.com/v1/webhooks" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" ``` ```json [ { "id": "wh_abc123def456", "event": "pageAccepted", "url": "https://yourapp.com/webhooks/qwilr/accepted" }, { "id": "wh_ghi789jkl012", "event": "pageFirstViewed", "url": "https://yourapp.com/webhooks/qwilr/first-view" }, { "id": "wh_mno345pqr678", "event": "pageSetLive", "url": "https://yourapp.com/webhooks/qwilr/published" } ] ``` -------------------------------- ### Get Saved Blocks Source: https://context7.com/qwilr/openapi/llms.txt Retrieves all saved blocks from your account with their IDs and types. ```APIDOC ## GET /v1/blocks/saved ### Description Retrieves all saved blocks from your account with their IDs and types. Essential for mapping block names to IDs when creating pages programmatically. ### Method GET ### Endpoint `/v1/blocks/saved` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the saved block. - **name** (string) - The name of the saved block. - **type** (string) - The type of the saved block (e.g., "splash", "text", "quote", "accept"). #### Response Example ```json [ { "id": "uCHq6B6_S1EqZ2pyam8YVfUldvoF-Q", "name": "Hero Splash Block", "type": "splash" }, { "id": "xYz9A8b_T2FrW3qzbn9ZWgVmewpG-R", "name": "Company Overview", "type": "text" }, { "id": "pQr5C4d_U3GsX4ryco0AWtYnfxqH-S", "name": "Standard Quote Block", "type": "quote" }, { "id": "mNo7E6f_V4HtY5szdo1BXuZogyrI-T", "name": "Accept & Sign Block", "type": "accept" }, { "id": "jKl3G2h_W5ItZ6tyep2CYvAphzsJ-U", "name": "Case Study Section", "type": "text" } ] ``` ``` -------------------------------- ### Error Responses Source: https://context7.com/qwilr/openapi/llms.txt Examples of common error responses from the Qwilr API, including validation failures and rate limiting. ```APIDOC ## Error Responses ### Response (422 Unprocessable Entity) This response indicates that the request could not be processed due to validation errors. #### Response Example ```json { "statusCode": 422, "timestamp": "2024-01-15T10:30:00.000Z", "type": "UnprocessableEntityError", "message": "Quote section line item discount amount must be greater than 0" } ``` ### Response (429 Too Many Requests) This response indicates that the API rate limits have been exceeded. #### Response Example ```json { "statusCode": 429, "timestamp": "2024-01-15T10:30:00.000Z", "type": "RateLimitError", "message": "Too many requests. Please retry after 60 seconds" } ``` ``` -------------------------------- ### GET /v1/users Source: https://context7.com/qwilr/openapi/llms.txt Retrieves all users in your account with their roles and team assignments. Useful for specifying the `ownerId` when creating pages. ```APIDOC ## Get Users ### Description Retrieves all users in your account with their roles and team assignments. Useful for specifying the `ownerId` when creating pages. ### Method GET ### Endpoint /v1/users ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash curl -X GET "https://api.qwilr.com/v1/users" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" ``` ### Response #### Success Response (200) - **id** (string) - Unique identifier for the user. - **email** (string) - The email address of the user. - **firstName** (string) - The first name of the user. - **lastName** (string) - The last name of the user. - **createdAt** (string) - The date and time the user was created (ISO 8601 format). - **roles** (array) - A list of roles assigned to the user. - **name** (string) - The name of the role. - **teams** (array) - A list of teams the user belongs to. - **name** (string) - The name of the team. #### Response Example ```json [ { "id": "5dd0e730e2bb7800080a71cb", "email": "john.doe@company.com", "firstName": "John", "lastName": "Doe", "createdAt": "2021-07-22T06:09:09.816Z", "roles": [ {"name": "admin"} ], "teams": [ {"name": "Sales"}, {"name": "Enterprise"} ] } ] ``` ``` -------------------------------- ### GET /v1/pages/{pageId} Source: https://context7.com/qwilr/openapi/llms.txt Retrieves a specific page by its ID. Supports expanding related data like metadata and acceptance details. ```APIDOC ## Get a Page Retrieves a page by ID with optional expanded data including metadata, acceptance details, and preview acceptance information. ### Method GET ### Endpoint /v1/pages/{pageId} ### Query Parameters - **expand** (string) - Optional - Comma-separated list of data to expand (e.g., 'metadata', 'acceptance'). ### Request Example ```bash curl -X GET "https://api.qwilr.com/v1/pages/6ee0f841f3cc8900090d82dc?expand=metadata,acceptance" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the page. - **name** (string) - The name of the page. - **status** (string) - The current status of the page. - **tags** (array of strings) - Tags associated with the page. - **ownerId** (string) - The ID of the page owner. - **links** (object) - Links related to the page. - **collaboratorUrl** (string) - URL for collaborators. - **editorUrl** (string) - URL for the page editor. - **publicUrl** (string) - The public URL of the page. - **pdfUrl** (string) - URL to download the page as a PDF. - **metadata** (object) - Metadata associated with the page (if expanded). - **acceptance** (object) - Acceptance details for the page (if expanded). ``` -------------------------------- ### Create Page from Template Source: https://context7.com/qwilr/openapi/llms.txt Use this endpoint to create a new Qwilr page using a pre-defined template. Include substitution values to customize the content. Requires an access token for authentication. ```bash curl -X POST "https://api.qwilr.com/v1/pages" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Enterprise Proposal - TechCorp", "published": false, "templateId": "6ee0f841f3cc8900090d82dc", "tags": ["template-generated", "enterprise"], "metadata": { "source": "crm-integration", "opportunityId": "OPP-98765" }, "substitutions": { "company_name": "TechCorp Industries", "contact_first_name": "Michael", "contact_last_name": "Johnson", "proposal_value": "$125,000", "valid_until": "February 28, 2024", "project_items": [ {"name": "Phase 1 - Discovery", "duration": "2 weeks"}, {"name": "Phase 2 - Implementation", "duration": "6 weeks"}, {"name": "Phase 3 - Training", "duration": "1 week"} ] }, "acceptSettings": { "postAcceptance": { "enabled": true, "url": "https://yourapp.com/onboarding/start", "continueLabel": "Begin Onboarding" } }, "ownerId": "5dd0e730e2bb7800080a71cb" }' ``` ```json { "id": "7ff1g952h4dd9a00091e93ed", "name": "Enterprise Proposal - TechCorp", "status": "draft", "tags": ["template-generated", "enterprise"], "ownerId": "5dd0e730e2bb7800080a71cb", "links": { "collaboratorUrl": "https://app.qwilr.com/collaborate/7ff1g952h4dd9a00091e93ed", "editorUrl": "https://app.qwilr.com/edit/7ff1g952h4dd9a00091e93ed", "publicUrl": "https://pages.qwilr.com/Enterprise-Proposal-TechCorp-7ff1g952h4dd", "pdfUrl": "https://api.qwilr.com/v1/pages/7ff1g952h4dd9a00091e93ed/pdf" } } ``` -------------------------------- ### Create Webhook Subscription Source: https://context7.com/qwilr/openapi/llms.txt Creates a webhook subscription to receive real-time notifications for specific events. Store the returned ID to cancel the subscription later. Ensure your server responds with 200 OK within 30 seconds. ```bash # Subscribe to page acceptance events curl -X POST "https://api.qwilr.com/v1/webhooks" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "event": "pageAccepted", "targetUrl": "https://yourapp.com/webhooks/qwilr/accepted" }' ``` ```json { "id": "wh_abc123def456", "event": "pageAccepted", "url": "https://yourapp.com/webhooks/qwilr/accepted" } ``` ```bash # Subscribe to page view events curl -X POST "https://api.qwilr.com/v1/webhooks" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "event": "pageFirstViewed", "targetUrl": "https://yourapp.com/webhooks/qwilr/first-view" }' ``` ```json # Example webhook payload your server will receive: # POST https://yourapp.com/webhooks/qwilr/accepted { "event": "pageAccepted", "idempotencyKey": "b1c51b5b4844a81f7c3745002dbbd871fdda6cabe019961bcc79f972d924a2b0", "page": { "id": "6ee0f841f3cc8900090d82dc", "metadata": { "crmId": "SF-12345", "dealSize": "enterprise" } } } ``` -------------------------------- ### POST /v1/pages Source: https://context7.com/qwilr/openapi/llms.txt Creates a new Qwilr page using a collection of saved blocks, including support for dynamic substitutions and detailed quote pricing configurations. ```APIDOC ## POST /v1/pages ### Description Creates a new Qwilr page from saved blocks with support for quote pricing, metadata, and dynamic content substitutions. ### Method POST ### Endpoint https://api.qwilr.com/v1/pages ### Request Body - **name** (string) - Required - The title of the page. - **published** (boolean) - Optional - Whether the page is published upon creation. - **tags** (array) - Optional - List of tags for categorization. - **metadata** (object) - Optional - Custom metadata fields like crmId or salesRep. - **substitutions** (object) - Optional - Key-value pairs for dynamic content replacement. - **blocks** (array) - Required - List of block objects defining the page structure, including quote settings and line items. ### Request Example { "name": "Q4 Sales Proposal - Acme Corp", "published": true, "tags": ["sales", "enterprise", "q4-2024"], "metadata": { "crmId": "SF-12345", "dealSize": "enterprise", "salesRep": "john.doe@company.com" }, "substitutions": { "client_name": "Acme Corporation", "contact_name": "Jane Smith", "proposal_date": "January 15, 2024" }, "blocks": [] } ### Response #### Success Response (201) - **id** (string) - The unique identifier of the created page. - **name** (string) - The name of the page. - **status** (string) - The current status of the page. - **links** (object) - URLs for collaboration, editing, public viewing, and PDF generation. #### Response Example { "id": "6ee0f841f3cc8900090d82dc", "name": "Q4 Sales Proposal - Acme Corp", "status": "live", "links": { "publicUrl": "https://pages.qwilr.com/Q4-Sales-Proposal-Acme-Corp-6ee0f841f3cc" } } ``` -------------------------------- ### POST /v1/webhooks Source: https://context7.com/qwilr/openapi/llms.txt Creates a webhook subscription to receive real-time notifications when events occur on your Qwilr pages. Store the returned `id` to cancel the subscription later. ```APIDOC ## Create Webhook Subscription ### Description Creates a webhook subscription to receive real-time notifications when events occur on your Qwilr pages. Store the returned `id` to cancel the subscription later. ### Method POST ### Endpoint /v1/webhooks ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **event** (string) - Required - The type of event to subscribe to. Available types: `pageAccepted`, `pagePartiallyAccepted`, `pagePreviewAccepted`, `pageViewed`, `pageFirstViewed`, `pageSetLive`, `pageRevivedLive`. - **targetUrl** (string) - Required - The URL where Qwilr will send webhook notifications. ### Request Example ```bash curl -X POST "https://api.qwilr.com/v1/webhooks" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "event": "pageAccepted", "targetUrl": "https://yourapp.com/webhooks/qwilr/accepted" }' ``` ### Response #### Success Response (201 Created) - **id** (string) - The unique identifier for the webhook subscription. - **event** (string) - The type of event subscribed to. - **url** (string) - The target URL for webhook notifications. #### Response Example ```json { "id": "wh_abc123def456", "event": "pageAccepted", "url": "https://yourapp.com/webhooks/qwilr/accepted" } ``` ### Webhook Payload Example Your server will receive a POST request to your `targetUrl` with a JSON payload similar to this: ```json { "event": "pageAccepted", "idempotencyKey": "b1c51b5b4844a81f7c3745002dbbd871fdda6cabe019961bcc79f972d924a2b0", "page": { "id": "6ee0f841f3cc8900090d82dc", "metadata": { "crmId": "SF-12345", "dealSize": "enterprise" } } } ``` **Note**: Your server should respond with `200 OK` within 30 seconds. Failed deliveries are retried up to 5 times. ``` -------------------------------- ### Create a New Qwilr Page Source: https://context7.com/qwilr/openapi/llms.txt This endpoint creates a new Qwilr Page using saved blocks or a template. You can include dynamic content, metadata, tags, and specify an owner. ```bash curl -X POST "https://api.qwilr.com/v1/pages" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "templateId": "tpl_12345", "title": "New Sales Proposal", "ownerId": "usr_abcde" }' ``` -------------------------------- ### Create Page with Quote Pricing - API Request Source: https://context7.com/qwilr/openapi/llms.txt Use this POST request to create a new Qwilr page from saved blocks. Include your access token in the Authorization header and provide page details, including block configurations for quotes, in the JSON body. The response will contain the new page's ID and links. ```bash curl -X POST "https://api.qwilr.com/v1/pages" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Q4 Sales Proposal - Acme Corp", "published": true, "tags": ["sales", "enterprise", "q4-2024"], "metadata": { "crmId": "SF-12345", "dealSize": "enterprise", "salesRep": "john.doe@company.com" }, "substitutions": { "client_name": "Acme Corporation", "contact_name": "Jane Smith", "proposal_date": "January 15, 2024" }, "blocks": [ { "id": "uCHq6B6_S1EqZ2pyam8YVfUldvoF-Q", "splashSettings": { "imageUrl": "https://images.unsplash.com/photo-1530281700549-e82e7bf110d6" }, "substitutions": { "hero_title": "Your Custom Solution" } }, { "id": "xYz9A8b_T2FrW3qzbn9ZWgVmewpG-R", "foldable": { "enabled": true, "isFolded": false, "label": "View Details" } }, { "id": "pQr5C4d_U3GsX4ryco0AWtYnfxqH-S", "quoteSettings": { "currency": "USD", "selectionType": "multi", "selectionRequired": true, "showTaxTotals": true, "showTotalDiscount": true, "quoteDiscount": { "type": "percentage", "amount": 10 } }, "quoteSections": [ { "displayMode": "table", "description": "Core Services", "settings": { "showSubtotal": true, "showUnitPrice": true, "showQuantity": true }, "lineItems": [ { "type": "fixedCost", "description": "Platform License", "unitPrice": 5000, "unitLabel": "per month", "quantity": 12, "billingSchedule": "monthly", "metadata": { "sku": "PLT-001" } }, { "type": "fixedCost", "description": "Implementation Services", "unitPrice": 15000, "quantity": 1, "billingSchedule": "one-off", "optional": true, "selected": true, "lineItemDiscount": { "type": "fixed", "amount": 2000 } }, { "type": "text", "description": "Includes 40 hours of onboarding support" } ] }, { "displayMode": "plans", "description": "Support Tiers", "itemSingleSelect": true, "settings": { "showFeatures": true }, "lineItems": [ { "type": "fixedCost", "description": "Standard Support", "unitPrice": 500, "quantity": 1, "billingSchedule": "monthly", "optional": true, "selected": true, "featuresList": [ "Email support", "48-hour response time", "Knowledge base access" ] }, { "type": "fixedCost", "description": "Premium Support", "unitPrice": 1500, "quantity": 1, "billingSchedule": "monthly", "optional": true, "recommended": true, "featuresList": [ "24/7 phone support", "4-hour response time", "Dedicated account manager", "Quarterly business reviews" ] } ] } ] }, { "id": "mNo7E6f_V4HtY5szdo1BXuZogyrI-T", "acceptSettings": { "postAcceptance": { "enabled": true, "url": "https://yourapp.com/thank-you?deal=SF-12345", "continueLabel": "Complete Setup" } } } ] }' ``` -------------------------------- ### Retrieve Page Details Source: https://context7.com/qwilr/openapi/llms.txt Fetch a specific Qwilr page by its ID. You can expand the response to include metadata and acceptance details. Requires an access token for authentication. ```bash curl -X GET "https://api.qwilr.com/v1/pages/6ee0f841f3cc8900090d82dc?expand=metadata,acceptance" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" ``` -------------------------------- ### POST /v1/pages Source: https://context7.com/qwilr/openapi/llms.txt Creates a new page using an existing template. This is useful for generating pages from pre-designed templates. ```APIDOC ## Create a Page from Template Creates a page using an existing template. This is simpler than using saved blocks when you have a pre-designed template ready. ### Method POST ### Endpoint /v1/pages ### Request Body - **name** (string) - Required - The name of the page. - **published** (boolean) - Optional - Whether the page should be published immediately. - **templateId** (string) - Required - The ID of the template to use. - **tags** (array of strings) - Optional - Tags to associate with the page. - **metadata** (object) - Optional - Metadata for the page. - **source** (string) - Optional - The source of the page creation. - **opportunityId** (string) - Optional - The associated opportunity ID. - **substitutions** (object) - Optional - Key-value pairs for template substitutions. - **acceptSettings** (object) - Optional - Settings for page acceptance. - **postAcceptance** (object) - Optional - Settings for actions after acceptance. - **enabled** (boolean) - Required - Whether post-acceptance actions are enabled. - **url** (string) - Required - The URL to redirect to after acceptance. - **continueLabel** (string) - Optional - The label for the continue button. - **ownerId** (string) - Required - The ID of the user who will own the page. ### Request Example ```json { "name": "Enterprise Proposal - TechCorp", "published": false, "templateId": "6ee0f841f3cc8900090d82dc", "tags": ["template-generated", "enterprise"], "metadata": { "source": "crm-integration", "opportunityId": "OPP-98765" }, "substitutions": { "company_name": "TechCorp Industries", "contact_first_name": "Michael", "contact_last_name": "Johnson", "proposal_value": "$125,000", "valid_until": "February 28, 2024", "project_items": [ {"name": "Phase 1 - Discovery", "duration": "2 weeks"}, {"name": "Phase 2 - Implementation", "duration": "6 weeks"}, {"name": "Phase 3 - Training", "duration": "1 week"} ] }, "acceptSettings": { "postAcceptance": { "enabled": true, "url": "https://yourapp.com/onboarding/start", "continueLabel": "Begin Onboarding" } }, "ownerId": "5dd0e730e2bb7800080a71cb" } ``` ### Response #### Success Response (201 Created) - **id** (string) - The unique identifier for the created page. - **name** (string) - The name of the page. - **status** (string) - The current status of the page (e.g., 'draft'). - **tags** (array of strings) - Tags associated with the page. - **ownerId** (string) - The ID of the page owner. - **links** (object) - Links related to the page. - **collaboratorUrl** (string) - URL for collaborators. - **editorUrl** (string) - URL for the page editor. - **publicUrl** (string) - The public URL of the page. - **pdfUrl** (string) - URL to download the page as a PDF. #### Response Example ```json { "id": "7ff1g952h4dd9a00091e93ed", "name": "Enterprise Proposal - TechCorp", "status": "draft", "tags": ["template-generated", "enterprise"], "ownerId": "5dd0e730e2bb7800080a71cb", "links": { "collaboratorUrl": "https://app.qwilr.com/collaborate/7ff1g952h4dd9a00091e93ed", "editorUrl": "https://app.qwilr.com/edit/7ff1g952h4dd9a00091e93ed", "publicUrl": "https://pages.qwilr.com/Enterprise-Proposal-TechCorp-7ff1g952h4dd", "pdfUrl": "https://api.qwilr.com/v1/pages/7ff1g952h4dd9a00091e93ed/pdf" } } ``` ``` -------------------------------- ### API Response for Page Creation Source: https://context7.com/qwilr/openapi/llms.txt This is a sample successful response (201 Created) when creating a Qwilr page. It includes the unique ID of the created page and various URLs for accessing, editing, and viewing the page. ```json { "id": "6ee0f841f3cc8900090d82dc", "name": "Q4 Sales Proposal - Acme Corp", "status": "live", "tags": ["sales", "enterprise", "q4-2024"], "metadata": { "crmId": "SF-12345", "dealSize": "enterprise", "salesRep": "john.doe@company.com" }, "ownerId": "5dd0e730e2bb7800080a71cb", "links": { "collaboratorUrl": "https://app.qwilr.com/collaborate/6ee0f841f3cc8900090d82dc", "editorUrl": "https://app.qwilr.com/edit/6ee0f841f3cc8900090d82dc", "publicUrl": "https://pages.qwilr.com/Q4-Sales-Proposal-Acme-Corp-6ee0f841f3cc", "pdfUrl": "https://api.qwilr.com/v1/pages/6ee0f841f3cc8900090d82dc/pdf" } } ``` -------------------------------- ### Retrieve Saved Blocks Source: https://context7.com/qwilr/openapi/llms.txt Fetch a list of all saved blocks in the account to map names to IDs. ```bash # Get all saved blocks curl -X GET "https://api.qwilr.com/v1/blocks/saved" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" ``` ```json [ { "id": "uCHq6B6_S1EqZ2pyam8YVfUldvoF-Q", "name": "Hero Splash Block", "type": "splash" }, { "id": "xYz9A8b_T2FrW3qzbn9ZWgVmewpG-R", "name": "Company Overview", "type": "text" }, { "id": "pQr5C4d_U3GsX4ryco0AWtYnfxqH-S", "name": "Standard Quote Block", "type": "quote" }, { "id": "mNo7E6f_V4HtY5szdo1BXuZogyrI-T", "name": "Accept & Sign Block", "type": "accept" }, { "id": "jKl3G2h_W5ItZ6tyep2CYvAphzsJ-U", "name": "Case Study Section", "type": "text" } ] ``` -------------------------------- ### Error Handling Source: https://context7.com/qwilr/openapi/llms.txt The API returns standard HTTP status codes with detailed error information in the response body. ```APIDOC ## Error Handling The API returns standard HTTP status codes with detailed error information in the response body. ### Common Error Responses #### 404 Not Found Returned when a requested resource does not exist. **Response Example:** ```json { "statusCode": 404, "timestamp": "2024-01-15T10:30:00.000Z", "type": "NotFoundError", "message": "Saved block with id 'invalid-block-id' not found" } ``` #### 400 Bad Request Returned when the request is malformed or contains invalid data. **Response Example:** ```json { "statusCode": 400, "timestamp": "2024-01-15T10:30:00.000Z", "type": "ValidationError", "message": "Request body must contain either 'blocks' or 'templateId'" } ``` **Fields in Error Response:** - **statusCode** (integer) - The HTTP status code of the error. - **timestamp** (string) - The date and time the error occurred (ISO 8601 format). - **type** (string) - The type of error. - **message** (string) - A human-readable description of the error. ``` -------------------------------- ### Update Page Publication Status Source: https://context7.com/qwilr/openapi/llms.txt Use PUT requests to toggle the published status of a page between true and false. ```bash # Publish a draft page curl -X PUT "https://api.qwilr.com/v1/pages/6ee0f841f3cc8900090d82dc" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "published": true }' ``` ```json { "id": "6ee0f841f3cc8900090d82dc", "name": "Q4 Sales Proposal - Acme Corp", "status": "live", "tags": ["sales", "enterprise", "q4-2024"], "ownerId": "5dd0e730e2bb7800080a71cb", "links": { "collaboratorUrl": "https://app.qwilr.com/collaborate/6ee0f841f3cc8900090d82dc", "editorUrl": "https://app.qwilr.com/edit/6ee0f841f3cc8900090d82dc", "publicUrl": "https://pages.qwilr.com/Q4-Sales-Proposal-Acme-Corp-6ee0f841f3cc", "pdfUrl": "https://api.qwilr.com/v1/pages/6ee0f841f3cc8900090d82dc/pdf" } } ``` ```bash # Unpublish a page (return to draft) curl -X PUT "https://api.qwilr.com/v1/pages/6ee0f841f3cc8900090d82dc" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "published": false }' ``` -------------------------------- ### API Authentication Failure Response Source: https://context7.com/qwilr/openapi/llms.txt An authentication failure returns a 401 Unauthorized status with an error message. ```json { "statusCode": 401, "timestamp": "2024-01-15T10:30:00.000Z", "message": "Unauthorized access to a resource" } ```