---
canonical_url: "https://docs.composio.dev/reference/api-reference/session-webhooks/composio_session_hook_after_execute"
markdown_url: "https://docs.composio.dev/reference/api-reference/session-webhooks/composio_session_hook_after_execute.md"
product: "platform"
version: "3.1"
last_updated: null
---

# Session hook: after execute

**Documentation:** /reference/api-reference/session-webhooks/composio_session_hook_after_execute

> **API version:** This page documents Composio REST API v3.1, the current version, at `https://backend.composio.dev/api/v3.1`. `https://backend.composio.dev/api/v3` is the previous version and remains supported.

Sent after a tool or proxy call runs, when the session has an `after_execute` hook with a `webhook` handler. Composio waits for your answer before the agent sees the result, and can withhold it or pass on your changes.

---

## POST `composio.session_hook.after_execute`

**Event type:** `composio.session_hook.after_execute`

**Summary:** Session hook: after execute

Sent after a tool or proxy call runs, when the session has an `after_execute` hook with a `webhook` handler. Composio waits for your answer before the agent sees the result, and can withhold it or pass on your changes.

### Delivery Headers

- `webhook-id` (string) *(required)*: Unique request id. Equals the payload `id`.
- `webhook-timestamp` (string) *(required)*: Unix timestamp (seconds) of when the request was sent.
- `webhook-signature` (string) *(required)*: Base64 HMAC-SHA256 signature made with your session webhook secret, formatted `v1,<signature>`, over `${webhook-id}.${webhook-timestamp}.${raw_body}`.

### Request Body

**Schema:**

- `id` (string) *(required)*: Unique request id (msg_<uuid>). Also sent as the `webhook-id` header.
- `timestamp` (string (date-time)) *(required)*: ISO 8601 timestamp of when the request was created.
- `type` (enum: "composio.session_hook.after_execute") *(required)*
- `metadata` (object) *(required)*
  - `project_id` (string) *(required)*: ID of the project.
  - `session_id` (string) *(required)*: ID of the session the call was made in.
  - `user_id` (string) *(required)*: ID of the user the session belongs to.
  - `hook_id` (string) *(required)*: ID of the hook that sent this request, as set on the session.
- `data` (any) *(required)*: The call that just ran and what it returned. `type` says whether it is a tool call or a proxy call; the result is in `tool_response` or `http_response`.

**Example:**

```json
{
  "id": "msg_9a2b4c6d-1e3f-4a5b-8c7d-0e9f8a7b6c5d",
  "type": "composio.session_hook.after_execute",
  "timestamp": "2026-11-11T10:31:00Z",
  "metadata": {
    "project_id": "proj_abc123",
    "session_id": "trs_abc123",
    "user_id": "user_123",
    "hook_id": "redact_cards"
  },
  "data": {
    "type": "tool_execute",
    "tool_call": {
      "toolkit_slug": "gmail",
      "tool_slug": "GMAIL_FETCH_MESSAGE_BY_MESSAGE_ID",
      "toolkit_version": "20261101_00",
      "connected_account_id": "ca_def456",
      "arguments": {
        "message_id": "18c"
      }
    },
    "tool_response": {
      "data": {
        "body": "My card is 4242 4242 4242 4242, please update billing."
      },
      "error": null
    }
  }
}
```

### Responses

#### 200 - Answer with HTTP 200 and a JSON body that says what to do with the call. Any other status, a body that doesn't match (a misspelled field included), or no answer within the hook's `timeout_ms` counts as a failure: Composio doesn't retry, and the hook's `fallback_action` applies. Fields you don't use can be left out or sent as null.

**Response Schema:**

*One of:*
  - `action` (enum: "continue") *(required)*: Pass the response on to the agent.
  - `message` (string,null): Not used when the response is passed on.
  - `override` (any): Give the agent this in place of what the call returned. Use `tool_response` for a tool call and `http_response` for a proxy call; the other one counts as an answer that does not match.
  - `action` (enum: "block") *(required)*: Stop the call.
  - `message` (string) *(required)*: Why the call was stopped. Shown to the agent.

**Example Response:**

```json
{
  "action": "continue",
  "override": {
    "tool_response": {
      "data": {
        "body": "My card is [REDACTED], please update billing."
      }
    }
  }
}
```

---

## REST API version

The current REST API version is **v3.1**, served at `https://backend.composio.dev/api/v3.1`. Prefer it for new code and new examples.

`https://backend.composio.dev/api/v3` is the previous version. It is frozen with pinned tool-version defaults and remains supported — existing v3 integrations keep working and do not need to migrate.