Call 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.

1. Get Your API Key

To start using the API, retrieve your API key from the CodeWords Dashboard.

API Key Types:

  • cwk- - Standard reusable keys (recommended)

  • cwotk- - One-time keys (for sensitive operations)

2. Basic API Information

Base URL:

https://runtime.codewords.ai

Authentication:

Include this header in every request:

Authorization: Bearer YOUR_API_KEY_HERE

Content Type:

Always set:

Content-Type: application/json

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 operations

  • Rotate API keys regularly from your dashboard

You can monitor API usage and workflow execution costs directly from your History page in the CodeWords dashboard.

Last updated

Was this helpful?