API Reference

v1

Base URL: https://api.convilyn.com/api/v1 · Bearer token auth · JSON bodies


Introduction

The Convilyn API lets you programmatically run any of the platform's nearly 100 AI workflows. The API is RESTful, uses Bearer token authentication, and returns JSON. This reference covers the complete job lifecycle from file upload to result download.

The Goal Lane API follows a request-reply pattern with optional interactive checkpoints. You create a job, fill any required slots, confirm to start execution, poll for status, handle mid-execution checkpoints if the workflow requires them, and download the result.

Base URL & Authentication

HTTP
Base URL: https://api.convilyn.com/api/v1

Authorization: Bearer {your_api_key}
Content-Type: application/json
Getting an API key: API keys are available in your account settings at convilyn.corenovus.com. Free tier keys are rate-limited — see Rate Limits for details.

Step 1: Workflow Catalog

Start by fetching the available workflows to find the spec_id you need.

GET /workflows/catalog
HTTP
GET /workflows/catalog
Authorization: Bearer {token}

Returns an array of workflow catalog items. Each item includes:

Field Type Description
spec_id string The identifier used when creating a job (e.g., goal_lane.cover_letter)
name string Human-readable workflow name
description string What the workflow does
supported_input_formats string[] Accepted file extensions (e.g., ["pdf", "docx"])
required_slots object[] Slots that must be filled before execution starts. May be empty.
maxInputSizeBytes number Maximum total upload size in bytes
minFileCount number Minimum number of files required

Step 2: Upload a File

Upload the file(s) your workflow needs before creating the job. Use multipart/form-data encoding.

POST /upload
HTTP
POST /upload
Authorization: Bearer {token}
Content-Type: multipart/form-data

file={binary}

Returns a file_id. Store it — you'll reference it when creating the job.

Files expire after 24 hours if not associated with a job. Upload all required files before creating the job, then pass their file_id values in the job creation request.

Step 3: Create a Job

POST /jobs/goal
JSON
POST /jobs/goal
Authorization: Bearer {token}
Content-Type: application/json

{
  "workflowId": "goal_lane.cover_letter",
  "fileIds": ["file_abc123", "file_def456"]
}

The response includes:

Field Type Description
jobSpecId string The job identifier used in all subsequent requests
status "pending" Initial job state
slots object[] Slot definitions if the workflow requires pre-execution input. Empty array if none.
itemVersion number Current version number — required for optimistic locking in subsequent PATCH requests

Step 4: Fill Required Slots

If the job response included slots, fill them before confirming. Skip this step if slots was empty.

PATCH /jobs/goal/{jobSpecId}/slots
JSON
PATCH /jobs/goal/{jobSpecId}/slots
Authorization: Bearer {token}
Content-Type: application/json

{
  "itemVersion": 1,
  "slots": [
    { "slotId": "tone", "value": "professional" },
    { "slotId": "length", "value": "one_page" }
  ]
}

The itemVersion field is required for all PATCH operations and implements optimistic locking. If two requests attempt to modify the same job simultaneously, the second will receive a 409 Conflict. A successful PATCH returns the updated job with an incremented itemVersion.

Step 5: Confirm & Start Execution

Once slots are filled (or immediately if there were none), confirm the job to begin asynchronous execution.

POST /jobs/goal/{jobSpecId}/confirm
JSON
POST /jobs/goal/{jobSpecId}/confirm
Authorization: Bearer {token}
Content-Type: application/json

{ "itemVersion": 2 }

Returns 202 Accepted. Execution begins asynchronously. The job status transitions:

pending confirming executing

Step 6: Poll for Status

GET /jobs/goal/{jobSpecId}/status

Example response while executing:

JSON
{
  "status": "executing",
  "progress": 45,
  "currentStep": "generating_output"
}

Full status lifecycle:

pending confirming executing completed failed

Poll every 2 seconds while executing. Stop when status is completed or failed. Do not poll more frequently — this will trigger rate limiting on the status endpoint.

On failed, the response includes an error field with a description of what went wrong.

Step 7: Interactive Checkpoints

Some workflows pause mid-execution and return to status: "slot_needed". This is expected — the workflow is waiting for your input before it can proceed.

When you receive slot_needed from the status endpoint:

JSON
{
  "status": "slot_needed",
  "checkpoint": {
    "checkpointId": "profile_review",
    "stepOutputPreview": "Detected roles: Senior Engineer, Tech Lead...",
    "slots": [
      { "slotId": "confirmed_titles", "type": "text" }
    ]
  },
  "itemVersion": 3
}

Present the stepOutputPreview and slot prompts to your user. Then fill the slot via PATCH /slots (using the current itemVersion), and confirm via POST /confirm to resume execution.

Workflows with multiple interactive phases cycle through:

executing slot_needed executing completed

Each checkpoint increments the itemVersion. Always use the latest version from the status response when submitting slots.

Step 8: Download Results

Once status is completed, request a pre-signed download URL.

GET /jobs/goal/{jobSpecId}/download
JSON
{
  "url": "https://s3.amazonaws.com/convilyn-results/job_789/output.zip?X-Amz-...",
  "expiresAt": "2026-03-30T14:00:00Z",
  "filename": "output.zip"
}
The pre-signed URL is valid for 1 hour. The output file (usually a ZIP containing all generated files) is retained for 24 hours after job completion. Download before then or request a fresh URL.

Error Handling

The API uses standard HTTP status codes. Key error cases to handle:

Status Name When it occurs & how to handle
409 Conflict itemVersion mismatch. Re-fetch the job to get the current version, then retry with the correct value.
422 Unprocessable Entity Validation error. The response body includes an errors array with field-level details. Fix the request and retry.
400 Bad Request Invalid state transition — e.g., confirming a job that is already executing, or filling slots on a completed job. Check your state machine logic.
429 Too Many Requests Rate limit hit. Respect X-RateLimit-Reset header and back off. Free tier limits are stricter than paid tiers.

Example: Handling a 409 Conflict

HTTP
// Received 409 on PATCH /slots
// Re-fetch current job state
GET /jobs/goal/{jobSpecId}
// Response includes current itemVersion: 5

// Retry with correct version
PATCH /jobs/goal/{jobSpecId}/slots
{ "itemVersion": 5, "slots": [...] }

All error responses follow this shape:

JSON
{
  "error": "version_conflict",
  "message": "itemVersion mismatch: expected 5, got 3",
  "code": 409
}

Rate Limits

Rate limits apply per API key, per endpoint, and per plan tier. The X-RateLimit-Remaining and X-RateLimit-Reset headers are included in all responses to help you manage your consumption.

Free
10 job creations per day · 60 status poll requests per minute · 5 concurrent jobs
Pro
500 job creations per day · 300 status poll requests per minute · 20 concurrent jobs
Business
Unlimited job creations · 1000 status poll requests per minute · 100 concurrent jobs · dedicated capacity
Tip: Poll the status endpoint every 2 seconds — not faster. The recommended interval avoids rate limiting while still delivering timely updates. Check your current limits in the account dashboard.

Full Flow Example

A minimal end-to-end flow for the cover letter workflow (no pre-execution slots, no interactive checkpoints):

Shell
// 1. Upload files
POST /upload  →  { "file_id": "file_resume123" }
POST /upload  →  { "file_id": "file_jd456" }

// 2. Create job
POST /jobs/goal
{
  "workflowId": "goal_lane.cover_letter",
  "fileIds": ["file_resume123", "file_jd456"]
}
→  { "jobSpecId": "job_789", "itemVersion": 1, "slots": [] }

// 3. Confirm immediately (no slots to fill)
POST /jobs/goal/job_789/confirm
{ "itemVersion": 1 }
→  202 Accepted

// 4. Poll until completed (every 2 seconds)
GET /jobs/goal/job_789/status  →  { "status": "executing", "progress": 30 }
GET /jobs/goal/job_789/status  →  { "status": "executing", "progress": 75 }
GET /jobs/goal/job_789/status  →  { "status": "completed" }

// 5. Download result
GET /jobs/goal/job_789/download
→  { "url": "https://s3.amazonaws.com/...", "expiresAt": "2026-03-30T14:00:00Z" }

For workflows with interactive checkpoints, the polling loop handles slot_needed responses by presenting the checkpoint data to your user, collecting their input, and cycling through PATCH + confirm before resuming the poll.