POST
/
v1
/
jobs
/
ai-content
/
custom
Generate Customized AI Content
curl --request POST \
  --url https://api.tryhamsa.com/v1/jobs/ai-content/custom \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "aiParts": [
    {
      "aiPart": "<string>",
      "language": "ar",
      "prompt": "<string>"
    }
  ],
  "webhookUrl": "<string>",
  "webhookAuth": {
    "authKey": "Token",
    "authSecret": "Secret"
  }
}'
{
  "success": false,
  "message": "success",
  "data": {
    "id": "<string>",
    "title": "<string>",
    "model": "<string>",
    "type": "AI_CONTENT",
    "processingType": "<string>",
    "webhookUrl": "<string>",
    "totalCost": 123,
    "usageTime": "<string>",
    "mediaUrl": "<string>",
    "jobResponse": null,
    "status": "PENDING",
    "relevantJobId": "<string>",
    "apiKeyId": "<string>",
    "billingId": "<string>",
    "userId": "<string>",
    "systemModelKey": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Pass the API key in the Authorization header, You need to put Token keyword before the API key. e.g. 'Authorization: Token <api-key>'

Query Parameters

jobId
string
required

Body

application/json

Parameters for generating AI content.

aiParts
object[]
required

The AI parts to generate content for. AI parts array should have at least one AI part object, with an aiPart (title), the language to return the content for the part in, and the prompt to use.

webhookUrl
string<uri> | null
webhookAuth
object

Authorization header to be sent in this format: Authorization: [authKey] [authSecret]

Response

Successful response

success
boolean
default:false
message
string
default:success
data
object