apyhub
COMMUNICATIONS · SMART GENERATION

Generate Thank You E-mail API

What it does

Thank You Email Generator creates a thank-you email from a short content brief and returns the generated message asynchronously.

Send a body object with the required content field, which should describe the product name and parameters you want reflected in the email. You can also include context for extra instructions, language to set the output language, max_length to cap the email length in words, and voice_tone to steer the style. The POST endpoint returns a job_id and status_url so you can track generation without blocking your workflow.

When the job finishes, the status endpoint returns a structured response containing the job status and the generated email inside data.attributes.result. That makes it easy to plug into systems that need a concise follow-up message after a purchase, interview, support interaction, event registration, or referral.

Use Thank You Email Generator when you need a quick, readable thank-you note without building your own prompt pipeline. It fits into CRM automations, post-interaction workflows, and internal tools where the input is a short brief and the output is a finished email body.

▣ ENDPOINT 01 / 02
POST
Submit Generate Thankyou Email job
http://localhost:8080/sharpapi/generate-thank-you-email
QUICKSTARTGUIDE

Quickstart

Send the required content to generate a thank-you email as an async job.

curl -X POST "http://localhost:8080/sharpapi/generate-thank-you-email" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"content":"Thank you email for a new customer purchasing a wireless headset"}'

What you'll get back

Returns a JSON object with a job_id string and a status_url string for checking the async job status.

{
  "status_url": "https://apyhub.com/services/provider/sharpapi/api/v1/ecommerce/thank_you_email/job/status/549acbf4-697f-4d13-b403-faa7814bfc60",
  "job_id": "549acbf4-697f-4d13-b403-faa7814bfc60"
}
TRY ITLIVE · 50 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Product name and its parameters to generate the thank you Email.
An additional flexible instructions for content processing.
Specify the language of the output, defaults to English
Specify the maximum length of email in words. eg. 100
Specify the voice tone of the output. It can be adjectives like funny or joyous, or even the name of a famous writer.

About this endpoint

What it does

Submits an asynchronous job to generate a thank-you email from the supplied content and optional processing instructions. The endpoint returns a job identifier and a status URL so you can check when the result is ready.

Request Body

ParameterTypeMandatoryDescription
contentStringYesProduct name and its parameters to generate the thank you email.
contextStringNoAn additional flexible instruction for content processing.
languageStringNoSpecifies the language of the output; defaults to English.
max_lengthNumberNoSpecifies the maximum length of the email in words, for example 100.
voice_toneStringNoSpecifies the voice tone of the output. It can be adjectives like funny or joyous, or even the name of a famous writer.

Response

Returns a JSON object with a job_id string field and a status_url string field. job_id is the identifier of the submitted asynchronous job, and status_url is the URL used to check the job status.

ParameterTypeMandatoryDescription
job_idStringYesIdentifier of the submitted asynchronous job. Format: UUID.
status_urlStringYesURL used to check the submitted job status. Format: URI.

Notes

This endpoint kicks off an async job and returns immediately with a job identifier; the actual work runs in the background. Pair this call with the corresponding job_check endpoint — poll that until the status reaches a terminal state to retrieve the result. Extract the job identifier from job_id.

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 02 / 02
GET
Get Generate Thankyou Email job status
http://localhost:8080/sharpapi/generate-thank-you-email/job/status/:job_id
QUICKSTARTGUIDE

Quickstart

Check the status of a generated thank-you email job by its job ID.

curl -X GET "http://localhost:8080/sharpapi/generate-thank-you-email/job/status/:job_id" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with a data object. Inside data, id and type are strings, and attributes is an object with type and status strings plus a result object containing an email string.

{
  "data": {
    "id": "job_123",
    "type": "job",
    "attributes": {
      "type": "generate-thank-you-email",
      "result": {
        "email": "Thank you for your time and support."
      },
      "status": "completed"
    }
  }
}
TRY ITLIVE · 1 ATOM
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Retrieves the current status of a Generate Thankyou Email job identified by its job_id. The response returns a JSON object containing a data object with the job details and, when available, the generated email result.

Path Parameter(s)

AttributeTypeMandatoryDescription
job_idStringYesJob identifier in UUID format.

Response

Returns a JSON object with a data object. Inside data, the response includes the job id and type as strings, plus an attributes object containing type, status, and result. When present, attributes.result is an object with an email string field.

ParameterTypeMandatoryDescription
dataObjectNoWrapper object containing the job response.
data.idStringNoJob identifier.
data.typeStringNoJob type.
data.attributesObjectNoObject containing job attributes.
data.attributes.typeStringNoAttribute type value.
data.attributes.statusStringNoCurrent job status.
data.attributes.resultObjectNoResult object containing the generated email when available.
data.attributes.result.emailStringNoGenerated email content.

Notes

Poll this endpoint with the job_id returned by the submit call. The data.attributes.status field cycles through transitional values before reaching a terminal state; the result is available in data.attributes.result.email once the job completes successfully.

Path parameters

Name
Type
Description
job_idREQUIRED
string
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.