Org Content

Upload a content image

POST/org-content/images

Multipart upload of a content image in the image field. It must be a JPEG, PNG, GIF or WebP image of at most 10 MiB, else 422. Returns a file_key for the item's image_file_key, and a Location that resolves it, only for the organisation that uploaded it. The acting user needs permission to manage the organisation's content, else 403. dry_run validates the file and stores nothing. Emits no webhook, email or notification. The upload cannot be undone through the API.

Query parameters

  • dry_runboolean#

    Validate and run the call without committing it, returning what the real call would return with meta.dry_run set.

Headers

  • Idempotency-Keystring#

    Makes a retry safe. Send a new UUID for each new request and reuse it only to retry that request; the first response is replayed for 24 hours.

Request body

multipart/form-data, required

  • imagestring (binary)Required#

    The image file: JPEG, PNG, GIF or WebP, up to 10 MiB.

Responses

201

The stored image.

OrgImageEnvelope
{
  "data": {
    "file_key": "oc_7c1e2f3a-4b5c-4d6e-8f90-1a2b3c4d5e6f",
    "url": "https://example.test/oc_7c1e2f3a.png"
  }
}
401

Authentication failed. error.code is one of invalid_token, expired, revoked.

Error
403

Authorization failed. error.code is one of org_disabled, ip_blocked, missing_scope, scope_disabled, user_disabled.

Error
422

The request can't be processed (HTTP 422): validation_failed with one ErrorDetail per problem, or a code documented on the operation.

Error
429

Rate limit exceeded (error.code = rate_limited).

Error

Examples

curl -X POST https://your-org-domain/kong/core/api/v2/org-content/images\
  -H "Authorization: Bearer $HELM_API_KEY"\
  -H "Content-Type: application/json"