Register an advertisement

post/v1/advertisements

This endpoint is in the contract, but the API doesn't serve it during early access. It returns 404 for now.

Step 2 of 2. Registers an uploaded object as an advertisement. The server reads the object's size from storage — never from the client. A missing, foreign or mismatched upload returns 422 (upload_not_found / upload_mismatch). Setting client_id additionally needs advertisementAssignClients.

Access

Authentication
Secret key or OAuth access token.
Scope
advertisements:write
User permission
advertisementAddNew
Sending client_id
Also needs advertisementAssignClients
Safe to retry
Send an Idempotency-Key.

Headers

  • Vojo-Organisationstring

    The organisation this request acts on (org id). Required for oauth2 callers — a missing header returns 400 organisation_header_required; an org the user cannot access (a membership or an access grant, and granted to this OAuth client) returns 403 organisation_access_denied. Secret keys are bound to one org: the header may be omitted, and if sent it must match the key's org (else 403). Every query is scoped by the resolved org, never by an id in the body.

  • Vojo-Versionstring

    Optional API version pin (a date). Overrides the version pinned on the secret key / organisation for this request. Echoed in the Vojo-Version response header. Within /v1 only additive changes ship, so most callers can omit it.

    date

  • Idempotency-Keystring

    Client-generated unique key (UUID v4 recommended) making this create safe to retry. A replay within 24 hours returns the stored response (with Idempotent-Replayed: true). Reusing a key with a different body returns 409 idempotency_key_reused.

    8 to 255 characters

Request body

  • upload_idstringRequired

    From POST /v1/advertisement-uploads, after the PUT completed.

  • namestringRequired

    1 to 120 characters

  • typestringRequired

    Creative media type.

    One of video, image, html

  • descriptionstring

    up to 100 characters

  • client_idstring

    Requires advertisementAssignClients.

  • lengthnumber

    Duration in seconds.

    more than 0

Response 201

Created

  • dataobjectRequired

    An uploaded creative.

    Show 14 fields
    • idstringRequired

      Advertisement id. Opaque string — treat as an identifier, never parse it.

    • namestringRequired
    • descriptionstring or nullRequired

      up to 100 characters

    • typestringRequired

      Creative media type.

      One of video, image, html

    • client_idstring or nullRequired
    • is_activebooleanRequired

      False once archived via DELETE.

    • size_bytesinteger or nullRequired

      Measured from storage (HeadObject); never client-supplied.

    • lengthnumber or nullRequired

      Duration in seconds (video/HTML).

    • thumbnail_urlstring or nullRequired

      uri

    • source_urlstring or nullRequired

      Short-lived signed GET URL for the media. Present only when the caller has advertisementViewSource; otherwise null.

      uri

    • tagsarray of stringRequired
    • uploaded_by_user_idstringRequired

      The person who uploaded it (for a secret key, the key's creator).

    • created_atstringRequired

      RFC 3339 / ISO-8601 UTC timestamp.

      date-time

    • updated_atstring or nullRequired

      RFC 3339 / ISO-8601 UTC timestamp, or null.

      date-time

  • metaobjectRequired

    Response metadata for single-resource responses. Reserved; currently empty. Clients must ignore unknown members.

Response headers

  • Vojo-Versionstring

    The API version (date) this response was rendered with — the request's Vojo-Version, else the key/org pin.

  • RateLimitstring

    IETF RateLimit header: remaining quota in the current window, e.g. "default";r=97;t=42.

  • RateLimit-Policystring

    IETF RateLimit-Policy header, e.g. "default";q=100;w=60. Portal OAuth clients get a higher tier.

  • Locationstring

    URL of the created resource.

  • Idempotent-Replayedstring

    true when this response is a stored replay of an earlier request with the same Idempotency-Key.

Errors

Every error is application/problem+json. Branch on its code.

  • 400

    Malformed request: invalid JSON, a bad cursor, a missing Vojo-Organisation for an OAuth caller, or an unknown Vojo-Version.

  • 401

    Missing, invalid, expired or revoked credential.

  • 403

    The caller is authenticated but not allowed: missing scope (insufficient_scope), missing Permissions flag (permission_denied), a client/installer persona on an operator endpoint (operator_access_required), or no access to the requested org (organisation_access_denied).

  • 404

    The resource does not exist, or belongs to another organisation. Cross-org ids always 404, never 403.

  • 409

    The request conflicts with current state (duplicate name, device already paired, idempotency key reuse).

  • 422

    Well-formed request that failed validation. errors[] lists each failing field.

  • 429

    Rate limit exceeded for this principal. Back off for Retry-After seconds.

  • 500

    Unexpected server failure.