Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/build/get-started/create-a-token/fungible-tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ If you plan on updating your token's metadata in the future, you should definite
;; ...
```

Hiro’s [Token Metadata API](https://www.hiro.so/token-metadata-api) watches for that specific print event (specifically the notification of "token-metadata-update") on the network and auto-updates the API’s database to reflect a change in the existing token’s metadata.
Hiro’s [Token Metadata API](../../../reference/api/token-metadata-api/) watches for that specific print event (specifically the notification of "token-metadata-update") on the network and auto-updates the API’s database to reflect a change in the existing token’s metadata.

If your token contract did not implement this print event, you could use the helper contract below to invoke a function that'll emit the same print event notification. Just invoke the `ft-metadata-update-notify` function of this contract below:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ If you plan on updating your NFT's metadata in the future, you should definitely
;; ...
</code></pre>

Hiro’s [Token Metadata API](https://www.hiro.so/token-metadata-api) watches for that specific print event (specifically the notification of "token-metadata-update") on the network and auto-updates the API’s database to reflect a change in the existing NFT’s metadata.
Hiro’s [Token Metadata API](../../../reference/api/token-metadata-api/) watches for that specific print event (specifically the notification of "token-metadata-update") on the network and auto-updates the API’s database to reflect a change in the existing NFT’s metadata.

If your NFT contract did not implement this print event, you could use the helper contract below to invoke a function that'll emit the same print event notification. Just invoke the `nft-metadata-update-notify` function of this contract below:

Expand Down
4 changes: 4 additions & 0 deletions docs/operate/run-a-signer/how-to-monitor-signer.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# How to Monitor Signer

{% hint style="info" %}
For programmatic monitoring of signer behavior, block acceptance rates, and PoX cycle metrics via REST API, see the [Signer Metrics API reference](../../reference/api/signer-metrics-api/).
{% endhint %}

We will use [Grafana Cloud](https://grafana.com/) to observe and monitor both the Signer and its corresponding Stacks node.

## Requirements
Expand Down
15 changes: 15 additions & 0 deletions docs/reference/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,21 @@
kind: openapi
spec: sbtc-emily-api
```
* [Chainhooks API](api/chainhooks-api/README.md)
* [Usage](api/chainhooks-api/usage.md)
* [Signer Metrics API](api/signer-metrics-api/README.md)
* [Usage](api/signer-metrics-api/usage.md)
* [Token Metadata API](api/token-metadata-api/README.md)
* [Usage](api/token-metadata-api/usage.md)

## Hiro-Hosted APIs

* [API Keys](api/api-keys.md)
* [Rate Limits](api/rate-limits.md)
* [Response Headers](api/response-headers.md)
* Chainhooks API
* Signer Metrics API
* Token Metadata API

## Clarity

Expand Down
49 changes: 49 additions & 0 deletions docs/reference/api/api-keys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# API Keys

{% hint style="info" %}
This page documents API key management for Hiro-hosted APIs. Self-hosted Stacks nodes do not require API keys.
{% endhint %}

{% hint style="info" %}
**Source:** This page is adapted from the [Hiro documentation](https://docs.hiro.so/resources/guides/api-keys). Hiro is a developer tooling company that provides hosted API services for the Stacks ecosystem.
{% endhint %}

Developers have open access to Hiro's APIs without the use of an API key, but are subject to [Hiro's rate limit policy](rate-limits.md). For developers who need access beyond these rate limits, we provide API keys.

{% hint style="info" %}
If you're interested in obtaining an API key, you can generate one for free in the [Hiro Platform](https://platform.hiro.so) by creating an account.

If your app needs more than 500 RPM, please [contact us](mailto:platform@hiro.so).
{% endhint %}

## Usage with cURL

The API key is passed in the `header` of your HTTP API request with `x-api-key`.

```terminal
$ curl https://api.hiro.so/... -H 'x-api-key: <your-api-key>'
```

## Usage with Node

This snippet shows how to perform a `fetch` request with your API key by including it in the request headers.

```ts
async function makeApiRequest(apiKey: string) {
const url = `https://api.hiro.so/<your-api-endpoint>`;
const response = await fetch(url, {
headers: {
"x-api-key": apiKey
}
});
return response.json();
}
```

{% hint style="warning" %}
**Caution**

The API key is passed in the header of your HTTP API request and is used only for private use, like in server-side applications.

If you use the API key in your client-side application, attackers can capture it using the client tools (E.g., browser console) and abuse your API key.
{% endhint %}
59 changes: 59 additions & 0 deletions docs/reference/api/chainhooks-api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Chainhooks API

REST API for managing Chainhooks programmatically.

{% hint style="info" %}
This page is migrated from the [Hiro documentation](https://docs.hiro.so/en/apis/chainhooks-api).
{% endhint %}

## Overview

The Chainhooks API is a REST API that allows you to programmatically manage chainhooks, configure event filters, and control webhook delivery. It provides the same functionality covered in the [Chainhooks SDK introduction](https://docs.hiro.so/en/tools/chainhooks/introduction) through direct HTTP requests.

## Key Features

- **Full chainhook management** - Create, read, update, and delete chainhooks
- **Webhook configuration** - Set up HTTP POST endpoints for event delivery
- **Evaluation endpoints** - Test chainhooks against historical blocks

## Base URLs

The Chainhooks API is available on both mainnet and testnet:

```
Testnet: https://api.testnet.hiro.so/chainhooks/v1
Mainnet: https://api.mainnet.hiro.so/chainhooks/v1
```

## API Reference

{% hint style="info" %}
For the complete interactive API reference with all endpoints, request/response schemas, and try-it-out functionality, see the [Chainhooks API Reference on Hiro Docs](https://docs.hiro.so/en/apis/chainhooks-api/reference/chainhooks).
{% endhint %}

### Available Endpoints

| Endpoint | Description |
|----------|-------------|
| Register chainhook | Create a new chainhook with event filters and webhook delivery |
| Get all chainhooks | List all registered chainhooks |
| Get one chainhook | Retrieve a specific chainhook by UUID |
| Update chainhook | Modify an existing chainhook configuration |
| Delete chainhook | Remove a registered chainhook |
| Evaluate chainhook | Test a chainhook against historical blocks |
| Enable chainhook | Enable a specific chainhook |
| Disable chainhook | Disable a specific chainhook |
| Bulk enable/disable | Enable or disable multiple chainhooks matching filters |
| Get status | Retrieve the current status of a chainhook |
| Rotate secret | Rotate the consumer secret for webhook security |
| Delete secret | Remove the consumer secret |

## Next Steps

- [Usage Guide](usage.md): Authentication and best practices
- [API Reference](https://docs.hiro.so/en/apis/chainhooks-api/reference/chainhooks): Complete endpoint documentation

{% hint style="info" %}
### Need help building with the Chainhooks API?
Reach out to us on the **#chainhook** channel on [Discord](https://stacks.chat/) under Hiro Developer Tools. There's also a [weekly office hours](https://www.addevent.com/event/oL21905919) call every Thursday at 11am ET.
{% endhint %}
Loading
Loading