Skip to main content
POST
/
mahoraga
/
jobs
Créer un Job
curl --request POST \
  --url https://apiserver.a-elmediri.workers.dev/mahoraga/jobs \
  --header 'Content-Type: application/json' \
  --data '
{
  "workflow_id": "550e8400-e29b-41d4-a716-446655440000",
  "input_params": {
    "prompt": {
      "type": "string",
      "value": "a cat in space",
      "node_mappings": "API - PROMPT"
    },
    "aspect_ratio": {
      "type": "string",
      "value": "1:1",
      "node_mappings": "aspect_ratio"
    },
    "resolution": {
      "type": "string",
      "value": "1K",
      "node_mappings": "image_size"
    },
    "batch_size": {
      "type": "integer",
      "value": 1,
      "node_mappings": ""
    }
  },
  "from_origin": "frontend",
  "requested_by": "user-123",
  "priority": 0,
  "metadata": {
    "callback_url": "https://your-server.com/webhook",
    "callback_secret": "your-secret-key"
  },
  "datasets": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
'
{
  "job": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "status": "QUEUE",
    "priority": 0,
    "input_params": {},
    "output": {},
    "error": "<string>",
    "from_origin": "<string>",
    "requested_by": "<string>",
    "metadata": {},
    "created_at": "2023-11-07T05:31:56Z",
    "started_at": "2023-11-07T05:31:56Z",
    "completed_at": "2023-11-07T05:31:56Z"
  }
}

Body

application/json
workflow_id
string<uuid>
required

ID du workflow à exécuter (référence oksi-workflows)

Example:

"550e8400-e29b-41d4-a716-446655440000"

input_params
object
required

Paramètres de génération envoyés au provider

Example:
{
"prompt": {
"type": "string",
"value": "a cat in space",
"node_mappings": "API - PROMPT"
},
"aspect_ratio": {
"type": "string",
"value": "1:1",
"node_mappings": "aspect_ratio"
},
"resolution": {
"type": "string",
"value": "1K",
"node_mappings": "image_size"
},
"batch_size": {
"type": "integer",
"value": 1,
"node_mappings": ""
}
}
from_origin
string
required

Origine de la requête

Example:

"frontend"

requested_by
string
required

Identifiant du demandeur (user ID, API key, etc.)

Example:

"user-123"

priority
integer
default:0

Priorité du job (0 = normal, plus haut = plus urgent)

Example:

0

metadata
object

Données annexes : webhook, billing, tracking

Example:
{
"callback_url": "https://your-server.com/webhook",
"callback_secret": "your-secret-key"
}
datasets
string<uuid> | null

ID d'un dataset (référence oksi-datasets). Si fourni, les images du dataset sont envoyées en entrée au provider (ex: Google AI Studio utilise jusqu'à 3 images aléatoires du dataset comme référence visuelle).

Example:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

Response

Job créé avec succès

job
object