---
title: "OpenaiAdsApiKey: Create auth"
method: POST
path: "/auth/openai-ads-api-key"
tags: ["Auths"]
---

# OpenaiAdsApiKey: Create auth

`POST /auth/openai-ads-api-key`

## Request

- Base URL: `https://api.lytics.io/v2`
- URL: `https://api.lytics.io/v2/auth/openai-ads-api-key`
- Auth: API key in header `Authorization`

Create a OpenaiAdsApiKey auth

## Query parameters

- `account_id` string

## Request body `*/*`

- object
  - `account_id` string: Lytics Account ID
  - `config` object, required: The type-specific configuration for the authorization
    - `api_key` string: #nosec G117 -- field holds the OpenAI Ads API key, not a leaked credential
  - `description` string: A client-defined description for the authorization
  - `label` string, required: A client-defined label for the authorization
  - `provider_id` string: The authorization's provider ID
  - `provider_slug` string: The authorization's provider slug
  - `type` string: The auth type. Providers may have one or more auth types
  - `user_id` string: The user ID that created or updated the authorization

## Response `201`

Authorization Response

- object
  - `_meta` object: Response Metadata
  - `data` object: Response Payload
    - `account_id` string: Lytics Account ID
    - `alert_enabled` boolean: Whether expiry alerts are enabled for this Lytics API token; nil for non-token auths
    - `created` string
    - `description` string: A client-defined description for the authorization
    - `expires` string: Date this auth expires, if non-zero
    - `id` string: A Lytics-assigned, immutable unique ID for the Authorization
    - `internal` boolean: Indicates a system-generated auth rather than a user-initiated one
    - `label` string: A client-defined label for the authorization
    - `last_accessed_at` string: Last accessed time for the lytics api_key
    - `provider_id` string: The authorization's provider ID
    - `provider_slug` string: The authorization's provider slug
    - `scopes` string[]: Scopes granted to a Lytics API token
    - `status` 'healthy' | 'unhealthy' | 'unknown': Indicates the health status of auth
    - `ttl` string: TTL from the create date for a Lytics API token
    - `type` string: The auth type. Providers may have one or more auth types
    - `unhealthy` boolean: Indicates the authorization credentials are unusable
    - `updated` string
    - `user_id` string: The user ID that created or updated the authorization
  - `request_id` string
  - `status` integer: HTTP Status Code

## Other responses

- `404`: Not Found
- `500`: Internal Server Error

## Changes

- **2026-11-03** `d8e975057aec`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/lytics/apis/lytics-api/changes/auth/openai-ads-api-key/post.md)

---

[API](https://skmtc.dev/lytics/apis/lytics-api.md) - [All operations](https://skmtc.dev/lytics/apis/lytics-api/llms.txt) - [OpenAPI document](https://skmtc.dev/lytics/apis/lytics-api/revisions/d8e975057aec?raw)
