> ## Documentation Index
> Fetch the complete documentation index at: https://cobalt-55-abhishek.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Execute Action

> Execute an application action against a connected account.

Execute an action against a linked account's connected application. The request body holds the action's parameters, as described by its [parameter schema](/v3/api-reference/applications/get-action-parameters). Refold uses the linked account's stored credentials automatically — you don't put app tokens in the body.

<Warning>
  Write actions (create / update / delete) make real changes in the connected application. Test with read actions (e.g. `get_contact`, `search_contacts`) first.
</Warning>

## Authentication

<ParamField header="x-api-key" type="string" required>
  Your Refold API key. Find it in **Settings → Credentials**.
</ParamField>

<ParamField header="linked_account_id" type="string" required>
  The linked account whose connection to use.
</ParamField>

## Path Parameters

<ParamField path="slug" type="string" required>The application slug. **Example:** `hubspot`</ParamField>
<ParamField path="action_id" type="string" required>The action to execute. **Example:** `get_contact`</ParamField>

## Body Parameters

<ParamField body="{parameter}" type="any">
  One key per parameter from the action's schema. Required parameters must be present.
</ParamField>

## Response

<Tabs>
  <Tab title="200 OK">
    <ResponseField name="node_status" type="string">Execution status, e.g. `Success`.</ResponseField>
    <ResponseField name="data" type="object">The action's result, in the application's native shape.</ResponseField>
  </Tab>

  <Tab title="404 Not Found">
    <ResponseField name="status_code" type="integer">HTTP status code.</ResponseField>
    <ResponseField name="http_error_type" type="string">Error category.</ResponseField>
    <ResponseField name="error_code" type="string">Internal error code.</ResponseField>
    <ResponseField name="message" type="string">Human-readable error description.</ResponseField>
  </Tab>
</Tabs>

<ResponseExample>
  ```json 200 theme={null}
  {
    "node_status": "Success",
    "data": {
      "results": [
        {
          "id": "51",
          "properties": {
            "email": "contact@example.com",
            "firstname": "Brian",
            "lastname": "Halligan (Sample Contact)",
            "createdate": "2023-10-06T09:53:17.242Z"
          },
          "createdAt": "2023-10-06T09:53:17.242Z",
          "updatedAt": "2024-05-15T18:35:12.877Z",
          "archived": false
        }
      ],
      "paging": {}
    }
  }
  ```

  ```json 404 theme={null}
  {
    "status_code": 404,
    "http_error_type": "NOT_FOUND",
    "error_code": "SERVER_ERROR",
    "message": "Action no_such_action not found in Application hubspot"
  }
  ```
</ResponseExample>

<RequestExample>
  ```bash cURL (read action) theme={null}
  curl -X POST "https://app.refold.ai/api/v2/integration-schema/{slug}/actions/get_contact/execute" \
    -H "x-api-key: YOUR_API_KEY" \
    -H "linked_account_id: YOUR_LINKED_ACCOUNT_ID" \
    -H "Content-Type: application/json" \
    -d '{ "limit": "1" }'
  ```

  ```bash cURL (write action) theme={null}
  curl -X POST "https://app.refold.ai/api/v2/integration-schema/{slug}/actions/create_contact/execute" \
    -H "x-api-key: YOUR_API_KEY" \
    -H "linked_account_id: YOUR_LINKED_ACCOUNT_ID" \
    -H "Content-Type: application/json" \
    -d '{ "email": "jane@example.com", "firstname": "Jane" }'
  ```
</RequestExample>
