Skip to main content
POST
/
api
/
public
/
v1
/
jobs
/
{id}
/
publish
curl -sS -X POST https://app.opentrain.ai/api/public/v1/jobs/<JOB_ID>/publish \
  -H "Authorization: Bearer $OT_API_TOKEN"
{
  "ok": true,
  "jobId": "<JOB_ID>",
  "status": "OPEN",
  "alreadyPublished": false,
  "jobUrl": "https://app.opentrain.ai/jobs/<JOB_ID>",
  "publishAttemptId": "<ATTEMPT_ID>",
  "warnings": [],
  "sideEffects": {
    "dispatched": true,
    "status": "queued"
  }
}
Takes a publishReady draft live on the marketplace. The final step of the posting loop: creategap-fill → publish. Idempotent — publishing an already-open job returns 200 with alreadyPublished: true. Every publish passes content moderation, and accounts have a daily publish limit (20/day claimed, 3/day unclaimed). A draft that is not publish-ready is rejected with the same validation detail the draft endpoints return — go back and patch the missing fields. Requirements: jobs:write scope + the public_api_job_publishing feature (check capabilitiescapabilities.publish). Works pre-claim within the lower daily limit.

Request

id
string
required
The draft job ID.
No body.

Response

ok
boolean
true on success.
jobId
string
The job ID.
status
string
OPEN — the job is live.
alreadyPublished
boolean
true when the job was already open (no-op).
jobUrl
string
Public listing URL.
publishAttemptId
string | null
Internal attempt identifier for support/audit, when available.
warnings
string[]
Non-blocking warnings (e.g. fields worth improving).
sideEffects
object
{dispatched, status} — whether post-publish side effects (distribution, notifications) were kicked off.

Errors

StatuscodeMeaning
400BAD_REQUESTDraft is not publish-ready — details.validation carries the same missingFields/issues shape as the draft endpoints
401UNAUTHORIZEDMissing or invalid token
403FORBIDDENMissing scope, feature disabled, or moderation block (details.reason: "moderation_blocked" with details.reasons[])
404NOT_FOUNDNo such job, or not yours
429RATE_LIMITEDDaily publish limit reached — details carries {limit, windowHours: 24}
curl -sS -X POST https://app.opentrain.ai/api/public/v1/jobs/<JOB_ID>/publish \
  -H "Authorization: Bearer $OT_API_TOKEN"
{
  "ok": true,
  "jobId": "<JOB_ID>",
  "status": "OPEN",
  "alreadyPublished": false,
  "jobUrl": "https://app.opentrain.ai/jobs/<JOB_ID>",
  "publishAttemptId": "<ATTEMPT_ID>",
  "warnings": [],
  "sideEffects": {
    "dispatched": true,
    "status": "queued"
  }
}