# Use the API

Call the flayr v2 API with an API key: one curl example, and the generic HTTP step for automation tools such as n8n, Zapier and Make. For scripts and tools that connect without MCP or an AI agent.

Check your key, create a draft with one request, then do the same from an automation tool.

## Check your key

Every request sends your API key in the Authorization header.

null

1. Create an API key

Open Developers, then API Keys. The steps are in Connect your AI agent. Read + Write is enough for this tutorial.

2. Call ping

Run this in a terminal, with your key in place of flayr_sk_YOUR_KEY.

## Create a draft with curl

One request creates a draft in flayr. Nothing is posted.

null

1. Send the request

It creates a draft with the text you send.

2. Check the answer

A working request answers HTTP 201 with the id of the draft. The draft is saved in flayr. Nothing was posted.

## n8n, Zapier, Make and other automation tools

Automation tools call the same API through their generic HTTP or webhook step.

null

1. Add the HTTP step

In n8n it is the HTTP Request node. In Zapier it is Webhooks by Zapier. In Make it is HTTP, Make a request. Any tool with a generic HTTP step works the same way.

2. Add your key as a header

Use the name and the value below, with your key in place of flayr_sk_YOUR_KEY.

3. Check it with a GET

Set the method to GET, paste the URL and run the step. A working key answers "authenticated": true.

4. Create a draft with a POST

Set the method to POST and the body type to JSON, then paste the URL and the body. Run the step. The answer shows "status": "draft". Nothing is posted.

5. Field names for your tool

The exact field names for n8n, Zapier and Make are in the agent reference.

## Reference and webhooks

Where to look up every endpoint, and how flayr can call your tool.

null

1. Open the API reference

Every endpoint of the v2 API is in the public reference.

2. Let flayr call your tool

To hear about events as they happen, add a webhook in Developers, under Webhooks.
