> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrapengine.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Vault Integration

> Rotate the AppRole secret_id on a registered vault integration. The vault address is immutable.

## Overview

Rotates the stored AppRole `secret_id` for an integration. Use this after rotating the AppRole in Vault itself. The vault address, namespace, and role ID cannot be changed — delete and recreate the integration to change them. Rotations take effect immediately; in-flight authenticate actions that have already acquired a token are unaffected.

## Path Parameters

<ParamField path="id" type="string" required={true}>
  Integration ID (UUID).
</ParamField>

## Body

<ParamField body="secretId" type="string">
  New AppRole `secret_id`. Stored encrypted at rest.
</ParamField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT "https://api.scrapengine.io/api/v1/vault-integrations/5f8c6a74-5f2e-4f5a-9e58-5b9c3c7d2a11" \
    -H "Authorization: Bearer $SCRAPENGINE_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "secretId": "s.yyyyyyyyyyyyyyyyyyyyyyyy"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://api.scrapengine.io/api/v1/vault-integrations/5f8c6a74-5f2e-4f5a-9e58-5b9c3c7d2a11",
    {
      method: "PUT",
      headers: {
        "Authorization": `Bearer ${process.env.SCRAPENGINE_API_KEY}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({ secretId: process.env.VAULT_SECRET_ID }),
    },
  );
  const data = await response.json();
  ```
</CodeGroup>

## Response

### Success Response (200)

<ResponseField name="id" type="string">
  Integration ID (UUID).
</ResponseField>

<ResponseField name="name" type="string">
  Human-readable name.
</ResponseField>

<ResponseField name="type" type="string">
  Backend type. Always `hashicorp` in v1.
</ResponseField>

<ResponseField name="address" type="string">
  Vault address.
</ResponseField>

<ResponseField name="namespace" type="string">
  Vault Enterprise namespace, or `null` if unset.
</ResponseField>

<ResponseField name="authMethod" type="string">
  Auth method. Always `approle` in v1.
</ResponseField>

<ResponseField name="roleId" type="string">
  AppRole role\_id.
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO 8601 timestamp.
</ResponseField>

<ResponseField name="updatedAt" type="string">
  ISO 8601 timestamp. Bumped on a successful rotation.
</ResponseField>

**Example Response:**

```json theme={null}
{
  "id": "5f8c6a74-5f2e-4f5a-9e58-5b9c3c7d2a11",
  "name": "prod-vault",
  "type": "hashicorp",
  "address": "https://vault.prod.example.com:8200",
  "namespace": null,
  "authMethod": "approle",
  "roleId": "8f2e1c0c-0e4a-4b58-8b2e-4a9e1c8a4a11",
  "createdAt": "2026-04-20T11:05:02Z",
  "updatedAt": "2026-04-24T09:18:11Z"
}
```

### Error Responses

| Status | Description                                       |
| ------ | ------------------------------------------------- |
| `400`  | Invalid body — for example empty `secretId`.      |
| `401`  | Unauthorized — invalid or missing API key.        |
| `404`  | Integration not found or not owned by the caller. |
