--- name: canva-cost-tuning description: 'Reduce unnecessary Canva Connect operations using measured request, retry, cache, and premium-feature evidence. Use when reviewing usage, trial-quota pressure, deduplication, or budget guardrails. Trigger with: "reduce Canva usage", "Canva quota planning", "optimize Canva calls".' allowed-tools: Read, Grep, Write, Edit version: 2.0.0 argument-hint: '[usage-window-and-budget-guardrail]' model: inherit effort: high license: MIT author: Jeremy Longshore tags: - saas - canva - cost - operations compatibility: 'Requires current tenant entitlement evidence and an approved measurement window; public pricing must not be inferred.' --- # Canva Usage and Entitlement Control ## Overview Optimize application behavior, not an imagined universal Canva bill. Use current endpoint metadata, capability/trial responses, and local operation receipts to find duplicate calls, polling waste, and avoidable retries. ## Prerequisites - Measurement window and application operation ledger - Current tenant entitlement, capability, and contract evidence - Latency, freshness, retry, and data-retention budgets ## Instructions ### Step 1: Build the baseline Use Read and Grep to count logical operations, provider requests, retries, polling reads, cache hits, failures, and premium-feature responses by endpoint pattern. ### Step 2: Separate request classes Distinguish user reads, metadata reads, mutating submissions, and job-status polling. Never combine them into one cost number. ### Step 3: Remove duplicates Persist operation identity before writes, coalesce concurrent reads where safe, and reconcile existing jobs before resubmission. ### Step 4: Tune polling Apply bounded exponential backoff to existing asynchronous jobs and stop at the application timeout without creating replacements. ### Step 5: Tune caches safely Cache only policy-approved metadata with explicit freshness and authorization invalidation. Never cache tokens or signed result URLs as durable content. ### Step 6: Gate the change Use Write or Edit to record baseline, selected control, expected impact, experiment window, rollback threshold, and measured result. ## Authentication Canva Connect calls use Bearer access tokens obtained by a backend through OAuth 2.0 Authorization Code with SHA-256 PKCE. Request explicit least-privilege scopes, keep client secrets and tokens out of browser-visible state, and serialize refresh so the replacement single-use refresh token is stored atomically. ## Tool Discipline Use Read and Grep for discovery and evidence. Use Write or Edit only for the approved artifact, code, configuration, test, or receipt described by this workflow; do not make an unapproved Canva-side change. ## Output - Scoped decision or implementation artifact - Redacted operation and validation receipt - Failure, rollback, and follow-up ownership record ## Examples A review finds repeated export submissions caused by request timeouts. The service persists job identity before dispatch and resumes polling, reducing duplicate work without claiming a dollar savings percentage. ## Error Handling | Failure | Response | | --- | --- | | No operation ledger | Add observability before claiming optimization | | Entitlement unknown | Report uncertainty and obtain current tenant evidence | | Cache crosses tenants | Disable it and correct the key/authorization boundary | | Savings based on list price | Replace with measured usage and current contract data | ## Resources - [First-party source notes](references/official-docs.md) - [Trial quotas](https://www.canva.dev/docs/connect/api-requests-responses/#trial-quotas) - [Capabilities](https://www.canva.dev/docs/connect/capabilities/)