CodeWords API key

Overview

The CodeWords API lets any external application trigger your workflows with simple HTTP requests. Whether you're building a web app, mobile app, or connecting to third-party services, it's as easy as making a POST request.

Getting your API key

First things first — you'll need credentials. Grab your API key from the Codewords account dashboard.

Your API key will be under the Advanced tab within API keys & Environment variables section:

  • cwk- for standard reusable keys (most common)

  • cwotk- for one-time keys (extra security for sensitive operations)

Treat your API key like a password, keep it secret and store it as an environment variable.

How the API works

Base URL: https://runtime.codewords.ai

The endpoints you'll use:

  • Quick tasks: POST /run/{serviceId} (under two minutes)

  • Heavy lifting: POST /run_async/{serviceId} (up to 30 minutes)

  • Check results: GET /result/{request_id} (for async calls)

  • Watch progress: GET /logs/{request_id} (live streaming)

  • Upload files: POST /file (when your workflow needs files)

Authentication: Just add "Authorization: Bearer {YOUR_API_KEY}" to your headers.

Quick synchronous calls

Perfect for automations that finish fast (under two minutes). Your request waits for the result and gets it back immediately.

Using cURL

Python example

Install the CodeWords client first:

JavaScript/TypeScript example

Install the client:

Asynchronous calls for heavy lifting

For automations that need more time (up to 30 minutes), use async execution. You'll get a request ID immediately, then check back for results.

Using cURL

Python example

TypeScript example

Working with files

When your CodeWords automation needs file inputs, upload them first and pass the download URLs.

Upload and process pattern

Integrating with web apps

Here's how to add CodeWords to a Flask web application:

Error handling best practices

Make your API calls bulletproof with smart retry logic:

FAQ

What is the CodeWords API used for?

The CodeWords API lets you trigger and control workflows directly from any app or system using simple HTTP requests. You can build web or mobile apps that run CodeWords automations seamlessly in the background.

What’s the difference between sync and async API calls?
  • Synchronous (/run): Best for fast workflows that finish in under two minutes.

  • Asynchronous (/run_async): Designed for longer jobs (up to 30 minutes). You get a request ID instantly and can check progress or results later.

How do I authenticate requests?

Include your API key in the request header: Authorization: Bearer YOUR_API_KEY This ensures that every API call is securely linked to your CodeWords account.

Can I upload files to my workflows?

Yes. Use the /file endpoint to upload any file your automation needs. CodeWords returns a secure download URL you can include in your workflow inputs.

What programming languages are supported?

You can call the API from any language that supports HTTP requests. Official clients are available for Python and JavaScript/TypeScript, making integration effortless.

How long can an API job run?

Synchronous jobs run for up to 2 minutes, while asynchronous workflows can run for up to 30 minutes before timing out.

Last updated

Was this helpful?