AI

Embed
Preview of the card
<a href="https://indrava.forumulate.com/docs/ref-ai"><img src="https://indrava.forumulate.com/docs/_api/public/orgs/e421ace4-3e78-4ed8-9818-7b4899cf3aa0/spaces/2bcc7f09-4489-40af-85d8-9fdd3f3da314/pages/8162fa1c-ee6e-4cfe-8fab-733eb3461516/social-card.svg?v=3e7ae33eec8b" alt="AI" width="600" height="315"></a>
POST http://localhost:4000/api/v1/ai/draft

Write a post from a brief, a text or a web page

Without channelIds one generic post is written. With autoHashtag hashtags are added at hashtagPosition (hashtagCount 1 to 10). The result is not saved: use POST /posts with action: draft.

Request body

application/json
brief
string
text
string
url
string
channelIds
string[]
= []
thread
boolean
= false
autoHashtag
boolean
= false
hashtagCount
integer
= 5
hashtagPosition
string
end | start = end
{
  "brief": "string",
  "text": "string",
  "url": "string",
  "channelIds": [],
  "thread": false,
  "autoHashtag": false,
  "hashtagCount": 5,
  "hashtagPosition": "end"
}

Code samples

cURL
curl -X POST "http://localhost:4000/api/v1/ai/draft" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"brief":"string","text":"string","url":"string","channelIds":[],"thread":false,"autoHashtag":false,"hashtagCount":5,"hashtagPosition":"end"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
Example
{}
Option 1
{}
Option 2
{}
POST http://localhost:4000/api/v1/ai/rewrite

Change a post, or a passage of it, by any instruction

instruction is free text ('make it funnier'). With selection only that passage changes and the rest comes back as it was. command also applies the member's standing instruction for that built-in command.

Request body

application/json
text
string
required
selection
string
instruction
string
required
command
string
rewrite | shorten | expand | tone | grammar | translate | continue | spintax | hook | hashtags | draft
channelId
string
{
  "text": "string",
  "selection": "string",
  "instruction": "string",
  "command": "rewrite",
  "channelId": "string"
}

Code samples

cURL
curl -X POST "http://localhost:4000/api/v1/ai/rewrite" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"string","selection":"string","instruction":"string","command":"rewrite","channelId":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
Example
{}
Option 1
{}
Option 2
{}
POST http://localhost:4000/api/v1/ai/translate

Translate a post into one or more languages

Tone, links and mentions are kept; with channelId each result fits that channel's limit.

Request body

application/json
text
string
required
languages
string[]
required
channelId
string
{
  "text": "string",
  "languages": [
    "string"
  ],
  "channelId": "string"
}

Code samples

cURL
curl -X POST "http://localhost:4000/api/v1/ai/translate" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"string","languages":["string"],"channelId":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
Example
{}
Option 1
{}
Option 2
{}
POST http://localhost:4000/api/v1/ai/hashtags

Suggest hashtags for a post

max 1 to 10. position says where text would carry them (end or start); withHashtags is the text with them placed. With mediaIds and a vision-capable model the pictures are read too.

Request body

application/json
text
string
required
max
integer
= 5
position
string
end | start = end
mediaIds
string[]
= []
{
  "text": "string",
  "max": 5,
  "position": "end",
  "mediaIds": []
}

Code samples

cURL
curl -X POST "http://localhost:4000/api/v1/ai/hashtags" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"string","max":5,"position":"end","mediaIds":[]}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
Example
{}
Option 1
{}
Option 2
{}
POST http://localhost:4000/api/v1/ai/alt-text

Write alt text for pictures in the media library

One entry per picture; files that are not pictures the model reads are left out.

Request body

application/json
mediaIds
string[]
required
postText
string
{
  "mediaIds": [
    "string"
  ],
  "postText": "string"
}

Code samples

cURL
curl -X POST "http://localhost:4000/api/v1/ai/alt-text" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mediaIds":["string"],"postText":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
Example
{}
Option 1
{}
Option 2
{}
POST http://localhost:4000/api/v1/ai/transcribe

Transcribe an audio or video file

data is the file in base64 (25 MB at most). Needs a transcription service on the server.

Request body

application/json
name
string
required
mime
string
required
data
string
required
language
string
{
  "name": "string",
  "mime": "string",
  "data": "string",
  "language": "string"
}

Code samples

cURL
curl -X POST "http://localhost:4000/api/v1/ai/transcribe" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","mime":"string","data":"string","language":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
Example
{}
Option 1
{}
Option 2
{}
POST http://localhost:4000/api/v1/ai/check

Check a text for harmful content

Flags hate, harassment, sexual, violence and self-harm, each with a reason when flagged. The workspace's rule checks are part of POST /posts/validate.

Request body

application/json
text
string
required
{
  "text": "string"
}

Code samples

cURL
curl -X POST "http://localhost:4000/api/v1/ai/check" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
Example
{}
Option 1
{}
Option 2
{}
POST http://localhost:4000/api/v1/ai/score

Predict how a draft will engage on a channel

score is 0 to 100 (50 = an average post of that channel). basis is history when the channel's own past posts were enough, else ai with lowData. reasons are the two main ones.

Request body

application/json
text
string
required
channelId
string
required
at
string
mediaIds
string[]
= []
{
  "text": "string",
  "channelId": "string",
  "at": "2024-01-01T00:00:00Z",
  "mediaIds": []
}

Code samples

cURL
curl -X POST "http://localhost:4000/api/v1/ai/score" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"string","channelId":"string","at":"2024-01-01T00:00:00Z","mediaIds":[]}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
Example
{}
Option 1
{}
Option 2
{}
Updated