API reference

API reference

The Koast REST API. Every brand-scoped resource lives under /v1/brands/{brandId}. Lists are cursor-paginated, errors share one envelope, and every response carries a Koast-Request-Id header.

The Koast REST API. Every brand-scoped resource lives under /v1/brands/{brandId}. Lists are cursor-paginated, errors share one envelope, and every response carries a Koast-Request-Id header.

Generated from the OpenAPI document of Koast API version 1.0.0.

Conventions

Base URL

Send every request to https://api.koast.ai/v1. The paths on these pages include the /v1 prefix.

Authentication

Send Authorization: Bearer <token> on every request. An organization API key (koast_sk_…) with the API surface enabled, or an OAuth access token issued by Koast (koast_at_…) whose audience covers this API. REST access requires an active Agency plan.

Request headers

HeaderDescription
Idempotency-KeyRetrying with the same key within 24 hours returns the first response without acting again. Required on edit-live-campaign, launch-campaign, optional on 32 other operations.

Response headers

HeaderTypeDescription
Koast-Request-IdstringUnique id of this request; quote it to support.
RateLimit-LimitintegerRequests allowed per minute for this organization in this bucket (read or write).
RateLimit-RemainingintegerRequests left in the current window.
RateLimit-ResetintegerSeconds until the window resets.
Retry-AfterintegerSeconds to wait before retrying.

Errors

Every error response has the same JSON body.

FieldTypeRequiredDescription
errorobjectYes
error.codestringYesStable machine-readable code. One of unauthenticated, plan_required, surface_disabled, audience_mismatch, insufficient_scope, brand_not_allowed, validation_failed, not_found, capability_unsupported, spend_ceiling_exceeded, spend_ceiling_required, forbidden, rate_limited, idempotency_conflict, idempotency_key_required, stale_read, conflict, unprocessable, account_ambiguous, unavailable, webhooks_unavailable, timeout, internal_error.
error.messagestringYes
error.detailsobject[] | object | nullYesField-level issues for validation_failed; otherwise extra context or null.
error.requestIdstringYesSame value as the Koast-Request-Id header.
{
  "error": {
    "code": "unauthenticated",
    "message": "string",
    "details": [
      {
        "field": "string",
        "message": "string",
        "code": "string"
      }
    ],
    "requestId": "string"
  }
}
StatusMeaning
400The input failed validation (validation_failed) or a required header is missing (idempotency_key_required).
401Missing, unknown, revoked or expired credential.
403The credential is not allowed to do this: insufficient_scope (missing read/write/publish scope), brand_not_allowed (outside the key's brand list), forbidden (no access to the brand, launch or account), plan_required, surface_disabled, spend_ceiling_required, spend_ceiling_exceeded.
404The resource does not exist or is not visible to this credential.
409idempotency_conflict (the Idempotency-Key was reused with a different request or is still in flight), stale_read (the resource changed since it was read) or conflict (the request conflicts with the resource's current state, such as a live node, a concurrent edit or a racing secret rotation).
422The request is valid but cannot be carried out (capability_unsupported, account_ambiguous).
429Rate limit or concurrency limit reached.
500Unexpected failure.
503A dependency is not available right now (unavailable), or webhooks are not available in this environment (webhooks_unavailable).
504The request did not finish in time. A write may still complete; retry with the same Idempotency-Key.

Pagination

12 list operations are cursor-paginated and take these query parameters.

ParameterTypeDescription
cursorstringOpaque cursor from the previous page's nextCursor. Omit for the first page.
limitintegerPage size. Default 50. Minimum 1, maximum 100.

The response carries nextCursor. Pass as cursor to read the next page. Null when there is no next page.

Operations

Activity

OperationMethodPath
Get team activity logGET/v1/brands/{brandId}/activity

Ad Accounts

OperationMethodPath
List ad account campaignsGET/v1/brands/{brandId}/ad-accounts/{accountId}/campaigns
List lead formsGET/v1/brands/{brandId}/ad-accounts/{accountId}/lead-forms
Get account naming conventionGET/v1/brands/{brandId}/ad-accounts/{accountId}/naming-convention
Get asset and targeting optionsGET/v1/brands/{brandId}/ad-accounts/{accountId}/options
Get account overviewGET/v1/brands/{brandId}/ad-accounts/{accountId}/overview

Automations

OperationMethodPath
List automationsGET/v1/brands/{brandId}/automations
Save automationPOST/v1/brands/{brandId}/automations
Get automationGET/v1/brands/{brandId}/automations/{automationId}
Delete automationDELETE/v1/brands/{brandId}/automations/{automationId}
Set automation statusPATCH/v1/brands/{brandId}/automations/{automationId}/status

Brands

OperationMethodPath
List my ad accountsGET/v1/brands

Copies

OperationMethodPath
Generate ad copyPOST/v1/brands/{brandId}/copies
Get generated ad copyGET/v1/brands/{brandId}/copies/{copyId}

Creatives

OperationMethodPath
List creativesGET/v1/brands/{brandId}/creatives
Upload creativePOST/v1/brands/{brandId}/creatives

Integrations

OperationMethodPath
Connect ClickFlarePOST/v1/brands/{brandId}/integrations/clickflare
Disconnect ClickFlareDELETE/v1/brands/{brandId}/integrations/clickflare
List ClickFlare campaign mappingsGET/v1/brands/{brandId}/integrations/clickflare/mappings
Update ClickFlare campaign mappingPUT/v1/brands/{brandId}/integrations/clickflare/mappings/{providerCampaignId}
Get ClickFlare spend pushGET/v1/brands/{brandId}/integrations/clickflare/push
Update ClickFlare spend pushPUT/v1/brands/{brandId}/integrations/clickflare/push
Get ClickFlare settingsGET/v1/brands/{brandId}/integrations/clickflare/settings
Update ClickFlare settingsPATCH/v1/brands/{brandId}/integrations/clickflare/settings
List RedTrack campaign mappingsGET/v1/brands/{brandId}/integrations/redtrack/mappings
Update RedTrack campaign mappingPUT/v1/brands/{brandId}/integrations/redtrack/mappings/{providerCampaignId}
Get RedTrack spend pushGET/v1/brands/{brandId}/integrations/redtrack/push
Update RedTrack spend pushPUT/v1/brands/{brandId}/integrations/redtrack/push

Launches

OperationMethodPath
List Koast batchesGET/v1/brands/{brandId}/launches
Create campaign launchPOST/v1/brands/{brandId}/launches
Clone live campaignPOST/v1/brands/{brandId}/launches/clone
Import live campaignPOST/v1/brands/{brandId}/launches/import
Delete batch or pipeline cardDELETE/v1/brands/{brandId}/launches/{launchId}
Add ad setPOST/v1/brands/{brandId}/launches/{launchId}/ad-sets
Get ad set detailsGET/v1/brands/{brandId}/launches/{launchId}/ad-sets/{adsetId}
Swap creativesPOST/v1/brands/{brandId}/launches/{launchId}/ad-sets/{adsetNodeId}/creatives/swap
Attach lead formPOST/v1/brands/{brandId}/launches/{launchId}/ad-sets/{adsetNodeId}/lead-form
Add adsPOST/v1/brands/{brandId}/launches/{launchId}/ads
Get ad detailsGET/v1/brands/{brandId}/launches/{launchId}/ads/{adId}
Add campaignPOST/v1/brands/{brandId}/launches/{launchId}/campaigns
Import campaignsPOST/v1/brands/{brandId}/launches/{launchId}/campaigns/import
Compute creative fatigueGET/v1/brands/{brandId}/launches/{launchId}/creative-fatigue
Distribute creativePOST/v1/brands/{brandId}/launches/{launchId}/creatives/distribute
Get ad delivery statusGET/v1/brands/{brandId}/launches/{launchId}/delivery-status
Get daily insightsGET/v1/brands/{brandId}/launches/{launchId}/insights/daily
Get metricsGET/v1/brands/{brandId}/launches/{launchId}/metrics
Remove items from campaign treePOST/v1/brands/{brandId}/launches/{launchId}/nodes/remove
Update campaign, ad set or adPATCH/v1/brands/{brandId}/launches/{launchId}/nodes/{nodeId}
Duplicate ad set or adPOST/v1/brands/{brandId}/launches/{launchId}/nodes/{nodeId}/duplicate
Edit live campaign budgetPOST/v1/brands/{brandId}/launches/{launchId}/nodes/{nodeId}/live-budget
Rename campaign, ad set or adPOST/v1/brands/{brandId}/launches/{launchId}/nodes/{nodeId}/rename
Duplicate and varyPOST/v1/brands/{brandId}/launches/{launchId}/nodes/{nodeId}/variations
Launch campaignPOST/v1/brands/{brandId}/launches/{launchId}/publish
Get settingsGET/v1/brands/{brandId}/launches/{launchId}/settings
Update settingsPATCH/v1/brands/{brandId}/launches/{launchId}/settings
Save campaign snapshot templatePOST/v1/brands/{brandId}/launches/{launchId}/snapshot-templates
Apply campaign snapshot templatePOST/v1/brands/{brandId}/launches/{launchId}/snapshot-templates/{templateId}/apply
Turn launch into structure templatePOST/v1/brands/{brandId}/launches/{launchId}/structure-templates
Apply structure templatePOST/v1/brands/{brandId}/launches/{launchId}/structure-templates/{templateId}/apply
Get targeting optionsGET/v1/brands/{brandId}/launches/{launchId}/targeting-options
Get campaign treeGET/v1/brands/{brandId}/launches/{launchId}/tree
Validate launchGET/v1/brands/{brandId}/launches/{launchId}/validation

Pipeline

OperationMethodPath
Move pipeline cardPOST/v1/brands/{brandId}/pipeline/cards/move
List pipeline columnsGET/v1/brands/{brandId}/pipeline/columns
Configure pipeline columnPATCH/v1/brands/{brandId}/pipeline/columns/{columnId}
Create pipeline cardPOST/v1/brands/{brandId}/pipeline/tickets

Snapshot Templates

OperationMethodPath
List campaign snapshot templatesGET/v1/brands/{brandId}/snapshot-templates
Delete campaign snapshot templateDELETE/v1/brands/{brandId}/snapshot-templates/{templateId}

Structure Templates

OperationMethodPath
List structure templatesGET/v1/brands/{brandId}/structure-templates
Create structure templatePOST/v1/brands/{brandId}/structure-templates
Get structure templateGET/v1/brands/{brandId}/structure-templates/{templateId}
Delete structure templateDELETE/v1/brands/{brandId}/structure-templates/{templateId}
Edit structure template rulesPATCH/v1/brands/{brandId}/structure-templates/{templateId}

Webhooks

OperationMethodPath
List webhook endpointsGET/v1/webhooks
Create webhook endpointPOST/v1/webhooks
Get webhook endpointGET/v1/webhooks/{endpointId}
Delete webhook endpointDELETE/v1/webhooks/{endpointId}
Update webhook endpointPATCH/v1/webhooks/{endpointId}
List webhook deliveriesGET/v1/webhooks/{endpointId}/deliveries
Enable webhook endpointPOST/v1/webhooks/{endpointId}/enable
Resend failed webhook deliveriesPOST/v1/webhooks/{endpointId}/resend-failed
Rotate webhook secretPOST/v1/webhooks/{endpointId}/rotate-secret
Get webhook secretGET/v1/webhooks/{endpointId}/secret
Send webhook test eventPOST/v1/webhooks/{endpointId}/test

Workflows

OperationMethodPath
List workflowsGET/v1/brands/{brandId}/workflows
Save workflowPOST/v1/brands/{brandId}/workflows
Get workflowGET/v1/brands/{brandId}/workflows/{workflowId}
Delete workflowDELETE/v1/brands/{brandId}/workflows/{workflowId}
Get workflow executionGET/v1/brands/{brandId}/workflows/{workflowId}/executions/{executionId}
Run workflowPOST/v1/brands/{brandId}/workflows/{workflowId}/runs
Set workflow statusPATCH/v1/brands/{brandId}/workflows/{workflowId}/status

On this page