Guides

Work with an AI agent through the API

An AI agent is a normal user marked as an agent. It calls the API with a token, drafts posts and submits them. A person still approves, and the log shows which actions came from the agent.

6 steps About 5 minutes 29s

Watch it in a short video

Muted, with captions. 29 seconds.

Before you start

  • An agent user in your business, added to the workspace with the Editor role. Our team creates agent users, so email [email protected] to get one set up, then sign in as that agent.
  • A way to call HTTPS APIs: curl, a script, or an agent tool such as Claude Code or n8n.

Steps

  1. Step 1: Open API tokens

    Open API tokens from the main menu. Tokens let an agent or the mobile app call the API as the user who owns the token, so sign in as the agent user first. A token made while you are signed in as yourself would post as you. Without the web app, POST /api/v1/auth/tokens with the agent's email and password returns a token.

    The API tokens page with a name field and the list of active tokens
  2. Step 2: Create a token and copy it

    Enter a name such as "Claude Code agent" and click Create token. The token is shown once. Copy it into your agent tool, and treat it like a password. The picture blurs it.

    The new token panel with the token blurred and a Copy button
  3. Step 3: Check the agent user and its role

    Do this before creating the token. Our team creates the agent user. On the Team page it carries an agent label. Give the agent the Editor role in each workspace it needs: it can create and edit drafts and submit them, but cannot approve or publish.

    The Team page with a user labelled agent and the Editor role in one workspace
  4. Step 4: The agent submits a post

    The agent calls the API with its token. With submit: true the post lands in In review, labelled as created by an agent. The example below shows the request.

    The In review feed with a new post created by the agent
  5. Step 5: A person approves

    Open the post, check the caption and preview, and click Approve. A manager then schedules it. The Activity log shows the agent as the author and you as the approver.

    The agent post after approval, status Approved
  6. Step 6: Check the activity log

    Scroll to Activity. Every agent action carries the agent label, so you can always tell what the agent did and what a person did.

    The activity log with agent-labelled actions and one approval by a person

Example: an agent submits a post

curl -X POST https://app.pulseflowai.com/api/v1/workspaces/2/posts \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Roast day: agent draft",
    "caption": "Roast day is Thursday. Pre-order today and we will hold your bag.",
    "channelIds": [4, 5],
    "scheduledAt": "2026-10-23T09:00",
    "submit": true
  }'

scheduledAt without an offset is read in the workspace timezone. submit: true moves the post to In review. 2 is the workspace id and 4, 5 are channel ids; GET /api/v1/workspaces/2/channels lists yours.

Tips

  • Use one token per tool. If a tool is compromised, revoke only its token from the list.
  • Keep agents at Editor so they can draft and submit but not approve or schedule.
  • The API overview on the features page lists what agents can read and write.

Common questions

Can an agent publish without a person?

Not with the Editor role. Editors create, edit and submit. Approval needs a reviewer or manager, and scheduling needs a manager.

Where is the token after I close the page?

It is shown once and cannot be shown again. Create a new token and revoke the old one.

← All guides

Want this set up for your team?

We create your business, your first owner and your workspaces. Book a demo and tell us about your brands.

Cookies on this site

We use cookies that the site needs to work. With your permission we would also use analytics and marketing cookies. Nothing optional is loaded until you choose. Read the Cookie Policy.