---
agentTools:
  projectIndex: https://zenfi.readme.io/llms.txt
---

# ⚡️ Getting started

Welcome Zenfi's developers portal.

Our Partners API is very limited at this moment but **we move really fast and we would like to collaborate with you**. Just, drop us a line: <dev@zenfi.mx>.

## Who's this API for?

This API is currently intended for Partners, not Users. That means, we are **not** allowing programatic access for individual accounts. Instead we are focusing on:

* **Sending referrals** (users) to commercial partners.
* Making users **registration** process **easier**.
* Collaboration with partners to **bring users** from their platforms **to Zenfi**.

## GraphAPI

Our API uses [GraphQL](https://graphql.org/), we believe it provides clearer communication between us and our clients and makes building easier for developers. Hope you like it! :purple-heart:

## Using the API

To start using Zenfi's API make sure you read the [Authentication guide](https://zenfi.readme.io/docs/authentication) first, then you can start making request.

Zenfi uses a GraphQL protocol for its API. If really easy to get started, or check [this guide](https://graphql.org/learn/serving-over-http/) if you are not familiar yet.

For example, make the following request to get data about the authorized developer (your account):

[block:code]
{
  "codes": [
    {
      "code": "const url = 'https://api.zenfi.mx/partners/graphql';\nconst apiKey = 'MY_SECURE_API_KEY';\n\nconst query = `\n  query {\n    viewer {\n      id\n      name\n    }\n  }\n`;\n\nconst response = await fetch(url, {\n  method: 'POST',\n  headers: {\n    'Content-Type': 'application/json',\n    'Authorization': `Bearer ${apiKey}`\n  },\n  body: JSON.stringify({\n    query\n  }),\n});\n\nconsole.log(await response.json());",
      "language": "javascript"
    },
    {
      "code": "require 'httparty'\nrequire 'json'\n\n@url = 'https://api.zenfi.mx/partners/graphql';\n@apiKey = 'MY_SECURE_API_KEY';\n\n@query = <<-GRAPHQL\n  query {\n    viewer {\n      id\n      name\n    }\n  }\nGRAPHQL;\n\n@result = HTTParty.post(@url,\n  headers: {\n    'Content-Type' => 'application/json',\n    'Authorization' => \"Bearer #{@apiKey}\"\n  },\n  body: {\n    query: @query\n  }.to_json\n);\n\nputs(@result)",
      "language": "ruby"
    }
  ]
}
[/block]

After you succeed with this request, you can check our full GraphAPI documentation [here](/graphql), or using any other recommended tool such [GraphQL Playground](https://github.com/graphql/graphql-playground) or [Apollo Studio](https://www.apollographql.com/docs/studio/), getting the schema from the introspection endpoint.

## Environments

Our API has only one environment (*yet*).

**Production:**

* Schema (no authentication required): `GET https://api.zenfi.mx/partners/graphql/introspect`.
* GraphAPI: `GET https://api.zenfi.mx/partners/graphql`