With asynchronous applications, your team can build and deploy no-code applications in AI Studio and you can use the async applications API to generate content asynchronously or in batches.

For example, your product team can build a no-code application that creates product description pages, and then you can use the async applications API to generate pages in batches for multiple products.

This guide helps you understand how to run async jobs. The API is similar to the no-code applications API, but it allows you to process batches of content generation requests asynchronously.

You need an API key to access the Writer API. Get an API key by following the steps in the API quickstart.

We recommend setting the API key as an environment variable in a .env file with the name WRITER_API_KEY.

Endpoint overview

URL: POST https://api.writer.com/v1/applications/{application_id}/jobs

curl 'https://api.writer.com/v1/applications/<application-id>/jobs' \
-X POST \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $WRITER_API_KEY" \
--data-raw '{
  "inputs": [
    {
      "id": "Input name",
      "value": [
        "Input value"
      ]
    }
  ]
}'

Path parameters

ParameterTypeDescription
application_idstringThe ID of the no-code application

Request body

The async applications API has the same request body structure as the no-code applications API. It should contain an array of input objects matching the no-code application’s input schema.

Response format

A successful job creation request returns a JSON object with the following structure:

ParameterTypeDescription
job_idstringThe ID of the job
statusstringThe status of the job. Can be in_progress, completed, or failed.
created_atstringThe date and time the job was created
{
  "job_id": "123-456-789",
  "status": "in_progress",
  "created_at": "2024-03-15T10:00:00Z"
}

Usage example

The following example demonstrates using the async applications API to generate content asynchronously with a hypothetical product description generation application.

Create and deploy a no-code application

First, create and deploy a no-code application in AI Studio. If you don’t already have a no-code application, follow the text generation guide to get started.

Create an async job

Send a POST request with the inputs for the application to create an async job.

curl 'https://api.writer.com/v1/applications/1234-45090-534590/jobs' \
-X POST \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $WRITER_API_KEY" \
--data-raw '{
  "inputs": [
    {
      "id": "Product descriptions",
      "value": [
        "Terra running shoe",
        "Aqua swim goggles",
        "Flex yoga mat"
      ]
    }
  ]
}'

Check job status

Use the job ID from the creation response to check the status of your job and see the results.

curl 'https://api.writer.com/v1/applications/jobs/<job-id>' \
-H "Authorization: Bearer $WRITER_API_KEY"

The response includes the current status. If the job has completed, the results are in the data.suggestion field, which has the same structure as the no-code applications API.

{
    "id": "123-456-789",
    "status": "completed",
    "application_id": "2932402-23429023894-234234234",
    "created_at": "2025-02-10T18:18:09.501223Z",
    "completed_at": "2025-02-10T18:18:14.470324Z",
    "data": {
        "title": "Social post",
        "suggestion": "# Social post\nImage: A photo of a person running in a pair of Terra running shoes.\n\nCaption:\n\nIntroducing the all-new Terra running shoe, designed to take you further than ever before. With its innovative cushioning system and durable outsole, the Terra is perfect for runners of all levels.\n\nWhether you're hitting the trails or pounding the pavement, the Terra will keep you comfortable and supported mile after mile. So what are you waiting for? Lace up a pair of Terras and start your journey today!\n\n#TerraRunningShoe #RunFurther #NeverStopExploring #GetOutside"
    },
    "error": null
}

List all jobs

You can retrieve all jobs for an application to monitor batch processing:

curl 'https://api.writer.com/v1/applications/<application-id>/jobs' \
-H "Authorization: Bearer $WRITER_API_KEY"

Retry failed jobs

If a job fails, you can retry it using the retry endpoint:

curl 'https://api.writer.com/v1/applications/jobs/<job-id>/retry' \
-X POST \
-H "Authorization: Bearer $WRITER_API_KEY"

Next steps

By following this guide, you can use the async Applications API to handle large-scale tasks.

Next, learn how to enhance your no-code applications with Knowledge Graph, our tool for RAG.