{"openapi":"3.1.0","info":{"title":"POST /api/v1/credit/notifications/{notification_id}/dismiss","version":"1.0.0","description":"Dismiss an in-app notification"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/credit/notifications/{notification_id}/dismiss":{"post":{"tags":["credit"],"summary":"Dismiss an in-app notification","description":"Sets `dismissed_at`, and `read_at` if it was unread, once each: dismissing it again keeps the first times. A dismissed notification is still listed; `unread_only=true` leaves it out. Takes no body.","operationId":"dismiss_credit_notification","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"string","description":"The notification's `id`.","title":"Notification Id"},"description":"The notification's `id`."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CreditNotificationResponse_"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"dismiss_credit_notification_api_v1_credit_notifications__notification_id__dismiss_post"}}},"components":{"schemas":{"CreditNotificationResponse":{"properties":{"id":{"type":"string","title":"Id","description":"The notification's id."},"credit_line_id":{"type":"string","title":"Credit Line Id","description":"The line it is about."},"external_line_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Line Id","description":"The line's `external_line_id`, as opened."},"program_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Program Id","description":"The line's program."},"event_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Id","description":"The credit event that triggered it (e.g. `credit.loan.due_soon`). Null for a collections notification."},"kind":{"type":"string","title":"Kind","description":"due_soon, past_due, loan_paid, statement_issued, limit_changed or collections: the same kinds as the notice emails."},"severity":{"type":"string","enum":["info","warning","critical"],"title":"Severity","description":"info (a statement, a loan paid, a limit raised), warning (a payment due soon, a statement due the day it is issued, a limit lowered) or critical (a payment past due, a collections stage)."},"title":{"type":"string","title":"Title","description":"A short headline in the merchant's words."},"body":{"type":"string","title":"Body","description":"The full message, plain text, in the lender's name and with amounts and dates written out: the same words as the notice email."},"action":{"anyOf":[{"type":"string","enum":["pay","view_statement","view_transactions","view_credit_line"]},{"type":"null"}],"title":"Action","description":"What the merchant can do about it: pay, view_statement (open `cycle_id`), view_transactions (open `loan_id`), or view_credit_line."},"amount_due_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount Due Cents","description":"The amount the notification is about: outstanding on the loan (due_soon, past_due), the statement balance (statement_issued), or the amount past due (collections). Null otherwise."},"due_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due Date","description":"The loan's due date (due_soon, past_due), the statement's due date (statement_issued), or the oldest past-due date (collections)."},"cycle_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cycle Id","description":"The statement it is about (`GET .../statements/{cycle_id}`)."},"loan_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Loan Id","description":"The loan it is about."},"detail":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Detail","description":"Every figure it quotes, as the notice email's `detail`; `due_on_issue` is true on a statement due the day it was issued."},"dedup_key":{"type":"string","title":"Dedup Key","description":"Stable key of the decision: `event:<event id>`, or `collections:<line>:<stage>:<entered on>`. The notice email for the same decision has the same key."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When it was decided (UTC)."},"read_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Read At","description":"When the partner marked it read. Null: unread."},"dismissed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Dismissed At","description":"When the partner dismissed it. Null: not dismissed."}},"type":"object","required":["id","credit_line_id","kind","severity","title","body","dedup_key","created_at"],"title":"CreditNotificationResponse","description":"One in-app notification for a merchant."},"SuccessEnvelope_CreditNotificationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CreditNotificationResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CreditNotificationResponse]"},"ErrorResponse":{"title":"ErrorResponse","type":"object","description":"Envelope returned by every non-2xx response. Branch on `code` (stable) rather than `message` (human-readable, may change).","required":["error","message","code"],"properties":{"error":{"type":"string","description":"Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`."},"message":{"type":"string","description":"Human-readable explanation, safe to show to end users."},"code":{"type":"string","description":"Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`)."},"request_id":{"type":"string","description":"Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied."},"errors":{"type":"object","additionalProperties":{"type":"string"},"description":"Field-level validation messages keyed by field name. Present on 400/422 validation failures only."}}}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}