Skip to navigation

Authentication

Every request carries your key as a bearer token.

Authorization: Bearer pk_live_xxxxxxxxxxxxxxxxxxxx
curl https://api-chat.parstechai.com/v1/robots \
-H "Authorization: Bearer pk_live_xxxxxxxxxxxxxxxxxxxx"

Remember that your API key is a secret. Do not share it or expose it in client-side code.

One key, all your robots

You get one key per account, and it spans every robot you own. There is no per-robot key and no per-customer key.

Where you get itYou create it yourself in the panel: see Get your API key
Comes withA plan that includes API access, or an active free trial
ShownOnce, at creation
Stored by usAn HMAC only
ExpiryYou choose 1, 3, 6 or 12 months when you create it

A lost key is rotated, not recovered. Because we store only an HMAC, we cannot show you the key again. Put it in your secret manager the moment you receive it.

Get your API key

You create the key yourself, in the ParsChat panel. It takes a minute.

1

Sign in

Go to chat.parstechai.com and sign in with the account that owns your robots.

2

Open your account

Click the profile icon at the end of the top bar (top-left in the Persian panel, top-right in English) and choose Profile.

The profile menu, open, with Profile, Contact Support and Exit

The profile menu
3

Open Access keys & webhook

Open the Access keys & webhook tab. Before you have a key, the table is empty.

The Access keys & webhook tab, with the Create API key button

Access keys & webhook, before a key exists
4

Create the key

Click Create API key, choose how long the key stays valid (1, 3, 6 or 12 months) and click Confirm and generate key.

The Create API key dialog with the validity selector

Create API key
5

Copy the key now

The key appears once, in the form pk_live_ followed by random characters. Click Copy key, store it in your secret manager, and only then click I copied and saved the key. When you close this window the key cannot be shown again.

The new key shown once, with a Copy key button

The key is shown once
6

Check the table

The key now appears in the table with its service name, a preview such as pk_live_••••x7Kq, its creation and expiry dates, and its status.

The key table with one active key and a delete icon

Your key in the table

The images show a placeholder key. Your own key is different, and you should never share it.

Who can create a key. Key creation needs a plan that includes API access, or an active free trial. During a free trial the key works for the robot, usage and webhook endpoints; the Instagram endpoints need an Instagram API plan. If neither applies, the panel says “API access has not been enabled for your account” and Create API key stays disabled. When a free trial ends without such a plan, the key answers 403.

Rotate or revoke a key

An account holds one key, so Create API key is disabled while a key exists.

  1. In the key’s row, click the delete icon and confirm with Delete. The key stops working immediately, and every integration that uses it receives 401.
  2. Click Create API key again and copy the new key as above.
  3. Put the new key into your integration.

Do this when a key leaks, when it is about to expire, or when someone who knew it leaves your team.

Set your webhook

On the same tab, Webhook delivery shows the address that receives your events, with a copy button.

The Edit webhook dialog with the webhook address and Deliver events toggle

Edit webhook
  1. Click Set address (or Edit webhook once an address exists).
  2. Enter your Webhook address. We send events to it as POST requests, so it must be a public address.
  3. Optionally, turn Deliver events off to pause deliveries. Turn it back on to resume.
  4. Optionally, click Add header to add Custom headers that we attach to every delivery. Header values are never shown again after you save. When you save headers, the list you enter replaces all current headers, so enter every header’s value. See Webhook events.
  5. Click Save.

The first time you save, the panel shows your Webhook signing secret once. Copy it: you use it to verify the X-ParsChat-Signature header on every delivery. To replace it later, turn on Generate a new signing secret when you edit the webhook. The old secret stops working at once.

Setting the webhook also needs API access, as for the key.

What a key can and cannot do

A key acts inside your account. It cannot change where your data goes.

With your keyPanel only
Create and delete robots✅
Connect and disconnect channels✅
Enable and disable channels✅
Reply to conversations and upload files✅
Manage automation rules✅
Read usage✅
Read your webhook configuration✅
Change the webhook URL🔒
Set the custom webhook headers🔒
Create, revoke or rotate a key (and set its expiry)🔒
Change the return URLcontact us

That split is the point. If your key leaks, the attacker can read and act inside your account, and you should rotate immediately. They cannot redirect your event stream to an endpoint of their own, because that requires a panel login, which is a different and stronger credential. In the table, 🔒 means you do it in the panel: Profile → Access keys & webhook.

Access comes from a role

Robot creation and Instagram access are not properties of the key. They are granted on your account and checked on every request. To get access to either, contact our sales team.

Access can therefore be granted or revoked without touching your key. You do not re-integrate when your contract changes.

A 403 on a call that should work is usually a missing role. A 401 is the key itself: wrong, revoked, or expired.

Two URLs, and what each is for

What it isDirection
Webhook URLYour endpoint that receives eventsus → your server
Return URLYour page a customer’s browser lands on after authorising Instagrambrowser → your site

You set the webhook URL yourself, in the panel under Profile → Access keys & webhook. There is no API for it: a writable endpoint would turn a stolen key into a way to redirect your entire event stream.

The return URL is the one thing you give us. Send it to your ParsChat contact and we configure it.

They are different things and both are needed. The webhook URL is server-to-server. The return URL is where a real customer’s browser goes mid-signup.

Tell us your return URL before your first Instagram connection. Without one configured, the handshake sends your customer to our dashboard: a screen they have never seen, on a product they believe is yours.

What you set in the panel

Four things live in your ParsChat panel, under Profile → Access keys & webhook, rather than in this API:

API keyCreate it, copy it once, and revoke it to rotate. You choose its expiry
Webhook URLWhere we POST your events
Custom headersHeaders we send to you with every event, so your endpoint or gateway can recognise the request as ours
Webhook signing secretShown once when you first save the webhook. Use it to verify X-ParsChat-Signature

Custom headers are worth being precise about, because they point the opposite way to the key. Your API key authenticates you to us. Custom headers authenticate us to you: you choose the values, we store them, and we attach them to every event we deliver to your webhook URL, every chat and message event included. Your endpoint checks them and rejects anything without them. See Webhook events.

Why the difference

The return URL decides where a person’s browser is sent, so a writable endpoint would turn a stolen key into an open-redirect and phishing tool. The webhook URL and the custom headers only affect your own infrastructure, so you own both, behind a panel login, which is a stronger credential than an API key.