# YouTube API for comments and posts

> Otobiz gives you one REST API for YouTube: 40 endpoints for comments and posts, called with one Bearer key.

Page: https://otobiz.ai/youtube-api

## Three steps to your first call

### Make an API key

In Otobiz, open API keys and make one. It acts with the role you pick, and is shown once. https://app.otobiz.ai/apikeys

```sh
# The key from Otobiz, under API keys
export OTOBIZ_API_KEY="otbz_..."

curl https://app.otobiz.ai/api/v1/account \
  -H "Authorization: Bearer $OTOBIZ_API_KEY"
```

### Connect YouTube by link

Ask for a connect link and open it. Nothing is connected until you finish the steps there.

```sh
# The answer carries "url": open it to connect YouTube
curl https://app.otobiz.ai/api/v1/connect-sessions \
  -H "Authorization: Bearer $OTOBIZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "kind": "youtube" }'
```

### Make one call

Every call is HTTPS and JSON, with the key as a Bearer token.

```sh
# Reply under a YouTube comment
curl https://app.otobiz.ai/api/v1/comments/$COMMENT_ID/reply \
  -H "Authorization: Bearer $OTOBIZ_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: comment-88" \
  -d '{ "content": { "kind": "text", "text": "Yes, it ships this week." } }'
```

## YouTube endpoints by job

40 endpoints work on YouTube, read from the API's own spec. Every path starts with https://app.otobiz.ai/api/v1.

### Posts (29)

| Method | Path | What it does |
|---|---|---|
| GET | `/account-groups` | List account groups |
| POST | `/account-groups` | Save an account group |
| PATCH | `/account-groups/{groupId}` | Change an account group |
| DELETE | `/account-groups/{groupId}` | Delete an account group |
| GET | `/posts` | List posts, newest first |
| POST | `/posts` | Save a post draft |
| POST | `/posts/bulk` | Create up to 25 posts in one call |
| POST | `/posts/import` | Import posts from a CSV file |
| GET | `/posts/imports` | List CSV imports of posts |
| GET | `/posts/imports/{postImportId}` | Get a CSV import of posts |
| GET | `/posts/options` | Get an account's publishing facts or choices |
| POST | `/posts/sync` | Check a post made on the platform by its link or id |
| POST | `/posts/validate` | Check a post against each account before posting |
| PATCH | `/posts/videos/{videoId}` | Change the details of a YouTube video made outside Otobiz |
| GET | `/posts/{postId}` | Get a post and its result on each account |
| PATCH | `/posts/{postId}` | Change a post draft, or a live post's recycling or id |
| DELETE | `/posts/{postId}` | Delete a post that never published |
| POST | `/posts/{postId}/approve` | Approve a post waiting for approval |
| POST | `/posts/{postId}/cancel` | Cancel a scheduled post |
| PATCH | `/posts/{postId}/copy` | Correct a published copy's text, pin it, or change a video's details |
| POST | `/posts/{postId}/publish` | Publish a post now or at a time, or move a scheduled post |
| POST | `/posts/{postId}/reject` | Reject a post waiting for approval |
| POST | `/posts/{postId}/unpublish` | Take one published copy down from its platform |
| GET | `/queues` | List an account's posting queues |
| POST | `/queues` | Make a named posting queue |
| GET | `/queues/next-slot` | Get an account's next free queue time |
| PATCH | `/queues/{id}` | Change a posting queue or make it the default |
| DELETE | `/queues/{id}` | Delete a posting queue |
| GET | `/queues/{id}/preview` | Preview a queue's next free times |

### Comments (11)

| Method | Path | What it does |
|---|---|---|
| GET | `/inbox/comments` | List comments on the brand's posts |
| POST | `/inbox/comments/bulk` | Hide, unhide or delete several comments at once |
| GET | `/inbox/comments/moderation/log` | List what the AI comment moderation flagged and did |
| GET | `/inbox/comments/posts` | List posts with their comment counts |
| POST | `/inbox/comments/posts/{postId}/like` | Like a post as a connected account |
| DELETE | `/inbox/comments/posts/{postId}/like` | Take a connected account's like off a post |
| GET | `/inbox/comments/{commentId}` | Get a comment and what can be done to it |
| PATCH | `/inbox/comments/{commentId}` | Update a comment |
| DELETE | `/inbox/comments/{commentId}` | Delete a comment from the platform |
| GET | `/inbox/comments/{commentId}/attachment` | A comment's picture, from our origin |
| POST | `/inbox/comments/{commentId}/reply` | Reply to a comment. Publicly, or privately as a direct message |

### On every channel

The same four jobs sit beside every channel's own endpoints.

| Method | Path | What it does |
|---|---|---|
| POST | `/connect/sessions` | Get the link where a brand member connects a channel, an app or a saved login |
| GET | `/connect/sessions/{sessionId}` | Where a connect link stands, or wait for it to finish |
| GET | `/connections` | List connections |
| POST | `/connections/{connectionId}/disconnect` | Disconnect one connection |
| GET | `/contacts` | List contacts |
| POST | `/contacts` | Create a contact |
| PATCH | `/contacts/{contactId}` | Update a contact |
| PATCH | `/contacts/{contactId}/consent` | Record a contact's marketing opt-in or opt-out |
| POST | `/files` | Add a file |
| GET | `/files/{fileId}` | Get a file |
| POST | `/webhooks/settings` | Register a webhook endpoint |
| POST | `/webhooks/test` | Send webhook_endpoint.tested to an endpoint |
| GET | `/webhooks/logs` | The webhook delivery log |

## What YouTube takes

- **Post text.** Up to 5,000 characters. Every post needs a file.
- **Post rules.** Each account's own rules come back from GET /posts/options, and POST /posts/validate checks a post before it goes.
- **Comment reply.** Up to 10,000 characters.

## What every call carries

- **Checked before it posts.** POST /posts/validate checks a post against each account. A post that breaks a rule answers 422.
- **Drafts first.** A new post is a draft. Nothing is published until you call publish, now or at a time.
- **No double posts.** Send an Idempotency-Key header and a retry is safe. The key is remembered for 24 hours.
- **Approval where you ask.** A reply from an AI agent's key waits for a reviewer and answers 202.
- **Keys with scopes.** A key acts with the role you pick, and a read-only key can look but never post.
- **Every reply recorded.** Each reply and post is recorded in Otobiz, with who or what sent it.

## What comes back

POST /inbox/comments/{commentId}/reply answers:

- 200: Replied

Event `comment.created`:

```json
{
  "id": "evt_00000000008008000000000000",
  "type": "comment.created",
  "apiVersion": "v1",
  "createdAt": "2026-10-09T09:30:00.000Z",
  "data": {
    "object": {
      "id": "cmt_01j2jxbb4pex5vsknk084sn04g",
      "channel": "youtube",
      "answered": false,
      "replyStatus": "none",
      "hidden": false,
      "isReply": false,
      "createdAt": "2026-11-18T09:30:00.000Z",
      "post": {
        "id": "pst_01j2jxbb4pex5vsknk084sn04h"
      }
    }
  }
}
```

A shortened sample from the API's own examples. The docs list every field.

```sh
# Register where the events go
curl https://app.otobiz.ai/api/v1/webhook-endpoints \
  -H "Authorization: Bearer $OTOBIZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "My server", "url": "https://example.com/otobiz", "events": ["comment.created"] }'
```

## Let an AI app do it

The same operations are tools on the Otobiz MCP server, so an AI app can work YouTube with no code.

You ask: "Which comments on our latest video still need an answer? Reply to them."

Your AI calls: `list_posts`, then `list_inbox_comments`, then `reply_to_inbox_comment`.

It lists the comments with no reply, answers each one as you, and every reply is recorded in Otobiz.

YouTube MCP server: https://otobiz.ai/youtube-mcp.md

## No fee per call. You pay for your plan.

YouTube comes with every plan. A call pays only for what it causes, such as a message sent. The API and the MCP server come with it. Plans: https://otobiz.ai/pricing

## Questions

### How do I use YouTube from an API?

Make an Otobiz API key, connect YouTube by link, then call the YouTube API's comments and posts endpoints with the key as a Bearer token.

### How do I connect YouTube to the API?

Call POST /api/v1/connect-sessions with the kind youtube. The answer carries a link: open it, finish the steps, and the channel is connected.

### Does the YouTube API cost extra?

No. There is no fee per call. You pay for the Otobiz plan that opens YouTube, and for what a call causes, such as a message sent.

### Can an AI app do this without code?

Yes. The Otobiz MCP server gives an AI app 39 YouTube tools, the same operations as the API, and you sign in from the app.

What Otobiz does on YouTube: https://otobiz.ai/connections/youtube

More: https://otobiz.ai/developers.md
