---
title: "Task Onboard Creator"
method: POST
path: "/api/tasks/onboard-creator"
tags: ["Tasks", "Tasks"]
---

# Task Onboard Creator

`POST /api/tasks/onboard-creator`

Run the full onboard_creator() pipeline for one user.

Triggered by a Cloud Task created in services.onboarding_dispatcher.enqueue_onboarding(),
which fires from the OAuth callback at routes.dashboard_auth_routes.oauth_callback
after the youtube_channels INSERT.

Always calls mark_onboarding_complete (success=True or False) so the
safety-net row in onboarding_queue is cleared and the nightly cron does
not re-run this user. If THIS endpoint fails entirely (raises before
reaching mark_onboarding_complete), nightly-processing will pick up the
still-pending row at 01:00 UTC.

## Headers

- `x-cloudscheduler-secret` string, nullable
- `x-scheduler-secret` string, nullable
- `authorization` string, nullable

## Request body

- OnboardCreatorRequest — Body for /api/tasks/onboard-creator. Sent by services.onboarding_dispatcher when a Cloud Task fires after OAuth signup. Tokens are passed live so the handler doesn't need to hit user_credentials again (which would race the OAuth callback's commit).
  - `user_id` integer, required
  - `access_token` string, required
  - `refresh_token` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `401` — Unauthorized
- `422` — Validation Error
- `500` — Internal Server Error

---

[API](https://skmtc.dev/primetime/apis/primetime-media-api.md) · [All operations](https://skmtc.dev/primetime/apis/primetime-media-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/primetime/primetime-media-api/revisions/9da9a9f64e11/schema)
