# Zetrix Service

A Zetrix BaaS API allows developers to interact with the underlying blockchain network and utilize its features and functionality through a standardized interface. Some common capabilities provided by a BaaS API include:

1. **Blockchain Account Management:** APIs to create, configure, and manage account API provides programmatic access on a blockchain network.
2. **Smart Contract Deployment and Execution**: APIs to deploy smart contracts to the blockchain network and invoke their functions. This includes functions for compiling, deploying, and interacting with smart contracts.
3. **Crosschain Blockchain** APIs: Typically use a set of methods to interact with smart contracts and other systems across different blockchain networks.
4. **Transaction and Data Management:** APIs for creating, signing, and submitting transactions to the blockchain network. They may also provide functionality for querying transaction status, retrieving transaction history, and managing data on the blockchain.
5. **Verifiable Credential :** APIs for managing user identities, permissions, and access controls on the blockchain network. Zetrix Verifiable Credential Certs and its API allow you to generate and digitally sign Verifiable Credentials.

The **endpoints for Zetrix BaaS API** for both mainnet and testnet are defined as

1. <https://api-sandbox.zetrix.com> (Zetrix Testnet)
2. <https://api-v2.zetrix.com> (Zetrix Mainnet)

Access to BaaS services requires users to register an account on [ZPlatform](/en/developer-resources/zplatform-baas-api.md).

#### Authorization

All API requests must include **both** the API Gateway key and the access token:

* **API Gateway Key:** Include in the header `X-API-Key`.
* **Access Token:** Include in the header `Authorization: Bearer <access_token>`.

#### Access Token

```http
Authorization : Bearer <ACCESS_TOKEN>
```

#### API Gateway Authentication

All requests to the Zetrix API Gateway **must** include the following header:

**Testnet**

```http
X-API-Key:ehg7q2i6aN8jY6BbHqN5q42KsHQFRwl260jqAkAU
```

**Mainnet**

```http
X-API-Key:OOXtr6biOR6eJa2Rjj9En4PwDxxl0U2haUohaxrC
```

**Example (curl)**

```bash
curl -X GET https://<api-endpoint> \
  -H "X-API-Key: ehg7q2i6aN8jY6BbHqN5q42KsHQFRwl260jqAkAU" \
  -H "Authorization: Bearer <your_access_token>" \
  -H "Content-Type: application/json"
```

**Notes**

* The `X-API-Key` header is **required** for all API Gateway requests.
* Requests without a valid API key will be rejected with an authorization error.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zetrix.com/en/developer-resources/blockchain-as-a-services-baas/zetrix-service.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
