{
  "openapi": "3.1.0",
  "info": {
    "title": "YouLMK",
    "version": "1.0.0",
    "summary": "Send a notification into your YouLMK inbox from anything with an HTTP client.",
    "description": "YouLMK is an inbox you let things interrupt you through. Every sender (a source) has a URL key and a bearer token, shown on its Key screen. Send plain text or JSON to the key's door, or JSON with the bearer token to /v1/notify. The receiver's rules (Reach, quiet hours, grouping, destinations) apply on delivery. Full reference: https://youlmk.com/docs/http and https://youlmk.com/docs/payload.",
    "termsOfService": "https://youlmk.com/terms",
    "contact": {
      "name": "YouLMK",
      "url": "https://youlmk.com/support",
      "email": "hello@youlmk.com"
    }
  },
  "servers": [
    {
      "url": "https://youlmk.com"
    }
  ],
  "tags": [
    {
      "name": "Send",
      "description": "The doors a sender posts to."
    },
    {
      "name": "Webhooks",
      "description": "A service's own webhook shape, mapped into a notification."
    }
  ],
  "paths": {
    "/k/{key}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/key"
        }
      ],
      "post": {
        "tags": [
          "Send"
        ],
        "summary": "Send with the URL key",
        "description": "Plain text becomes the title. A JSON body sets every field. A body that starts with { is read as JSON whatever the content type.",
        "operationId": "sendWithKey",
        "requestBody": {
          "required": true,
          "content": {
            "text/plain": {
              "schema": {
                "type": "string",
                "maxLength": 120
              },
              "example": "backup finished \u00b7 4.2 GB"
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Payload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Sent"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "410": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "get": {
        "tags": [
          "Send"
        ],
        "summary": "Send with the URL key, from a tool that cannot POST",
        "operationId": "sendWithKeyByQuery",
        "parameters": [
          {
            "name": "title",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          },
          {
            "name": "body",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2000
            }
          },
          {
            "name": "priority",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Priority"
            }
          },
          {
            "name": "url",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uri"
            }
          },
          {
            "name": "url_label",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 24
            }
          },
          {
            "name": "group",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "image",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uri"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Sent"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "410": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/notify": {
      "post": {
        "tags": [
          "Send"
        ],
        "summary": "Send with the bearer token",
        "description": "The same JSON as the key door, with Authorization: Bearer ylk_\u2026 instead of the key in the URL. What the libraries and the MCP server use.",
        "operationId": "notify",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/idempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Payload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Sent"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "410": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/me": {
      "get": {
        "tags": [
          "Send"
        ],
        "summary": "Whose token this is, without sending anything",
        "description": "Answers 200 with the source's name for a valid bearer token, 401 for an unknown one, 410 for a rotated or deleted one; a token in its 24-hour grace after a rotation answers 200 with a Deprecation header. Writes nothing. What a tool's test-credentials button calls.",
        "operationId": "me",
        "security": [
          {
            "bearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "The token opens a source.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "ok": true,
                  "source": {
                    "name": "deploy.sh"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "410": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/w/{key}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/key"
        }
      ],
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "A service's own webhook, mapped into a notification",
        "description": "Paste this URL where a service asks for a webhook. Sentry, GitHub and Stripe payloads have their own mapping; anything else that posts JSON uses the generic one (the most title-like field becomes the title, the rest arrive as rows). GitHub deliveries are verified with the secret shown on the source's page; Stripe deliveries with the signing secret you paste there. The pages at https://youlmk.com/integrations say what each service's events become.",
        "operationId": "webhook",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Sent"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "410": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "The source's bearer token: ylk_ and 32 characters, shown once on the Key screen."
      }
    },
    "parameters": {
      "key": {
        "name": "key",
        "in": "path",
        "required": true,
        "description": "The source's URL key: k_ and 14 characters.",
        "schema": {
          "type": "string",
          "pattern": "^k_[0-9a-z]{14}$"
        },
        "example": "k_7hq2nk3f9qd8w4"
      },
      "idempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "The same key within 24 hours returns the first answer and sends nothing twice. Also honoured on the key doors.",
        "schema": {
          "type": "string",
          "maxLength": 200
        }
      }
    },
    "schemas": {
      "Priority": {
        "type": "string",
        "enum": [
          "low",
          "normal",
          "high",
          "critical"
        ],
        "default": "normal",
        "description": "low never sounds and groups; normal delivers at the source's Reach; high pins for an hour; critical may break through quiet hours if the source allows it."
      },
      "Action": {
        "type": "object",
        "description": "Up to two. A url action opens the address; a post action is accepted and travels with the payload, and the tap that performs the POST is not built yet.",
        "properties": {
          "label": {
            "type": "string",
            "maxLength": 20
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "post": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "label"
        ]
      },
      "Payload": {
        "type": "object",
        "description": "8 KB at most in all.",
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 120,
            "description": "Required unless the body is plain text, which becomes the title."
          },
          "body": {
            "type": "string",
            "maxLength": 2000,
            "description": "Shown under the title; links are detected."
          },
          "priority": {
            "$ref": "#/components/schemas/Priority"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The primary button."
          },
          "url_label": {
            "type": "string",
            "maxLength": 24,
            "default": "Open"
          },
          "actions": {
            "type": "array",
            "maxItems": 2,
            "items": {
              "$ref": "#/components/schemas/Action"
            }
          },
          "group": {
            "type": "string",
            "maxLength": 64,
            "description": "Identical group within 10 minutes collapses into one card with a count. Default: the title."
          },
          "image": {
            "type": "string",
            "format": "uri",
            "description": "A picture for this one notification, in place of the source's icon."
          },
          "fields": {
            "type": "object",
            "maxProperties": 6,
            "additionalProperties": {
              "type": "string",
              "maxLength": 2000
            },
            "description": "Up to 6 keys, shown as rows."
          }
        },
        "example": {
          "title": "api deployed \u00b7 v2.4.1",
          "body": "production \u00b7 4 min 12 s",
          "priority": "normal",
          "url": "https://example.com/deploys/2041",
          "fields": {
            "commit": "9f2c1a0",
            "by": "ci"
          }
        }
      },
      "Sent": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "id": {
            "type": "string",
            "description": "The notification's id."
          },
          "receipt": {
            "type": "string",
            "description": "The delivery receipt's id."
          },
          "grouped": {
            "type": "boolean",
            "description": "True when the notification joined an open card."
          },
          "held": {
            "type": "boolean",
            "description": "True when quiet hours are holding it."
          }
        },
        "example": {
          "ok": true,
          "id": "ntf_\u2026",
          "receipt": "rcpt_\u2026",
          "grouped": false,
          "held": false
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "enum": [
              "bad_json",
              "unknown_key",
              "trial_used",
              "key_rotated",
              "too_large",
              "invalid_field",
              "rate_limited",
              "daily_cap",
              "sending_paused"
            ]
          },
          "field": {
            "type": "string",
            "description": "For invalid_field: the field over its limit."
          }
        }
      }
    },
    "responses": {
      "Sent": {
        "description": "Sent. grouped says it joined an open card; held says quiet hours are holding it.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Sent"
            }
          }
        }
      },
      "Error": {
        "description": "One error code, so a script can branch on it: 400 bad_json, 401 unknown_key, 402 trial_used (the body is held 7 days under Not delivered), 410 key_rotated, 413 too_large, 422 invalid_field with the field named.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "429 rate_limited (60 a minute per key, bursts of 10 a second) or daily_cap (100,000 in a day), and 503 sending_paused, each with Retry-After in seconds.",
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer"
            },
            "description": "Seconds to wait."
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}
