Content Enrichment API / Text Generation
Get text generation status
PageMore page actions
POST /v2/project/content/getTextGenerationStatus
Retrieve the status and progress of a text-generation run by its UUID. Use this to poll the asynchronous run started by generateText until its Status becomes 'complete' or 'failed'. A run that does not belong to the calling project returns 404.
Example request
curl -X POST 'https://api.ygo.ai/v2/project/content/getTextGenerationStatus' \
-H "Authorization: Bearer $YGO_API_KEY" \
-H "X-Project-ID: $YGO_PROJECT_ID" \
-H "Content-Type: application/json" \
-d '{
"RunID": "0192fb50-8bb2-7abc-8def-112233445566"
}'Authorization
Authorization: Bearer <key>
Project-scoped API key
Headers
X-Project-IDstring (uuid) requiredProject UUID. Required for all project-scoped endpoints.
Request body required
application/json object GetTextGenerationStatusRequest
Request body for fetching the status of a single text-generation run.
RunIDstring (uuid) requiredUUID of the text-generation run to retrieve, as returned by generateText. The run must belong to the calling project.
Example request: Poll a run by its UUID (still in progress)
{
"RunID": "0192fb50-8bb2-7abc-8def-112233445566"
}Example request: Poll a run by its UUID (finished)
{
"RunID": "0192fb50-8bb2-7abc-8def-112233445566"
}Example request: Poll a run by its UUID (failed)
{
"RunID": "0192fb50-8bb2-7abc-8def-112233445566"
}Responses
200 OK
Text-generation run status retrieved successfully.
Headers
X-Trace-IDstringRequest trace ID for debugging (OpenTelemetry). Include this ID when contacting support about specific requests.
Body
application/json object GetTextGenerationStatusResponse
Single-object response envelope wrapping the text-generation run status.
Dataobject TextGenerationStatus requiredThe status and progress of a text-generation run.
8 fields
IDstring (uuid) requiredUnique run UUID.
Statusstring requiredRun lifecycle status. A freshly created run is 'queued'; it transitions to 'processing' while running, then to 'complete' or 'failed'.
Progressobject RunProgress requiredPer-hotel progress counters for the run.
4 fields
Totalinteger requiredTotal number of hotels in the run.
Generatedinteger requiredNumber of hotels for which text has been generated so far.
Failedinteger requiredNumber of hotels that failed processing.
Skippedinteger requiredNumber of hotels skipped because they needed no work.
ErrorMessagestringHuman-readable error message when the run has failed. Empty or omitted otherwise.
StartedAtstring (date-time)Timestamp when the run started processing (RFC3339). Omitted until the run has started.
CompletedAtstring (date-time)Timestamp when the run finished (RFC3339). Omitted until the run has finished.
CreatedAtstring (date-time) requiredTimestamp when the run record was created (RFC3339).
UpdatedAtstring (date-time) requiredTimestamp when the run record was last updated (RFC3339).
Example response: A run still in progress
{
"Data": {
"ID": "0192fb50-8bb2-7abc-8def-112233445566",
"Status": "processing",
"Progress": {
"Total": 5,
"Generated": 2,
"Failed": 0,
"Skipped": 0
},
"StartedAt": "2026-06-26T09:15:05Z",
"CreatedAt": "2026-06-26T09:15:00Z",
"UpdatedAt": "2026-06-26T09:16:10Z"
}
}Example response: A finished run
{
"Data": {
"ID": "0192fb50-8bb2-7abc-8def-112233445566",
"Status": "complete",
"Progress": {
"Total": 5,
"Generated": 5,
"Failed": 0,
"Skipped": 0
},
"StartedAt": "2026-06-26T09:15:05Z",
"CompletedAt": "2026-06-26T09:18:42Z",
"CreatedAt": "2026-06-26T09:15:00Z",
"UpdatedAt": "2026-06-26T09:18:42Z"
}
}Example response: A failed run
{
"Data": {
"ID": "0192fb50-8bb2-7abc-8def-112233445566",
"Status": "failed",
"Progress": {
"Total": 5,
"Generated": 1,
"Failed": 4,
"Skipped": 0
},
"ErrorMessage": "Text generation failed for one or more hotels",
"StartedAt": "2026-06-26T09:15:05Z",
"CompletedAt": "2026-06-26T09:16:20Z",
"CreatedAt": "2026-06-26T09:15:00Z",
"UpdatedAt": "2026-06-26T09:16:20Z"
}
}400 Bad Request
Bad Request - Validation error or invalid request body.
Headers
X-Trace-IDstringRequest trace ID for debugging (OpenTelemetry). Include this ID when contacting support about specific requests.
Body
application/json object ErrorResponse
Standard v2 error response wrapper.
Errorobject ErrorDetail requiredError detail containing a machine-readable code and human-readable message.
3 fields
Codestring requiredMachine-readable error code for programmatic handling.
Messagestring requiredHuman-readable error message.
Fieldsarray of object FieldErrorField-level validation errors. Only present for VALIDATION_ERROR responses.
4 fields
Fieldstring requiredName of the field that failed validation.
Messagestring requiredHuman-readable validation error message for this field.
CodestringMachine-readable reason the field failed validation. Optional; clients should fall back to Message when it is absent or unrecognized.
Paramsmap of string to anyMachine-readable values the message is built from, such as limits or allowed values. Keys are PascalCase; which keys are present depends on Code. Optional.
Example response: RunID not provided
{
"Error": {
"Code": "VALIDATION_ERROR",
"Message": "Request validation failed",
"Fields": [
{
"Field": "RunID",
"Message": "RunID is required"
}
]
}
}Example response: RunID is not a valid UUID
{
"Error": {
"Code": "VALIDATION_ERROR",
"Message": "Invalid RunID format"
}
}Example response: Malformed request body
{
"Error": {
"Code": "VALIDATION_ERROR",
"Message": "Invalid request body"
}
}401 Unauthorized
Unauthorized - Invalid or missing API key.
Headers
X-Trace-IDstringRequest trace ID for debugging (OpenTelemetry). Include this ID when contacting support about specific requests.
Body
application/json object ErrorResponse
Standard v2 error response wrapper.
Errorobject ErrorDetail requiredError detail containing a machine-readable code and human-readable message.
3 fields
Codestring requiredMachine-readable error code for programmatic handling.
Messagestring requiredHuman-readable error message.
Fieldsarray of object FieldErrorField-level validation errors. Only present for VALIDATION_ERROR responses.
4 fields
Fieldstring requiredName of the field that failed validation.
Messagestring requiredHuman-readable validation error message for this field.
CodestringMachine-readable reason the field failed validation. Optional; clients should fall back to Message when it is absent or unrecognized.
Paramsmap of string to anyMachine-readable values the message is built from, such as limits or allowed values. Keys are PascalCase; which keys are present depends on Code. Optional.
Example response: Invalid API key
{
"Error": {
"Code": "UNAUTHORIZED",
"Message": "Invalid API key"
}
}403 Forbidden
Forbidden - Valid API key but insufficient permissions for this operation. Also returned with code INSUFFICIENT_SCOPE when the API key does not carry the content.authoring:read permission this endpoint requires.
Headers
X-Trace-IDstringRequest trace ID for debugging (OpenTelemetry). Include this ID when contacting support about specific requests.
Body
application/json object ErrorResponse
Standard v2 error response wrapper.
Errorobject ErrorDetail requiredError detail containing a machine-readable code and human-readable message.
3 fields
Codestring requiredMachine-readable error code for programmatic handling.
Messagestring requiredHuman-readable error message.
Fieldsarray of object FieldErrorField-level validation errors. Only present for VALIDATION_ERROR responses.
4 fields
Fieldstring requiredName of the field that failed validation.
Messagestring requiredHuman-readable validation error message for this field.
CodestringMachine-readable reason the field failed validation. Optional; clients should fall back to Message when it is absent or unrecognized.
Paramsmap of string to anyMachine-readable values the message is built from, such as limits or allowed values. Keys are PascalCase; which keys are present depends on Code. Optional.
Example response: Missing required scope
{
"Error": {
"Code": "INSUFFICIENT_SCOPE",
"Message": "token lacks scope content.authoring:read"
}
}Example response: Project access required
{
"Error": {
"Code": "FORBIDDEN",
"Message": "Project access required"
}
}404 Not Found
Not Found - The run does not exist or is not owned by the calling project.
Headers
X-Trace-IDstringRequest trace ID for debugging (OpenTelemetry). Include this ID when contacting support about specific requests.
Body
application/json object ErrorResponse
Standard v2 error response wrapper.
Errorobject ErrorDetail requiredError detail containing a machine-readable code and human-readable message.
3 fields
Codestring requiredMachine-readable error code for programmatic handling.
Messagestring requiredHuman-readable error message.
Fieldsarray of object FieldErrorField-level validation errors. Only present for VALIDATION_ERROR responses.
4 fields
Fieldstring requiredName of the field that failed validation.
Messagestring requiredHuman-readable validation error message for this field.
CodestringMachine-readable reason the field failed validation. Optional; clients should fall back to Message when it is absent or unrecognized.
Paramsmap of string to anyMachine-readable values the message is built from, such as limits or allowed values. Keys are PascalCase; which keys are present depends on Code. Optional.
Example response: Text-generation run not found
{
"Error": {
"Code": "NOT_FOUND",
"Message": "Text-generation run not found"
}
}429 Too Many Requests
Too Many Requests. The response includes a Retry-After header with the number of seconds to wait before retrying.
Headers
X-Trace-IDstringRequest trace ID for debugging (OpenTelemetry). Include this ID when contacting support about specific requests.
Retry-AfterintegerNumber of seconds to wait before retrying the request. Present on 429 responses.
Body
application/json object ErrorResponse
Standard v2 error response wrapper.
Errorobject ErrorDetail requiredError detail containing a machine-readable code and human-readable message.
3 fields
Codestring requiredMachine-readable error code for programmatic handling.
Messagestring requiredHuman-readable error message.
Fieldsarray of object FieldErrorField-level validation errors. Only present for VALIDATION_ERROR responses.
4 fields
Fieldstring requiredName of the field that failed validation.
Messagestring requiredHuman-readable validation error message for this field.
CodestringMachine-readable reason the field failed validation. Optional; clients should fall back to Message when it is absent or unrecognized.
Paramsmap of string to anyMachine-readable values the message is built from, such as limits or allowed values. Keys are PascalCase; which keys are present depends on Code. Optional.
Example response: Limit exceeded
{
"Error": {
"Code": "RATE_LIMIT_EXCEEDED",
"Message": "Rate limit exceeded. Retry after the number of seconds in the Retry-After header."
}
}500 Internal Server Error
Internal Server Error - Unexpected server error. Include the X-Trace-ID header value when contacting support.
Headers
X-Trace-IDstringRequest trace ID for debugging (OpenTelemetry). Include this ID when contacting support about specific requests.
Body
application/json object ErrorResponse
Standard v2 error response wrapper.
Errorobject ErrorDetail requiredError detail containing a machine-readable code and human-readable message.
3 fields
Codestring requiredMachine-readable error code for programmatic handling.
Messagestring requiredHuman-readable error message.
Fieldsarray of object FieldErrorField-level validation errors. Only present for VALIDATION_ERROR responses.
4 fields
Fieldstring requiredName of the field that failed validation.
Messagestring requiredHuman-readable validation error message for this field.
CodestringMachine-readable reason the field failed validation. Optional; clients should fall back to Message when it is absent or unrecognized.
Paramsmap of string to anyMachine-readable values the message is built from, such as limits or allowed values. Keys are PascalCase; which keys are present depends on Code. Optional.
Example response: Internal server error
{
"Error": {
"Code": "INTERNAL_ERROR",
"Message": "Failed to load text-generation run"
}
}