Dregs Badge Rules API

Badge rule management

Operations 5

GET /api/badge-rules List badge rules #
POST /api/badge-rules Create badge rule #
GET /api/badge-rules/{id} Get badge rule #
DELETE /api/badge-rules/{id} Delete badge rule #
PATCH /api/badge-rules/{id} Update badge rule #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/dregs-com:dregs-com-badge-rules-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

dregs-com-badge-rules-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Dregs Badge Rules API
  description: 'Customer REST API for sending events and reading fraud scores, identities, devices, escalations, channels, datasets, and mappings.


    Authenticate with a secret key created in the dashboard under Settings > Credentials (security scheme secretKey). Send it as a Bearer token: Authorization: Bearer sk_... The key acts as an admin of that credential''s team. POST /api/events and GET /api/devices/{fingerprint} also accept the credential''s public key (security scheme publicKey, Bearer pk_...). Public keys may be embedded in a browser. Secret keys must not.


    This document is the curated public surface. Dashboard sign-in, billing, team administration, and trainer tools are not included.'
  version: '1.0'
servers:
- url: https://dregs.com
  description: Dregs API
security:
- secretKey: []
tags:
- name: Badge Rules
  description: Badge rule management
paths:
  /api/badge-rules:
    get:
      tags:
      - Badge Rules
      summary: List badge rules
      description: Returns all badge rules for the current team
      operationId: listBadgeRules
      responses:
        '200':
          description: Badge rules retrieved successfully
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/V1BadgeRule'
        '401':
          description: Authentication required
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/V1BadgeRule'
      security:
      - secretKey: []
    post:
      tags:
      - Badge Rules
      summary: Create badge rule
      description: Creates a new badge rule
      operationId: createBadgeRule
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V1CreateBadgeRuleRequest'
        required: true
      responses:
        '200':
          description: Badge rule created
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/V1BadgeRule'
        '400':
          description: Invalid request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/V1BadgeRule'
      security:
      - secretKey: []
  /api/badge-rules/{id}:
    get:
      tags:
      - Badge Rules
      summary: Get badge rule
      description: Returns a single badge rule by ID
      operationId: getBadgeRule
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '200':
          description: Badge rule found
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/V1BadgeRule'
        '404':
          description: Badge rule not found
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/V1BadgeRule'
      security:
      - secretKey: []
    delete:
      tags:
      - Badge Rules
      summary: Delete badge rule
      description: Deletes a badge rule
      operationId: deleteBadgeRule
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '204':
          description: Badge rule deleted
        '404':
          description: Badge rule not found
      security:
      - secretKey: []
    patch:
      tags:
      - Badge Rules
      summary: Update badge rule
      description: Updates a badge rule
      operationId: updateBadgeRule
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V1UpdateBadgeRuleRequest'
        required: true
      responses:
        '200':
          description: Badge rule updated
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/V1BadgeRule'
        '404':
          description: Badge rule not found
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/V1BadgeRule'
      security:
      - secretKey: []
components:
  schemas:
    RuleCondition:
      type: object
      properties:
        condition:
          type: string
        category:
          type: string
        threshold:
          type: integer
          format: int32
        badge:
          type: string
        seconds:
          type: integer
          format: int32
    V1UpdateBadgeRuleRequest:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
          enum:
          - GOOD
          - BAD
          - NEUTRAL
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/RuleCondition'
        priority:
          type: integer
          format: int32
        applyDelaySeconds:
          type: integer
          format: int32
        removeDelaySeconds:
          type: integer
          format: int32
        enabled:
          type: boolean
    V1BadgeRule:
      type: object
      properties:
        id:
          type: integer
          format: int64
        slug:
          type: string
        name:
          type: string
        type:
          type: string
          enum:
          - GOOD
          - BAD
          - NEUTRAL
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/RuleCondition'
        priority:
          type: integer
          format: int32
        applyDelaySeconds:
          type: integer
          format: int32
        removeDelaySeconds:
          type: integer
          format: int32
        enabled:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    V1CreateBadgeRuleRequest:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
          enum:
          - GOOD
          - BAD
          - NEUTRAL
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/RuleCondition'
        priority:
          type: integer
          format: int32
        applyDelaySeconds:
          type: integer
          format: int32
        removeDelaySeconds:
          type: integer
          format: int32
  securitySchemes:
    secretKey:
      type: http
      description: Customer secret key from Settings > Credentials, sent as a Bearer token. The token value starts with sk_. It acts as an admin of that credential's team for every operation in this document. MCP tokens (dmcp_) are refused. Prefer the publicKey scheme on operations that accept a pk_ key.
      scheme: bearer
      bearerFormat: sk_
    publicKey:
      type: http
      description: Customer public key from Settings > Credentials, sent as a Bearer token. The token value starts with pk_. Accepted only by POST /api/events and GET /api/devices/{fingerprint}. It may be embedded in a browser. It cannot call the other operations in this document.
      scheme: bearer
      bearerFormat: pk_