Calling CodeWords workflows
Learn how to call and manage CodeWords automations via API. Includes authentication, sync and async workflows, file uploads, and best practices for secure, reliable automation.
Overview
This guide explains how to call and manage your automations programmatically through the CodeWords API - including authentication, synchronous and asynchronous workflows, file uploads, and error handling.
CodeWords API keys are available on paid plans only. They are not available on the free plan.
1. Get your API key
To start using the API, make sure you're on a paid plan, then open Settings → API Keys from the sidebar account menu and generate or copy your key. Free users need to upgrade on Plans first.
For a fuller walkthrough of keys, endpoints, and examples, see CodeWords API key.
API Key Types:
cwk-- Standard reusable keys (recommended)cwotk-- One-time keys (for sensitive operations)
2. Basic API Information
Base URL:
https://runtime.codewords.aiAuthentication:
Include this header in every request:
Authorization: Bearer YOUR_API_KEY_HEREThis authentication flow requires a CodeWords API key from an eligible paid plan.
Content Type:
Always set:
3. Synchronous API Calls (≤120 seconds)
Use synchronous calls for workflows that complete in under two minutes.
cURL Example:
Python Example:
JavaScript/TypeScript Example:
4. Asynchronous API Calls (>120 seconds)
Use asynchronous execution for workflows that take longer than two minutes.
cURL Example:
Python Example:
JavaScript Example:
5. File Upload Workflow
For workflows requiring file inputs.
cURL Example:
Python Example:
6. Error Handling Best Practices
Handle Timeouts:
Implement Retries:
7. Environment Setup
Set API key as environment variable
Linux / macOS
Windows (CMD)
8. Security best practices
Store API keys securely as environment variables
Never expose keys in client-side code
Always use HTTPS (enforced by CodeWords)
Implement rate limiting in your application
Validate all inputs before sending data to CodeWords
Use one-time keys (
cwotk-) for sensitive operationsRotate API keys regularly from Settings → API Keys
You can monitor run logs in Activity and credit spend in Settings → Usage.
Last updated
Was this helpful?