Connect an OpenAI Ads account
Connect an OpenAI Ads account using an API key from ChatGPT Ads Manager.
The key grants full campaign write access on OpenAI's side (OpenAI does not offer a read-only key scope). Zernio uses it to read ads and performance, and to create and manage campaigns you set up through Zernio (create, status, budget, and cancel). Campaigns created directly in ChatGPT Ads Manager can still be managed there.
API key authentication - use your Zernio API key as a Bearer token
In: header
API key from ChatGPT Ads Manager (Settings). Grants full read/write access on OpenAI's side; Zernio only ever reads with it.
Your Zernio profile ID
Optional state passthrough for the connect flow.
Optional URL to redirect to after successful connection
uriResponse Body
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.connect.connectOpenAIAdsCredentials({ body: { apiKey: 'tok_abc123', profileId: 'profile_abc123', },});console.log(data);{
"accountId": "6507a1b2c3d4e5f6a7b8c9d0",
"adAccountName": "Acme US"
}{
"error": "string",
"type": "invalid_request_error",
"code": "string",
"param": "string",
"platform": "string",
"platformError": {},
"details": {}
}Set default YouTube playlist PUT
Sets the default playlist used when publishing videos for this account. When a post does not specify a playlistId, the default playlist is not automatically used (it is stored for client-side convenience).
List posts GET
Returns a paginated list of posts. Published posts include platformPostUrl with the public URL on each platform.