distribution.techdistribution.tech

API reference, Campaigns

Where one campaign stands

GET /campaigns/{id}

Scope: campaigns:read.

Overview

Scope: campaigns:read.

Endpoint
GET https://app.distribution.tech/api/v1/campaigns/{id}
Scope
campaigns:read
Changes data
No, a read

Parameters

Parameters of GET /campaigns/{id}
NameInTypeRequiredDescription
idpathstring (uuid)Yes

Request with curl

Set DISTRIBUTION_API_KEY to a key from Developers with the campaigns:read scope, and each path variable to an id from an earlier answer. The body carries the required fields.

curl
curl "https://app.distribution.tech/api/v1/campaigns/$CAMPAIGN_ID" \
  -H "Authorization: Bearer $DISTRIBUTION_API_KEY"

Response

200 OK. The body has these fields:

Response fields of GET /campaigns/{id}
NameTypeRequiredDescription
idstring (uuid)Yes
campaignstringYes
created_atstring (date-time)Yes
refunded_atstring (date-time) or nullYesWhen the order was refunded; null unless it was.
archived_atstring (date-time) or nullYesWhen the brand archived the campaign; null for a live one. An archived campaign's stage reads Archived, and renaming it or setting its creator guidelines is refused (409 conflict, reason archived).
intent_statusone of "draft", "ready", nullYes
plan_statusone of "awaiting_approval", "approved", nullYes
open_changebooleanYes
stageone of "Draft", "Sent", "Plan ready", "Approved", "Paid", "Running", "Complete", "Cancelled", "Archived"Yes
stage_idone of "draft", "sent", "plan_ready", "approved", "paid", "running", "complete", "cancelled"Yesdraft (not sent), sent (no plan yet), plan_ready (a plan waits for approval), approved (signed, not paid), paid (the brand's payment cleared, no post started), running (a post is scheduled, live or delayed), complete (every post has its proof), cancelled (the order was cancelled or refunded).
plannull or objectYes
ordernull or objectYes
creator_guidelinesnull or objectYes
200 response body, every field with its type
{
  "id": "<uuid>",
  "campaign": "<string>",
  "created_at": "<date-time>",
  "refunded_at": "<date-time>",
  "archived_at": "<date-time>",
  "intent_status": "draft",
  "plan_status": "awaiting_approval",
  "open_change": false,
  "stage": "Draft",
  "stage_id": "draft",
  "plan": {
    "id": "<uuid>",
    "version": 0,
    "status": "awaiting_approval",
    "launch_window_start": "<date>",
    "launch_window_end": "<date>",
    "currency": "<string>",
    "sent_at": "<date-time>",
    "approved_at": "<date-time>",
    "total_cents": 0,
    "lines": [
      {
        "id": "<uuid>",
        "channel": "<string>",
        "channel_label": "<string>",
        "slot": "<string>",
        "scheduled_date": "<date>",
        "price_cents": 0,
        "status": "planned",
        "stage_id": "planned",
        "stage": "Planned",
        "proposal": {
          "state": "sending",
          "creator_handle": "<string>",
          "replaced_handle": "<string>",
          "updated_at": "<date-time>"
        }
      }
    ],
    "lines_by_status": {},
    "lines_by_stage": {
      "planned": 0,
      "offered": 0,
      "creator_confirmed": 0,
      "scheduled": 0,
      "live": 0,
      "proof_attached": 0,
      "cancelled": 0
    }
  },
  "order": {
    "payment_state": "<string>",
    "total_cents": 0,
    "currency": "<string>",
    "signed_at": "<date-time>",
    "paid_at": "<date-time>"
  },
  "creator_guidelines": {
    "pitch": "<string>",
    "key_messages": [
      "<string>"
    ],
    "references": [
      "<uri>"
    ],
    "voice": "<string>",
    "dos": [
      "<string>"
    ],
    "donts": [
      "<string>"
    ]
  }
}

Errors

Error statuses of GET /campaigns/{id}
StatusWhen
400A parameter is not valid: details.problems names each field and what it accepts.
401No API key, an unknown one, or a revoked one.
403The key does not have this endpoint's scope.
404No campaign of yours has that id.
429Too many requests for this key in the current minute (60); Retry-After and RateLimit-Reset say when to try again. On POST /campaigns and on POST /plans/current/lines when it starts a plan: the brand's 3 new campaigns in 24 hours are used (details.reason daily_campaign_limit); details.resets_at and Retry-After say when the limit reopens, a rolling 24 hours from the first of them, not a calendar day; archiving or deleting a campaign does not give its slot back. On GET /creators and GET /creators/{id}: a creator read limit is used (details.reason per_minute, daily_lists, daily_reveals, daily_seen or locked). daily_seen is your workspace's one pool of 300 creator views a day (300 different creators shown or opened since midnight UTC), shared by the app and every API key of the brand: details.scope workspace and details.limit 300; a creator already seen today, in the app or through any key, still opens and costs nothing. The other reasons are this key's own limit (details.scope key) or the brand's ceiling over all its keys (details.scope api).
500internal: the request failed on our side. Try again.
503unavailable: the service or this part of it is not reachable right now. Try again shortly.

Get access

Keys are created in Developers once your brand is approved. Connect an agent to ask for access, then read the agent guide for the full flow.