Skip to main content

Acknowledgment Response Body

The acknowledgment response returns the identifier of the created acknowledgment record together with the normalized acknowledgment status and success flag.

Structure

{
"ad_ack_id": "string",
"status": "string",
"success": "boolean"
}

ad_ack_id

  • Type: string
  • Description: Unique identifier of the acknowledgment record created by Adstract.

status

  • Type: string
  • Description: Normalized acknowledgment status returned by the backend.
  • Allowed values:
    • ok
    • no_ad_used
    • recoverable_error

success

  • Type: boolean
  • Description: Whether the acknowledgment completed successfully.
  • Behavior:
    • true when status is ok or no_ad_used
    • false when status is recoverable_error

Response values by HTTP code

HTTP codestatussuccessad_ack_id
200 OK"ok" or "no_ad_used"truepopulated
201 Created"recoverable_error"falsepopulated

See Acknowledgment Status Codes for the full meaning of each response code.

Handling successful responses

const response = await fetch("https://api.adstract.ai/api/ad-injection/acknowledge/", {
method: "POST",
headers: {
"X-Adstract-API-Key": "your-api-key",
"Content-Type": "application/json",
},
body: JSON.stringify({
ad_response_id: "55c59ce2-a31f-4ce4-95b3-f930fd9cd564",
llm_response: llmResponse,
}),
});

if (response.status === 200 || response.status === 201) {
const data = await response.json();
const ackId = data.ad_ack_id;
const status = data.status;
const success = data.success;
}

Next steps