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

# Update Credential

### Description

This endpoint allows you to **update an existing credential**. Currently supports updating the expiry date of a credential.

### Headers

<ParamField header="Authorization" type="string" required="true">
  Bearer YOUR\_API\_TOKEN — obtainable from **Hyperstack Dashboard → Settings → API Access**
</ParamField>

### Path Parameters

<ParamField path="document_id" type="string" required="true">
  The unique ID (key) of the credential to update.
</ParamField>

### Body Parameters

<ParamField body="expiry" type="number" required="false">
  Unix timestamp (seconds) representing the new expiry date for the credential. Pass `null` or omit to remove the expiry date.
</ParamField>

### Success Response Fields

<ResponseField name="success" type="boolean">
  Indicates whether the credential was successfully updated.
</ResponseField>

### Responses

<ResponseExample>
  ```json 200 Success theme={null}
  {
    "success": true
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "success": false,
    "error": "Document does not exists in your account"
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "detail": "Invalid token or organization not found"
  }
  ```
</ResponseExample>

```bash theme={null}
curl -X POST "https://api.thehyperstack.com/v1/credential/j4nDvaxF6ehodPXI84p4X1yhQe7lrYgx/update" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "expiry": 1893456000
  }'
```
