POST
/
v1
/
processors
/
automations
/
tests
/
webhook
/
{automation_id}
client.processors.automations.tests.webhook(
    automation_id=link.id,
)
{
  "date": "Thu, 26 Jun 2025 16:10:34 GMT",
  "server": "uvicorn",
  "content-length": "30",
  "content-type": "application/json"
}
{
  "object": "automation_log",
  "id": "log_auto_MVanE4cDyuzph7tb6Zuoa",
  "user_email": null,
  "organization_id": "org_01JHR50BY5FSW274FY2TGH7EQM",
  "created_at": "2025-06-26T16:10:35.201110Z",
  "automation_snapshot": {
    "id": "lnk_DwHVXFUVLgIkxXQaxvx2s",
    "name": "Link Automation 4",
    "processor_id": "proc_2BTqDkKOTO_Ddz1N7JwVZ",
    "updated_at": "2025-06-26T16:10:20.727000",
    "default_language": "en",
    "webhook_url": "http://localhost:4000/test-webhook",
    "webhook_headers": {},
    "need_validation": false,
    "object": "automation"
  },
  "completion": {
    "id": "chatcmpl-BmjTDSVhlRdZJ1MyfjQHfTVjMnFyO",
    "choices": [
      {
        "finish_reason": "stop",
        "index": 0,
        "logprobs": null,
        "message": {
          "content": "{\"supplier_phone\": \"\", \"invoice_date\": \"\", \"amount_due\": 0, \"supplier_email\": \"\", \"receiver_phone\": \"\", \"total_tax_amount\": 0, \"invoice_id\": \"\", \"supplier_name\": \"\", \"total_amount\": 0, \"receiver_name\": \"\", \"supplier_website\": \"\", \"supplier_address\": \"\", \"currency\": \"\", \"ship_to_name\": \"\", \"ship_to_address\": \"\", \"line_items\": [], \"receiver_email\": \"\", \"receiver_address\": \"\", \"amount_paid_since_last_invoice\": 0, \"net_amount\": 0}",
          "refusal": null,
          "role": "assistant",
          "annotations": null,
          "audio": null,
          "function_call": null,
          "tool_calls": null,
          "parsed": {
            "supplier_phone": "",
            "invoice_date": "",
            "amount_due": 0.0,
            "supplier_email": "",
            "receiver_phone": "",
            "total_tax_amount": 0.0,
            "invoice_id": "",
            "supplier_name": "",
            "total_amount": 0.0,
            "receiver_name": "",
            "supplier_website": "",
            "supplier_address": "",
            "currency": "",
            "ship_to_name": "",
            "ship_to_address": "",
            "line_items": [],
            "receiver_email": "",
            "receiver_address": "",
            "amount_paid_since_last_invoice": 0.0,
            "net_amount": 0.0
          }
        },
        "field_locations": null,
        "key_mapping": null
      }
    ],
    "created": 1750954231,
    "model": "gpt-4o-mini-2024-07-18",
    "object": "chat.completion",
    "service_tier": null,
    "system_fingerprint": null,
    "usage": {
      "completion_tokens": 106,
      "prompt_tokens": 40153,
      "total_tokens": 40259,
      "completion_tokens_details": {
        "accepted_prediction_tokens": 0,
        "audio_tokens": 0,
        "reasoning_tokens": 0,
        "rejected_prediction_tokens": 0
      },
      "prompt_tokens_details": {
        "audio_tokens": 0,
        "cached_tokens": 0
      }
    },
    "extraction_id": "extr_hcf3D0mKnXhf3MTy1ERiy",
    "likelihoods": {},
    "schema_validation_error": null,
    "request_at": "2025-06-26T16:10:26.451496Z",
    "first_token_at": "2025-06-26T16:10:32.424748Z",
    "last_token_at": "2025-06-26T16:10:34.582369Z",
    "api_cost": {
      "value": 0.0060865500000000005,
      "currency": "USD"
    }
  },
  "file_metadata": {
    "filename": "uploaded_file.txt",
    "url": "data:text/plain;base64,CiAgICAgICAgICAgIFRoaXMgaXMgYSBmYWtlIGZpbGUgcGxhY2Vob2xkZXIuIAogICAgICAgICAgICBZb3VyIHRhc2sgaXMgdG8gZ2VuZXJhdGUgYXJ0aWZpY2lhbCBkYXRhIHRoYXQgY29tcGxpZXMgdG8gdGhlIHNjaGVtYSwgZm9yIHRlc3QgcHVycG9zZXMuIAogICAgICAgICAgICBQbGVhc2UgZG9udCBiZSBsYXp5IGFuZCBnZW5lcmF0ZSBkYXRhIG9mIHF1YWxpdHkuIAogICAgICAgICAgICAKICAgICAgICAgICAgVGhhbmsgeW91LgogICAgICAgICAgICA="
  },
  "external_request_log": {
    "webhook_url": "http://localhost:4000/test-webhook",
    "request_body": {
      "completion": {
        "id": "chatcmpl-BmjTDSVhlRdZJ1MyfjQHfTVjMnFyO",
        "choices": [
          {
            "finish_reason": "stop",
            "index": 0,
            "logprobs": null,
            "message": {
              "content": "{\"supplier_phone\": \"\", \"invoice_date\": \"\", \"amount_due\": 0, \"supplier_email\": \"\", \"receiver_phone\": \"\", \"total_tax_amount\": 0, \"invoice_id\": \"\", \"supplier_name\": \"\", \"total_amount\": 0, \"receiver_name\": \"\", \"supplier_website\": \"\", \"supplier_address\": \"\", \"currency\": \"\", \"ship_to_name\": \"\", \"ship_to_address\": \"\", \"line_items\": [], \"receiver_email\": \"\", \"receiver_address\": \"\", \"amount_paid_since_last_invoice\": 0, \"net_amount\": 0}",
              "refusal": null,
              "role": "assistant",
              "annotations": null,
              "audio": null,
              "function_call": null,
              "tool_calls": null,
              "parsed": {
                "supplier_phone": "",
                "invoice_date": "",
                "amount_due": 0.0,
                "supplier_email": "",
                "receiver_phone": "",
                "total_tax_amount": 0.0,
                "invoice_id": "",
                "supplier_name": "",
                "total_amount": 0.0,
                "receiver_name": "",
                "supplier_website": "",
                "supplier_address": "",
                "currency": "",
                "ship_to_name": "",
                "ship_to_address": "",
                "line_items": [],
                "receiver_email": "",
                "receiver_address": "",
                "amount_paid_since_last_invoice": 0.0,
                "net_amount": 0.0
              }
            },
            "field_locations": null,
            "key_mapping": null
          }
        ],
        "created": 1750954231,
        "model": "gpt-4o-mini-2024-07-18",
        "object": "chat.completion",
        "service_tier": null,
        "system_fingerprint": null,
        "usage": {
          "completion_tokens": 106,
          "prompt_tokens": 40153,
          "total_tokens": 40259,
          "completion_tokens_details": {
            "accepted_prediction_tokens": 0,
            "audio_tokens": 0,
            "reasoning_tokens": 0,
            "rejected_prediction_tokens": 0
          },
          "prompt_tokens_details": {
            "audio_tokens": 0,
            "cached_tokens": 0
          }
        },
        "extraction_id": "extr_hcf3D0mKnXhf3MTy1ERiy",
        "likelihoods": {},
        "schema_validation_error": null,
        "request_at": "2025-06-26T16:10:26.451496Z",
        "first_token_at": "2025-06-26T16:10:32.424748Z",
        "last_token_at": "2025-06-26T16:10:34.582369Z",
        "api_cost": {
          "value": 0.0060865500000000005,
          "currency": "USD"
        }
      },
      "file_payload": {
        "filename": "uploaded_file.txt",
        "url": "data:text/plain;base64,CiAgICAgICAgICAgIFRoaXMgaXMgYSBmYWtlIGZpbGUgcGxhY2Vob2xkZXIuIAogICAgICAgICAgICBZb3VyIHRhc2sgaXMgdG8gZ2VuZXJhdGUgYXJ0aWZpY2lhbCBkYXRhIHRoYXQgY29tcGxpZXMgdG8gdGhlIHNjaGVtYSwgZm9yIHRlc3QgcHVycG9zZXMuIAogICAgICAgICAgICBQbGVhc2UgZG9udCBiZSBsYXp5IGFuZCBnZW5lcmF0ZSBkYXRhIG9mIHF1YWxpdHkuIAogICAgICAgICAgICAKICAgICAgICAgICAgVGhhbmsgeW91LgogICAgICAgICAgICA="
      },
      "user": "test@retab.com"
    },
    "request_headers": {},
    "request_at": "2025-06-26T16:10:35.131115Z",
    "response_body": {
      "message": "Webhook received"
    },
    "response_headers": {
      "date": "Thu, 26 Jun 2025 16:10:34 GMT",
      "server": "uvicorn",
      "content-length": "30",
      "content-type": "application/json"
    },
    "response_at": "2025-06-26T16:10:35.200303Z",
    "status_code": 200,
    "error": null,
    "duration_ms": 69.188
  },
  "extraction_id": "extr_hcf3D0mKnXhf3MTy1ERiy",
  "api_cost": {
    "value": 0.0060865500000000005,
    "currency": "USD"
  },
  "cost_breakdown": {
    "total": {
      "value": 0.0060865500000000005,
      "currency": "USD"
    },
    "text_prompt_cost": {
      "value": 0.00602295,
      "currency": "USD"
    },
    "text_cached_cost": {
      "value": 0.0,
      "currency": "USD"
    },
    "text_completion_cost": {
      "value": 0.0000636,
      "currency": "USD"
    },
    "text_total_cost": {
      "value": 0.0060865500000000005,
      "currency": "USD"
    },
    "audio_prompt_cost": null,
    "audio_completion_cost": null,
    "audio_total_cost": null,
    "token_counts": {
      "prompt_regular_text": 40153,
      "prompt_cached_text": 0,
      "prompt_audio": 0,
      "completion_regular_text": 106,
      "completion_audio": 0,
      "total_tokens": 40259
    },
    "model": "gpt-4o-mini-2024-07-18",
    "is_fine_tuned": false
  }
}
client.processors.automations.tests.webhook(
    automation_id=link.id,
)
{
  "date": "Thu, 26 Jun 2025 16:10:34 GMT",
  "server": "uvicorn",
  "content-length": "30",
  "content-type": "application/json"
}
{
  "object": "automation_log",
  "id": "log_auto_MVanE4cDyuzph7tb6Zuoa",
  "user_email": null,
  "organization_id": "org_01JHR50BY5FSW274FY2TGH7EQM",
  "created_at": "2025-06-26T16:10:35.201110Z",
  "automation_snapshot": {
    "id": "lnk_DwHVXFUVLgIkxXQaxvx2s",
    "name": "Link Automation 4",
    "processor_id": "proc_2BTqDkKOTO_Ddz1N7JwVZ",
    "updated_at": "2025-06-26T16:10:20.727000",
    "default_language": "en",
    "webhook_url": "http://localhost:4000/test-webhook",
    "webhook_headers": {},
    "need_validation": false,
    "object": "automation"
  },
  "completion": {
    "id": "chatcmpl-BmjTDSVhlRdZJ1MyfjQHfTVjMnFyO",
    "choices": [
      {
        "finish_reason": "stop",
        "index": 0,
        "logprobs": null,
        "message": {
          "content": "{\"supplier_phone\": \"\", \"invoice_date\": \"\", \"amount_due\": 0, \"supplier_email\": \"\", \"receiver_phone\": \"\", \"total_tax_amount\": 0, \"invoice_id\": \"\", \"supplier_name\": \"\", \"total_amount\": 0, \"receiver_name\": \"\", \"supplier_website\": \"\", \"supplier_address\": \"\", \"currency\": \"\", \"ship_to_name\": \"\", \"ship_to_address\": \"\", \"line_items\": [], \"receiver_email\": \"\", \"receiver_address\": \"\", \"amount_paid_since_last_invoice\": 0, \"net_amount\": 0}",
          "refusal": null,
          "role": "assistant",
          "annotations": null,
          "audio": null,
          "function_call": null,
          "tool_calls": null,
          "parsed": {
            "supplier_phone": "",
            "invoice_date": "",
            "amount_due": 0.0,
            "supplier_email": "",
            "receiver_phone": "",
            "total_tax_amount": 0.0,
            "invoice_id": "",
            "supplier_name": "",
            "total_amount": 0.0,
            "receiver_name": "",
            "supplier_website": "",
            "supplier_address": "",
            "currency": "",
            "ship_to_name": "",
            "ship_to_address": "",
            "line_items": [],
            "receiver_email": "",
            "receiver_address": "",
            "amount_paid_since_last_invoice": 0.0,
            "net_amount": 0.0
          }
        },
        "field_locations": null,
        "key_mapping": null
      }
    ],
    "created": 1750954231,
    "model": "gpt-4o-mini-2024-07-18",
    "object": "chat.completion",
    "service_tier": null,
    "system_fingerprint": null,
    "usage": {
      "completion_tokens": 106,
      "prompt_tokens": 40153,
      "total_tokens": 40259,
      "completion_tokens_details": {
        "accepted_prediction_tokens": 0,
        "audio_tokens": 0,
        "reasoning_tokens": 0,
        "rejected_prediction_tokens": 0
      },
      "prompt_tokens_details": {
        "audio_tokens": 0,
        "cached_tokens": 0
      }
    },
    "extraction_id": "extr_hcf3D0mKnXhf3MTy1ERiy",
    "likelihoods": {},
    "schema_validation_error": null,
    "request_at": "2025-06-26T16:10:26.451496Z",
    "first_token_at": "2025-06-26T16:10:32.424748Z",
    "last_token_at": "2025-06-26T16:10:34.582369Z",
    "api_cost": {
      "value": 0.0060865500000000005,
      "currency": "USD"
    }
  },
  "file_metadata": {
    "filename": "uploaded_file.txt",
    "url": "data:text/plain;base64,CiAgICAgICAgICAgIFRoaXMgaXMgYSBmYWtlIGZpbGUgcGxhY2Vob2xkZXIuIAogICAgICAgICAgICBZb3VyIHRhc2sgaXMgdG8gZ2VuZXJhdGUgYXJ0aWZpY2lhbCBkYXRhIHRoYXQgY29tcGxpZXMgdG8gdGhlIHNjaGVtYSwgZm9yIHRlc3QgcHVycG9zZXMuIAogICAgICAgICAgICBQbGVhc2UgZG9udCBiZSBsYXp5IGFuZCBnZW5lcmF0ZSBkYXRhIG9mIHF1YWxpdHkuIAogICAgICAgICAgICAKICAgICAgICAgICAgVGhhbmsgeW91LgogICAgICAgICAgICA="
  },
  "external_request_log": {
    "webhook_url": "http://localhost:4000/test-webhook",
    "request_body": {
      "completion": {
        "id": "chatcmpl-BmjTDSVhlRdZJ1MyfjQHfTVjMnFyO",
        "choices": [
          {
            "finish_reason": "stop",
            "index": 0,
            "logprobs": null,
            "message": {
              "content": "{\"supplier_phone\": \"\", \"invoice_date\": \"\", \"amount_due\": 0, \"supplier_email\": \"\", \"receiver_phone\": \"\", \"total_tax_amount\": 0, \"invoice_id\": \"\", \"supplier_name\": \"\", \"total_amount\": 0, \"receiver_name\": \"\", \"supplier_website\": \"\", \"supplier_address\": \"\", \"currency\": \"\", \"ship_to_name\": \"\", \"ship_to_address\": \"\", \"line_items\": [], \"receiver_email\": \"\", \"receiver_address\": \"\", \"amount_paid_since_last_invoice\": 0, \"net_amount\": 0}",
              "refusal": null,
              "role": "assistant",
              "annotations": null,
              "audio": null,
              "function_call": null,
              "tool_calls": null,
              "parsed": {
                "supplier_phone": "",
                "invoice_date": "",
                "amount_due": 0.0,
                "supplier_email": "",
                "receiver_phone": "",
                "total_tax_amount": 0.0,
                "invoice_id": "",
                "supplier_name": "",
                "total_amount": 0.0,
                "receiver_name": "",
                "supplier_website": "",
                "supplier_address": "",
                "currency": "",
                "ship_to_name": "",
                "ship_to_address": "",
                "line_items": [],
                "receiver_email": "",
                "receiver_address": "",
                "amount_paid_since_last_invoice": 0.0,
                "net_amount": 0.0
              }
            },
            "field_locations": null,
            "key_mapping": null
          }
        ],
        "created": 1750954231,
        "model": "gpt-4o-mini-2024-07-18",
        "object": "chat.completion",
        "service_tier": null,
        "system_fingerprint": null,
        "usage": {
          "completion_tokens": 106,
          "prompt_tokens": 40153,
          "total_tokens": 40259,
          "completion_tokens_details": {
            "accepted_prediction_tokens": 0,
            "audio_tokens": 0,
            "reasoning_tokens": 0,
            "rejected_prediction_tokens": 0
          },
          "prompt_tokens_details": {
            "audio_tokens": 0,
            "cached_tokens": 0
          }
        },
        "extraction_id": "extr_hcf3D0mKnXhf3MTy1ERiy",
        "likelihoods": {},
        "schema_validation_error": null,
        "request_at": "2025-06-26T16:10:26.451496Z",
        "first_token_at": "2025-06-26T16:10:32.424748Z",
        "last_token_at": "2025-06-26T16:10:34.582369Z",
        "api_cost": {
          "value": 0.0060865500000000005,
          "currency": "USD"
        }
      },
      "file_payload": {
        "filename": "uploaded_file.txt",
        "url": "data:text/plain;base64,CiAgICAgICAgICAgIFRoaXMgaXMgYSBmYWtlIGZpbGUgcGxhY2Vob2xkZXIuIAogICAgICAgICAgICBZb3VyIHRhc2sgaXMgdG8gZ2VuZXJhdGUgYXJ0aWZpY2lhbCBkYXRhIHRoYXQgY29tcGxpZXMgdG8gdGhlIHNjaGVtYSwgZm9yIHRlc3QgcHVycG9zZXMuIAogICAgICAgICAgICBQbGVhc2UgZG9udCBiZSBsYXp5IGFuZCBnZW5lcmF0ZSBkYXRhIG9mIHF1YWxpdHkuIAogICAgICAgICAgICAKICAgICAgICAgICAgVGhhbmsgeW91LgogICAgICAgICAgICA="
      },
      "user": "test@retab.com"
    },
    "request_headers": {},
    "request_at": "2025-06-26T16:10:35.131115Z",
    "response_body": {
      "message": "Webhook received"
    },
    "response_headers": {
      "date": "Thu, 26 Jun 2025 16:10:34 GMT",
      "server": "uvicorn",
      "content-length": "30",
      "content-type": "application/json"
    },
    "response_at": "2025-06-26T16:10:35.200303Z",
    "status_code": 200,
    "error": null,
    "duration_ms": 69.188
  },
  "extraction_id": "extr_hcf3D0mKnXhf3MTy1ERiy",
  "api_cost": {
    "value": 0.0060865500000000005,
    "currency": "USD"
  },
  "cost_breakdown": {
    "total": {
      "value": 0.0060865500000000005,
      "currency": "USD"
    },
    "text_prompt_cost": {
      "value": 0.00602295,
      "currency": "USD"
    },
    "text_cached_cost": {
      "value": 0.0,
      "currency": "USD"
    },
    "text_completion_cost": {
      "value": 0.0000636,
      "currency": "USD"
    },
    "text_total_cost": {
      "value": 0.0060865500000000005,
      "currency": "USD"
    },
    "audio_prompt_cost": null,
    "audio_completion_cost": null,
    "audio_total_cost": null,
    "token_counts": {
      "prompt_regular_text": 40153,
      "prompt_cached_text": 0,
      "prompt_audio": 0,
      "completion_regular_text": 106,
      "completion_audio": 0,
      "total_tokens": 40259
    },
    "model": "gpt-4o-mini-2024-07-18",
    "is_fine_tuned": false
  }
}

Authorizations

Api-Key
string
header
required

Path Parameters

automation_id
string
required

Response

200
application/json

Successful Response

The response is of type object.