vlayer logovlayer
API reference

Brands

Brand and webhook management

List brands

GET
/admin/brands

Authorization

AuthorizationRequiredBearer <token>

API token. Send it as Authorization: Bearer <API_TOKEN>.

In: header

curl -X GET "//admin/brands" \
  -H "Authorization: Bearer <token>"

Brand list

{
  "data": [
    {
      "id": 1,
      "name": "Acme Co",
      "slug": "acme-co",
      "logoUrl": "string",
      "createdAt": "2019-08-24T14:15:22Z"
    }
  ]
}

Create brand

POST
/admin/brands

Authorization

AuthorizationRequiredBearer <token>

API token. Send it as Authorization: Bearer <API_TOKEN>.

In: header

Request Body

application/jsonRequired
nameRequiredstring
slugRequiredstring
Pattern: "^[a-z0-9-]+$"
logoUrlstring
Format: "uri"
curl -X POST "//admin/brands" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Co",
    "slug": "acme-co",
    "logoUrl": "http://example.com"
  }'

Brand created

{
  "data": {
    "id": 1,
    "name": "Acme Co",
    "slug": "acme-co",
    "logoUrl": "string",
    "createdAt": "2019-08-24T14:15:22Z"
  }
}

List webhooks for a brand

GET
/admin/brands/{brandId}/webhooks

Authorization

AuthorizationRequiredBearer <token>

API token. Send it as Authorization: Bearer <API_TOKEN>.

In: header

Path Parameters

brandIdRequiredinteger
curl -X GET "//admin/brands/{brandId}/webhooks" \
  -H "Authorization: Bearer <token>"

Webhook list

{
  "data": [
    {
      "id": 1,
      "url": "https://example.com/webhooks/engagement",
      "events": [
        "creator.verified",
        "reward.issued"
      ],
      "active": true,
      "description": "Production webhook",
      "lastTriggeredAt": "2019-08-24T14:15:22Z",
      "createdAt": "2019-08-24T14:15:22Z"
    }
  ]
}

Create webhook

Create a new webhook for a brand. The signing secret (whsec_*) is returned only once. See the WebhookDelivery schema for the exact payload shape and signature verification instructions.

POST
/admin/brands/{brandId}/webhooks

Authorization

AuthorizationRequiredBearer <token>

API token. Send it as Authorization: Bearer <API_TOKEN>.

In: header

Request Body

application/jsonRequired
urlRequiredstring
Format: "uri"
eventsRequiredarray<string>
descriptionstring

Path Parameters

brandIdRequiredinteger
curl -X POST "//admin/brands/{brandId}/webhooks" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/webhooks/engagement",
    "events": [
      "creator.verified",
      "reward.issued"
    ],
    "description": "Production webhook"
  }'

Webhook created (includes signing secret)

{
  "data": {
    "id": 1,
    "url": "https://example.com/webhooks/engagement",
    "events": [
      "creator.verified",
      "reward.issued"
    ],
    "active": true,
    "description": "Production webhook",
    "lastTriggeredAt": "2019-08-24T14:15:22Z",
    "createdAt": "2019-08-24T14:15:22Z",
    "secret": "whsec_a1b2c3..."
  }
}

Update webhook

PATCH
/admin/brands/{brandId}/webhooks/{webhookId}

Authorization

AuthorizationRequiredBearer <token>

API token. Send it as Authorization: Bearer <API_TOKEN>.

In: header

Request Body

application/jsonRequired
urlstring
Format: "uri"
eventsarray<string>
activeboolean
descriptionstring

Path Parameters

brandIdRequiredinteger
webhookIdRequiredinteger
curl -X PATCH "//admin/brands/{brandId}/webhooks/{webhookId}" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "http://example.com",
    "events": [
      "creator.verified"
    ],
    "active": true,
    "description": "string"
  }'

Webhook updated

{
  "data": {
    "id": 1,
    "url": "https://example.com/webhooks/engagement",
    "events": [
      "creator.verified",
      "reward.issued"
    ],
    "active": true,
    "description": "Production webhook",
    "lastTriggeredAt": "2019-08-24T14:15:22Z",
    "createdAt": "2019-08-24T14:15:22Z"
  }
}

Delete webhook

DELETE
/admin/brands/{brandId}/webhooks/{webhookId}

Authorization

AuthorizationRequiredBearer <token>

API token. Send it as Authorization: Bearer <API_TOKEN>.

In: header

Path Parameters

brandIdRequiredinteger
webhookIdRequiredinteger
curl -X DELETE "//admin/brands/{brandId}/webhooks/{webhookId}" \
  -H "Authorization: Bearer <token>"

Webhook deleted

{
  "ok": true
}