> ## 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.

# Publish Credential

### Description

This endpoint allows you to **publish a credential that is currently in draft state**. This is used in conjunction with the [Generate Credential](/api-guide/generate-credential) endpoint, which creates credentials without immediately publishing them.

### 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 draft credential to publish.
</ParamField>

### Success Response Fields

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

<ResponseField name="message" type="string">
  A confirmation message. Value: `"Credential published successfully"`.
</ResponseField>

### Responses

<ResponseExample>
  ```json 200 Success theme={null}
  {
    "success": true,
    "message": "Credential published successfully"
  }
  ```

  ```json 400 Bad Request theme={null}
  {
    "success": false,
    "error": "Credential is not in draft status",
    "error_code": "invalid_status"
  }
  ```

  ```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/publish" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```
