{"openapi":"3.1.0","info":{"title":"Innbocks Partner API","version":"1.0.0","description":"Versioned REST API for CRM, billing, mailbox operations, compliance state, mail actions, webhooks, and usage reconciliation. Authenticate with a scoped `ib_live_` bearer key created in the dashboard. Human-readable docs: https://www.innbocks.com/developers\n\n**Rate limits.** 1200 requests per minute per API key. Every response carries `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset` (seconds until the window resets), and `RateLimit-Policy`; a `429` also carries `Retry-After`. Self-throttle from these headers instead of retrying blindly.\n\n**Versioning & deprecation.** The API is versioned in the URL path (`/api/v1`). Breaking changes ship only in a new version path; `v1` responses may gain fields but never lose or repurpose them. When an endpoint or version is scheduled for removal, responses carry `Deprecation` and `Sunset` headers ahead of the removal date and the policy at https://www.innbocks.com/developers#versioning is updated.","contact":{"name":"Innbocks Partnerships","url":"https://www.innbocks.com/developers"},"termsOfService":"https://www.innbocks.com/terms"},"externalDocs":{"description":"Developer documentation","url":"https://www.innbocks.com/developers"},"servers":[{"url":"https://www.innbocks.com","description":"Production"}],"tags":[{"name":"Customers","description":"Provision and manage mailbox renters."},{"name":"Mailboxes","description":"Mailbox assignment and availability."},{"name":"Mail","description":"Inbound mail/package records and items."},{"name":"Mail actions","description":"Request scan, forward, shred, and pickup."},{"name":"Compliance","description":"USPS Form 1583 and ID verification state."},{"name":"Webhooks","description":"Outbound event types, endpoints, and delivery history."},{"name":"Locations","description":"A multi-location store's locations."},{"name":"Billing","description":"Active-mailbox usage reconciliation and store reports."},{"name":"Plans","description":"Vendor plans assignable to customers."}],"components":{"securitySchemes":{"partnerApiKey":{"type":"http","scheme":"bearer","bearerFormat":"ib_live API key","description":"Send `Authorization: Bearer ib_live_...`. Keys are scoped; each operation lists its required scope under `x-required-scopes`."}},"schemas":{"Scope":{"type":"string","enum":["customers:read","customers:write","mail:read","mail:write","mail_actions:write","webhooks:read","webhooks:write","billing:read","plans:read","credits:read","credits:write"]},"WebhookEvent":{"type":"string","enum":["customer.created","customer.activated","customer.verified","customer.form_1583_status_updated","webhook.test","mail.arrived","package.arrived","mail.scan_requested","mail.scanned","mail.forward_requested","mail.forwarded","mail.pickup_requested","mail.pickup_scheduled","mail.picked_up","mail.locker_updated","mail.shred_requested","mail.shredded","mail.check_deposit_requested","mail.check_deposit_mailed","mail.check_deposit_completed","mail.check_deposit_returned","limited.reached.scans","limited.reached.shreds","limited.reached.pickups","allowance.warning.mail","allowance.reached.mail","credits.purchased","credits.granted","credits.low"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"not_found"},"message":{"type":"string"},"request_id":{"type":"string"}}}}},"Location":{"type":"object","description":"One of a multi-location store's physical locations.","properties":{"id":{"type":"string"},"name":{"type":"string"},"street_address":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"zip":{"type":"string"},"country":{"type":"string"},"phone":{"type":"string","nullable":true},"time_zone":{"type":"string","nullable":true},"is_default":{"type":"boolean"},"accepts_customers":{"type":"boolean","description":"False while the location is inactive or has not completed its CMRA registration; `location_id` on create customer is rejected for it."}}},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"enabled":{"type":"boolean"},"event_types":{"type":"array","items":{"type":"string"},"description":"Event names from GET /api/v1/webhook-events, or `*` for all."},"failure_count":{"type":"integer"},"last_success_at":{"type":"string","format":"date-time","nullable":true},"last_failure_at":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time","nullable":true},"updated_at":{"type":"string","format":"date-time","nullable":true},"secret":{"type":"string","description":"Signing secret. Present only in the create response and after `rotate_secret`; store it then."}}},"Customer":{"type":"object","properties":{"id":{"type":"string"},"external_customer_id":{"type":"string","nullable":true},"email":{"type":"string","format":"email"},"name":{"type":"string"},"phone":{"type":"string","nullable":true},"status":{"type":"string"},"is_active":{"type":"boolean"},"prepay":{"type":"boolean"},"box_number":{"type":"string","nullable":true},"pmb":{"type":"string","nullable":true},"mailbox_id":{"type":"string","nullable":true},"mailbox_active":{"type":"boolean"},"location_id":{"type":"string","nullable":true,"description":"The store location this customer belongs to (see GET /api/v1/locations). Null on single-location stores and for customers at the default location created without one."},"plan":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"price_cents":{"type":"integer","nullable":true}}},"form_1583_status":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time","nullable":true},"updated_at":{"type":"string","format":"date-time","nullable":true}}},"Mailbox":{"type":"object","properties":{"customer_id":{"type":"string"},"mailbox_id":{"type":"string","nullable":true},"box_number":{"type":"string","nullable":true},"pmb":{"type":"string","nullable":true},"assignment_mode":{"type":"string"},"rendered_address":{"type":"string","nullable":true},"mailbox_active":{"type":"boolean"}}},"AvailableMailbox":{"type":"object","properties":{"id":{"type":"string"},"box_number":{"type":"string"},"type":{"type":"string","nullable":true},"size":{"type":"string","nullable":true},"status":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"Mail":{"type":"object","properties":{"id":{"type":"string"},"customer_id":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"old_status":{"type":"string","nullable":true},"processed_status":{"type":"string","nullable":true},"request_status":{"type":"array","items":{"type":"string"}},"mail_number":{"type":"string","nullable":true},"box_number":{"type":"string","nullable":true},"image_url":{"type":"string","format":"uri","nullable":true},"photo_urls":{"type":"array","items":{"type":"string","format":"uri"}},"pdf_url":{"type":"string","format":"uri","nullable":true},"description":{"type":"string","nullable":true},"performed_by":{"type":"string","nullable":true},"source":{"type":"string","nullable":true},"mailbox_id":{"type":"string","nullable":true},"scan_available":{"type":"boolean"},"forwarding":{"type":"object","properties":{"shipping_address":{"type":"string","nullable":true},"shipping_method":{"type":"string","nullable":true},"tracking_number":{"type":"string","nullable":true},"shipping_company":{"type":"string","nullable":true}}},"pickup":{"type":"object","properties":{"pickup_date":{"type":"string","nullable":true},"pickup_time":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true}}},"external_reference":{"type":"string","nullable":true,"description":"Your system's identifier for this item, set via PATCH."},"bin_location":{"type":"string","nullable":true},"locker":{"$ref":"#/components/schemas/MailLocker","nullable":true,"description":"Smart-locker handoff state; null until a locker is assigned."},"created_at":{"type":"string","format":"date-time","nullable":true},"updated_at":{"type":"string","format":"date-time","nullable":true}}},"MailLocker":{"type":"object","properties":{"provider":{"type":"string","nullable":true},"number":{"type":"string","nullable":true},"access_code":{"type":"string","nullable":true,"description":"PIN or QR payload the customer presents at the locker."},"status":{"type":"string","enum":["assigned","deposited","collected"],"nullable":true},"assigned_at":{"type":"string","format":"date-time","nullable":true},"deposited_at":{"type":"string","format":"date-time","nullable":true},"collected_at":{"type":"string","format":"date-time","nullable":true}}},"ServiceRequest":{"type":"object","description":"A queued operator work item created by a mail-action request.","properties":{"id":{"type":"string"},"mail_id":{"type":"string","nullable":true},"customer_id":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"amount_cents":{"type":"integer"},"billing_status":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time","nullable":true},"updated_at":{"type":"string","format":"date-time","nullable":true}}},"Compliance":{"type":"object","properties":{"customer_id":{"type":"string"},"form_1583_status":{"type":"string","description":"Form 1583 progress, or \"not_required\" for stores outside USPS jurisdiction."},"id_status":{"type":"string","enum":["verified","submitted","not_submitted"]},"notary_status":{"type":"string","description":"Notarization progress, or \"not_required\" for stores outside USPS jurisdiction."},"mailbox_active":{"type":"boolean"},"verified_in_person":{"type":"boolean"},"reviewed_at":{"type":"string","format":"date-time","nullable":true},"reviewed_by":{"type":"string","nullable":true},"approved_at":{"type":"string","format":"date-time","nullable":true},"rejection_reason":{"type":"string","nullable":true},"photo_id_expires_at":{"type":"string","format":"date-time","nullable":true},"address_id_expires_at":{"type":"string","format":"date-time","nullable":true}}},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string"},"endpoint_id":{"type":"string"},"event_id":{"type":"string"},"event_type":{"$ref":"#/components/schemas/WebhookEvent"},"payload":{"type":"object","additionalProperties":true},"status":{"type":"string"},"attempt_count":{"type":"integer"},"next_attempt_at":{"type":"string","format":"date-time","nullable":true},"last_attempt_at":{"type":"string","format":"date-time","nullable":true},"delivered_at":{"type":"string","format":"date-time","nullable":true},"response_status":{"type":"integer","nullable":true},"response_body":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}}},"Usage":{"type":"object","properties":{"period_start":{"type":"string","format":"date-time"},"period_end":{"type":"string","format":"date-time"},"active_mailboxes":{"type":"integer"},"platform_fee_cents_per_mailbox":{"type":"integer"},"estimated_platform_fee_cents":{"type":"integer"},"customers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"},"name":{"type":"string"},"status":{"type":"string"},"box_number":{"type":"string","nullable":true},"prepay":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}}}}}},"StoreReportFigures":{"type":"object","description":"Month-to-date figures for the whole store or one location. Money is in the smallest currency unit (cents).","properties":{"mail_received":{"type":"integer"},"requests_completed":{"type":"object","properties":{"total":{"type":"integer"},"scans":{"type":"integer"},"forwards":{"type":"integer"},"pickups":{"type":"integer"},"shreds":{"type":"integer"},"previous_month_to_date":{"type":"integer"}}},"collected_cents":{"type":"integer"},"collected_cents_previous_month_to_date":{"type":"integer"},"projected_month_end_cents":{"type":"integer"},"customers_joined":{"type":"integer"},"customers_cancelled":{"type":"integer"},"mailboxes_occupied":{"type":"integer"},"mailbox_capacity":{"type":"integer","nullable":true,"description":"Pre-created mailbox inventory. Null when the store issues box numbers on demand and has no fixed ceiling."}}},"StoreReport":{"type":"object","properties":{"month":{"type":"string","example":"2026-11"},"day_of_month":{"type":"integer"},"days_in_month":{"type":"integer"},"time_zone":{"type":"string","example":"America/New_York"},"currency":{"type":"string","example":"usd"},"totals":{"$ref":"#/components/schemas/StoreReportFigures"},"locations":{"type":"array","description":"One entry per location. A single-location store has one entry with id `store`.","items":{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}},{"$ref":"#/components/schemas/StoreReportFigures"}]}},"collected_cents_by_day":{"type":"array","items":{"type":"integer"},"description":"Store-wide cents collected on each day of the month so far. Index 0 is day 1."}}},"Plan":{"type":"object","description":"A vendor plan that can be assigned to a customer via `plan_id`. Prices are in cents; a null price tier is not offered.","properties":{"id":{"type":"string"},"name":{"type":"string"},"monthly_price_cents":{"type":"integer","nullable":true},"yearly_price_cents":{"type":"integer","nullable":true},"three_month_price_cents":{"type":"integer","nullable":true},"six_month_price_cents":{"type":"integer","nullable":true},"features":{"type":"array","items":{"type":"string"}},"not_included":{"type":"array","items":{"type":"string"}},"is_active":{"type":"boolean"},"is_default":{"type":"boolean"},"setup_fee_cents":{"type":"integer","nullable":true,"description":"One-time setup fee added to the first invoice of a customer's first subscription; null when the plan has none."},"sort_order":{"type":"integer","nullable":true},"text_notifications":{"type":"boolean","nullable":true},"multiple_recipients":{"type":"boolean","nullable":true},"fees":{"type":"object","description":"Per-action fee in cents when the plan charges for it, else null.","properties":{"scan":{"type":"integer","nullable":true},"shred":{"type":"integer","nullable":true},"forward":{"type":"boolean","nullable":true},"pickup":{"type":"integer","nullable":true},"storage":{"type":"integer","nullable":true},"package_storage":{"type":"integer","nullable":true},"letter_storage":{"type":"integer","nullable":true}}},"allowances":{"type":"object","properties":{"free_scans":{"type":"integer","nullable":true},"free_shreds_per_month":{"type":"integer","nullable":true},"free_pickups":{"type":"integer","nullable":true},"free_storage_days":{"type":"integer","nullable":true},"free_letter_storage_days":{"type":"integer","nullable":true},"free_package_storage_days":{"type":"integer","nullable":true}}},"created_at":{"type":"string","format":"date-time","nullable":true},"updated_at":{"type":"string","format":"date-time","nullable":true}}}}},"security":[{"partnerApiKey":[]}],"paths":{"/api/v1/customers":{"get":{"tags":["Customers"],"security":[{"partnerApiKey":[]}],"operationId":"listCustomers","summary":"List customers","description":"Requires the `customers:read` scope.","x-required-scopes":["customers:read"],"parameters":[{"name":"limit","in":"query","description":"Maximum number of items to return per page.","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","description":"Pagination cursor from a previous response's `next_cursor`.","schema":{"type":"string"}},{"name":"email","in":"query","schema":{"type":"string"}},{"name":"external_customer_id","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"box_number","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Customers","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"customers":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"next_cursor":{"type":"string","nullable":true}}}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Customers"],"security":[{"partnerApiKey":[]}],"operationId":"createCustomer","summary":"Create invited customer","description":"Requires the `customers:write` scope. Sends the customer an invite to activate their mailbox.","x-required-scopes":["customers:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Client-generated key to make retries of this write safe.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email","name","phone"],"properties":{"external_customer_id":{"type":"string"},"email":{"type":"string","format":"email"},"name":{"type":"string"},"phone":{"type":"string"},"prepay":{"type":"boolean"},"selected_mailbox_id":{"type":"string"},"plan_id":{"type":"string"}},"example":{"external_customer_id":"crm_customer_123","email":"jane@example.com","name":"Jane Smith","phone":"+15555555555","prepay":true}}}}},"responses":{"201":{"description":"Customer created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"customer":{"$ref":"#/components/schemas/Customer"},"mailbox":{"type":"object","properties":{"box_number":{"type":"string","nullable":true},"mailbox_id":{"type":"string","nullable":true}}},"invite":{"type":"object","properties":{"sent":{"type":"boolean"},"activation_url":{"type":"string","format":"uri"},"token_expires_in":{"type":"integer"}}}}}}}}}},"400":{"description":"Invalid or malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency key reused with a different payload, or state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/customers/{customer_id}":{"get":{"tags":["Customers"],"security":[{"partnerApiKey":[]}],"operationId":"getCustomer","summary":"Retrieve customer","description":"Requires the `customers:read` scope.","x-required-scopes":["customers:read"],"parameters":[{"name":"customer_id","in":"path","required":true,"description":"Innbocks customer id, or your external id when `id_type=external`.","schema":{"type":"string"}},{"name":"id_type","in":"query","required":false,"description":"Set to `external` to resolve the path id against your external_customer_id.","schema":{"type":"string","enum":["external"]}}],"responses":{"200":{"description":"Customer","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Customer"}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Customers"],"security":[{"partnerApiKey":[]}],"operationId":"updateCustomer","summary":"Update customer","description":"Requires the `customers:write` scope.","x-required-scopes":["customers:write"],"parameters":[{"name":"customer_id","in":"path","required":true,"description":"Innbocks customer id, or your external id when `id_type=external`.","schema":{"type":"string"}},{"name":"id_type","in":"query","required":false,"description":"Set to `external` to resolve the path id against your external_customer_id.","schema":{"type":"string","enum":["external"]}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Client-generated key to make retries of this write safe.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"phone":{"type":"string"},"prepay":{"type":"boolean"},"plan_id":{"type":"string","nullable":true},"external_customer_id":{"type":"string","nullable":true}}}}}},"responses":{"200":{"description":"Customer updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Customer"}}}}}},"400":{"description":"Invalid or malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency key reused with a different payload, or state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/customers/{customer_id}/deactivate":{"post":{"tags":["Customers"],"security":[{"partnerApiKey":[]}],"operationId":"deactivateCustomer","summary":"Deactivate customer","description":"Requires the `customers:write` scope.","x-required-scopes":["customers:write"],"parameters":[{"name":"customer_id","in":"path","required":true,"description":"Innbocks customer id, or your external id when `id_type=external`.","schema":{"type":"string"}},{"name":"id_type","in":"query","required":false,"description":"Set to `external` to resolve the path id against your external_customer_id.","schema":{"type":"string","enum":["external"]}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Client-generated key to make retries of this write safe.","schema":{"type":"string"}}],"responses":{"200":{"description":"Customer deactivated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Customer"}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency key reused with a different payload, or state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/customers/{customer_id}/mailbox":{"get":{"tags":["Mailboxes"],"security":[{"partnerApiKey":[]}],"operationId":"getCustomerMailbox","summary":"Retrieve mailbox assignment","description":"Requires the `customers:read` scope.","x-required-scopes":["customers:read"],"parameters":[{"name":"customer_id","in":"path","required":true,"description":"Innbocks customer id, or your external id when `id_type=external`.","schema":{"type":"string"}},{"name":"id_type","in":"query","required":false,"description":"Set to `external` to resolve the path id against your external_customer_id.","schema":{"type":"string","enum":["external"]}}],"responses":{"200":{"description":"Mailbox","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Mailbox"}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/customers/{customer_id}/compliance":{"get":{"tags":["Compliance"],"security":[{"partnerApiKey":[]}],"operationId":"getCustomerCompliance","summary":"Retrieve compliance status","description":"Requires the `customers:read` scope. Returns Form 1583, ID, and notary state.","x-required-scopes":["customers:read"],"parameters":[{"name":"customer_id","in":"path","required":true,"description":"Innbocks customer id, or your external id when `id_type=external`.","schema":{"type":"string"}},{"name":"id_type","in":"query","required":false,"description":"Set to `external` to resolve the path id against your external_customer_id.","schema":{"type":"string","enum":["external"]}}],"responses":{"200":{"description":"Compliance","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Compliance"}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/customers/{customer_id}/mail":{"get":{"tags":["Mail"],"security":[{"partnerApiKey":[]}],"operationId":"listCustomerMail","summary":"List customer mail","description":"Requires the `mail:read` scope.","x-required-scopes":["mail:read"],"parameters":[{"name":"customer_id","in":"path","required":true,"description":"Innbocks customer id, or your external id when `id_type=external`.","schema":{"type":"string"}},{"name":"id_type","in":"query","required":false,"description":"Set to `external` to resolve the path id against your external_customer_id.","schema":{"type":"string","enum":["external"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"type","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Mail list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"mail":{"type":"array","items":{"$ref":"#/components/schemas/Mail"}},"next_cursor":{"type":"string","nullable":true}}}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/mailboxes/available":{"get":{"tags":["Mailboxes"],"security":[{"partnerApiKey":[]}],"operationId":"listAvailableMailboxes","summary":"List available precreated mailboxes","description":"Requires the `customers:read` scope. Only returns mailboxes when the vendor uses precreated assignment.","x-required-scopes":["customers:read"],"parameters":[{"name":"limit","in":"query","description":"Maximum number of items to return per page.","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","description":"Pagination cursor from a previous response's `next_cursor`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Available mailboxes","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"mailboxes":{"type":"array","items":{"$ref":"#/components/schemas/AvailableMailbox"}},"next_cursor":{"type":"string","nullable":true},"assignment_mode":{"type":"string"}}}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/mail/{mail_id}":{"get":{"tags":["Mail"],"security":[{"partnerApiKey":[]}],"operationId":"getMailItem","summary":"Retrieve mail item","description":"Requires the `mail:read` scope. Image/PDF URLs are short-lived presigned links.","x-required-scopes":["mail:read"],"parameters":[{"name":"mail_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Mail item","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Mail"}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Mail"],"security":[{"partnerApiKey":[]}],"operationId":"updateMailItem","summary":"Update mail item (partner write-back)","description":"Requires the `mail:write` scope. Stamps your own reference, bin location, notes, and smart-locker handoff state on any of the store's mail items. Sending a key with `null` clears it; omitted keys are untouched. Setting `locker.status` to `deposited` sends the customer the locker number and access code by email/SMS unless `notify_customer` is false, and emits `mail.locker_updated`. Use the `collected` action to record the pickup.","x-required-scopes":["mail:write"],"parameters":[{"name":"mail_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Client-generated key to make retries of this write safe.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"external_reference":{"type":"string","nullable":true,"maxLength":200},"bin_location":{"type":"string","nullable":true,"maxLength":200},"description":{"type":"string","nullable":true,"maxLength":2000},"notes":{"type":"string","nullable":true,"maxLength":2000},"notify_customer":{"type":"boolean","default":true,"description":"Send the locker details to the customer when the item is marked deposited."},"locker":{"type":"object","properties":{"provider":{"type":"string","nullable":true},"number":{"type":"string","nullable":true},"access_code":{"type":"string","nullable":true},"status":{"type":"string","enum":["assigned","deposited"]}}}},"example":{"external_reference":"locker-job-8841","locker":{"provider":"Luxer One","number":"12","access_code":"4821","status":"deposited"}}}}}},"responses":{"200":{"description":"Mail item updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"mail":{"$ref":"#/components/schemas/Mail"},"customer_notification":{"type":"object","nullable":true,"description":"Present when a locker-ready notification was attempted.","properties":{"status":{"type":"string"}}}}}}}}}},"400":{"description":"Invalid or malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Locker fields cannot change: the item was already collected (`locker_already_collected`), is not waiting for pickup (`mail_status_conflict`), or changed during the update (`mail_changed`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Mail"],"security":[{"partnerApiKey":[]}],"operationId":"deleteMailItem","summary":"Delete partner-created mail item","description":"Requires the `mail:write` scope. Only mail your integration created can be deleted.","x-required-scopes":["mail:write"],"parameters":[{"name":"mail_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Client-generated key to make retries of this write safe.","schema":{"type":"string"}}],"responses":{"200":{"description":"Mail item deleted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean"},"mail":{"$ref":"#/components/schemas/Mail"}}}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Mail item was not created by your integration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency key reused with a different payload, or state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/mail":{"get":{"tags":["Mail"],"security":[{"partnerApiKey":[]}],"operationId":"listMail","summary":"List mail across all customers","description":"Requires the `mail:read` scope. Returns the vendor's mail items newest cursors last; filter by customer, status, type, or received-at range. Image/PDF URLs are short-lived presigned links.","x-required-scopes":["mail:read"],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"customer_id","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"type","in":"query","schema":{"type":"string"}},{"name":"received_after","in":"query","description":"ISO-8601; filters on the mail's created/received time.","schema":{"type":"string","format":"date-time"}},{"name":"received_before","in":"query","description":"ISO-8601; filters on the mail's created/received time.","schema":{"type":"string","format":"date-time"}},{"name":"external_reference","in":"query","description":"Exact match on the reference your integration stamped via PATCH.","schema":{"type":"string"}}],"responses":{"200":{"description":"Mail list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"mail":{"type":"array","items":{"$ref":"#/components/schemas/Mail"}},"next_cursor":{"type":"string","nullable":true}}}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Mail"],"security":[{"partnerApiKey":[]}],"operationId":"createMail","summary":"Create inbound mail or package","description":"Requires the `mail:write` scope. Innbocks verifies the customer belongs to you, has active billing/prepay, and an active/compliant mailbox before emitting `mail.arrived`/`package.arrived`.","x-required-scopes":["mail:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Client-generated key to make retries of this write safe.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["customer_id","type","photos","performed_by"],"properties":{"customer_id":{"type":"string"},"type":{"type":"string","enum":["letter","large_envelope","flat","package","certified","check","legal_mail"]},"photos":{"type":"array","minItems":1,"items":{"type":"string","format":"uri"}},"performed_by":{"type":"string","description":"Partner personnel/operator identifier for custody tracking."},"description":{"type":"string"},"tracking_number":{"type":"string"},"received_at":{"type":"string","format":"date-time"}},"example":{"customer_id":"cus_123","type":"package","photos":["https://example.com/package-front.jpg"],"performed_by":"warehouse_user_42","tracking_number":"1Z9999999999999999"}}}}},"responses":{"201":{"description":"Mail created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Mail"}}}}}},"400":{"description":"Invalid or malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency key reused with a different payload, or state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/mail/{mail_id}/scan":{"post":{"operationId":"requestMailScan","tags":["Mail actions"],"security":[{"partnerApiKey":[]}],"summary":"Request scan","description":"Requires the `mail_actions:write` scope. Creates a scan service request for an operator to fulfill.","x-required-scopes":["mail_actions:write"],"parameters":[{"name":"mail_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Client-generated key to make retries of this write safe.","schema":{"type":"string"}}],"responses":{"202":{"description":"Request accepted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"action":{"$ref":"#/components/schemas/ServiceRequest"},"mail":{"$ref":"#/components/schemas/Mail"}}}}}}}},"400":{"description":"Invalid or malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency key reused with a different payload, or state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/mail/{mail_id}/forward":{"post":{"operationId":"requestMailForward","tags":["Mail actions"],"security":[{"partnerApiKey":[]}],"summary":"Request forwarding","description":"Requires the `mail_actions:write` scope. Creates a forward service request for an operator to fulfill.","x-required-scopes":["mail_actions:write"],"parameters":[{"name":"mail_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Client-generated key to make retries of this write safe.","schema":{"type":"string"}}],"responses":{"202":{"description":"Request accepted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"action":{"$ref":"#/components/schemas/ServiceRequest"},"mail":{"$ref":"#/components/schemas/Mail"}}}}}}}},"400":{"description":"Invalid or malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency key reused with a different payload, or state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/mail/{mail_id}/shred":{"post":{"operationId":"requestMailShred","tags":["Mail actions"],"security":[{"partnerApiKey":[]}],"summary":"Request shredding","description":"Requires the `mail_actions:write` scope. Creates a shred service request for an operator to fulfill.","x-required-scopes":["mail_actions:write"],"parameters":[{"name":"mail_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Client-generated key to make retries of this write safe.","schema":{"type":"string"}}],"responses":{"202":{"description":"Request accepted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"action":{"$ref":"#/components/schemas/ServiceRequest"},"mail":{"$ref":"#/components/schemas/Mail"}}}}}}}},"400":{"description":"Invalid or malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency key reused with a different payload, or state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/mail/{mail_id}/pickup":{"post":{"operationId":"requestMailPickup","tags":["Mail actions"],"security":[{"partnerApiKey":[]}],"summary":"Request pickup","description":"Requires the `mail_actions:write` scope. Creates a pickup service request for an operator to fulfill. If the store has configured pickup hours, the requested slot must fall on an open day inside the open window, avoid blackout dates, and satisfy the minimum notice; otherwise the request is rejected with `422` and code `pickup_unavailable`.","x-required-scopes":["mail_actions:write"],"parameters":[{"name":"mail_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Client-generated key to make retries of this write safe.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["pickup_date","pickup_time"],"properties":{"pickup_date":{"type":"string","description":"Calendar date, YYYY-MM-DD, in the store's local time."},"pickup_time":{"type":"string","description":"24-hour clock time, HH:MM, in the store's local time."},"notes":{"type":"string"}}}}}},"responses":{"202":{"description":"Request accepted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"action":{"$ref":"#/components/schemas/ServiceRequest"},"mail":{"$ref":"#/components/schemas/Mail"}}}}}}}},"400":{"description":"Invalid or malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency key reused with a different payload, or state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Requested slot is outside the store's pickup hours","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/mail/{mail_id}/collected":{"post":{"tags":["Mail"],"security":[{"partnerApiKey":[]}],"operationId":"markMailCollected","summary":"Mark mail item collected by the customer","description":"Requires the `mail:write` scope. Records that the customer took the item, typically out of a smart locker: the item is completed like the counter's Confirm Picked Up (status `done`), the locker record is closed, a PICKED_UP chain-of-custody event is written, and `mail.picked_up` is emitted. Only items still on hand and waiting for the customer can be collected: new mail, a scheduled pickup, or scanned mail; a repeat call returns the completed item unchanged. When the store requires a pickup signature and/or handover photo, send `signature_data_url` and/or `pickup_photo_url` or the call returns 422 `pickup_evidence_required`.","x-required-scopes":["mail:write"],"parameters":[{"name":"mail_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Client-generated key to make retries of this write safe.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"collected_at":{"type":"string","format":"date-time","description":"Defaults to now."},"collected_by":{"type":"string","description":"Name of the person who collected, for the custody record."},"performed_by":{"type":"string","description":"Your system or operator identifier."},"external_reference":{"type":"string"},"signature_data_url":{"type":"string","description":"Customer signature as a PNG, JPEG, or WebP base64 data URL. Required when the store requires a pickup signature."},"pickup_photo_url":{"type":"string","description":"Key of a handover photo already uploaded to the store's storage. Required when the store requires a pickup photo."}}}}}},"responses":{"200":{"description":"Mail item collected","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"collected":{"type":"boolean"},"already_completed":{"type":"boolean"},"mail":{"$ref":"#/components/schemas/Mail"}}}}}}}},"400":{"description":"Invalid or malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Item is not waiting for pickup","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The store's required pickup signature or photo was not supplied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/webhook-events":{"get":{"tags":["Webhooks"],"security":[{"partnerApiKey":[]}],"operationId":"listWebhookEventTypes","summary":"List webhook event types","description":"Requires the `webhooks:read` scope.","x-required-scopes":["webhooks:read"],"responses":{"200":{"description":"Webhook events","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}},"endpoint_management":{"type":"object","properties":{"mode":{"type":"string"},"path":{"type":"string"},"api_path":{"type":"string"}}}}}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/webhook-deliveries":{"get":{"tags":["Webhooks"],"security":[{"partnerApiKey":[]}],"operationId":"listWebhookDeliveries","summary":"List webhook deliveries","description":"Requires the `webhooks:read` scope.","x-required-scopes":["webhooks:read"],"parameters":[{"name":"limit","in":"query","description":"Maximum number of items to return per page.","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","description":"Pagination cursor from a previous response's `next_cursor`.","schema":{"type":"string"}},{"name":"event_type","in":"query","schema":{"$ref":"#/components/schemas/WebhookEvent"}},{"name":"status","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Webhook deliveries","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"next_cursor":{"type":"string","nullable":true}}}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/webhook-endpoints":{"get":{"tags":["Webhooks"],"security":[{"partnerApiKey":[]}],"operationId":"listWebhookEndpoints","summary":"List webhook endpoints","description":"Requires the `webhooks:read` scope. Secrets are never listed. An OAuth access token lists only the endpoints your app registered; a key created in the store's dashboard lists all of the store's endpoints.","x-required-scopes":["webhooks:read"],"responses":{"200":{"description":"Webhook endpoints","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"webhook_endpoints":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}}}}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Webhooks"],"security":[{"partnerApiKey":[]}],"operationId":"createWebhookEndpoint","summary":"Create a webhook endpoint","description":"Requires the `webhooks:write` scope. Registers an HTTPS URL to receive the store's events and returns its signing `secret` once. Omit `event_types` to receive every event. A store can have at most 20 endpoints (`409 endpoint_limit_reached`). An endpoint created with an OAuth access token is removed when the store disconnects your app. A retry with the same `Idempotency-Key` replays the endpoint without its `secret`; use `rotate_secret` if the first response was lost.","x-required-scopes":["webhooks:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Client-generated key to make retries of this write safe.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","description":"HTTPS URL that receives the events."},"event_types":{"type":"array","items":{"type":"string"},"description":"Event names from GET /api/v1/webhook-events, or `*`."}}}}}},"responses":{"201":{"description":"Webhook endpoint created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"webhook_endpoint":{"$ref":"#/components/schemas/WebhookEndpoint"}}}}}}}},"400":{"description":"Invalid or malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency key reused with a different payload, or state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/webhook-endpoints/{endpoint_id}":{"patch":{"tags":["Webhooks"],"security":[{"partnerApiKey":[]}],"operationId":"updateWebhookEndpoint","summary":"Update a webhook endpoint","description":"Requires the `webhooks:write` scope. Send any of `url`, `enabled`, `event_types`, or `rotate_secret: true`; a rotated `secret` is returned once in the response. An OAuth access token can change only the endpoints your app registered; any other id returns `404`.","x-required-scopes":["webhooks:write"],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"HTTPS URL that receives the events."},"event_types":{"type":"array","items":{"type":"string"},"description":"Event names from GET /api/v1/webhook-events, or `*`."},"enabled":{"type":"boolean"},"rotate_secret":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Webhook endpoint","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"webhook_endpoint":{"$ref":"#/components/schemas/WebhookEndpoint"}}}}}}}},"400":{"description":"Invalid or malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Webhooks"],"security":[{"partnerApiKey":[]}],"operationId":"deleteWebhookEndpoint","summary":"Delete a webhook endpoint","description":"Requires the `webhooks:write` scope. Also deletes its delivery history. An OAuth access token can delete only the endpoints your app registered.","x-required-scopes":["webhooks:write"],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean"}}}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/locations":{"get":{"tags":["Locations"],"security":[{"partnerApiKey":[]}],"operationId":"listLocations","summary":"List store locations","description":"Requires the `customers:read` scope. Lists a multi-location store's locations, default first; pass a location's `id` as `location_id` when creating a customer. A single-location store returns `multi_location: false` and an empty list, and its customers are created without a `location_id`.","x-required-scopes":["customers:read"],"responses":{"200":{"description":"Locations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"multi_location":{"type":"boolean"},"locations":{"type":"array","items":{"$ref":"#/components/schemas/Location"}}}}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/customers/{customer_id}/login-link":{"post":{"tags":["Customers"],"security":[{"partnerApiKey":[]}],"operationId":"createCustomerLoginLink","summary":"Create a one-time portal sign-in link","description":"Requires the `customers:login_link` scope, which only OAuth clients registered by Innbocks for a partner integration can hold. Returns a URL on the store's own portal that signs this customer in without a password: send the customer's browser to it straight away. `kind: login` links work once and expire after two minutes. A customer who has not set a password yet gets `kind: activation` instead, a 30-minute link to choose one, after which they are in their portal. Closed and locked accounts return `409 customer_cannot_sign_in`.","x-required-scopes":["customers:login_link"],"parameters":[{"name":"customer_id","in":"path","required":true,"description":"Innbocks customer id, or your external id when `id_type=external`.","schema":{"type":"string"}},{"name":"id_type","in":"query","required":false,"description":"Set to `external` to resolve the path id against your external_customer_id.","schema":{"type":"string","enum":["external"]}}],"responses":{"201":{"description":"Login link","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"login_link":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"kind":{"type":"string","enum":["login","activation"]},"expires_at":{"type":"string","format":"date-time"}}}}}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The customer's account is closed or locked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/billing/usage":{"get":{"tags":["Billing"],"security":[{"partnerApiKey":[]}],"operationId":"getBillingUsage","summary":"Read active mailbox usage","description":"Requires the `billing:read` scope. Returns the active mailboxes billed to your store for the current period and the estimated platform fee. An active mailbox is a store-billed (`prepay: true`) customer whose status is `active`; invites, inactive customers and customers paying through Stripe Connect are not counted. The fee is an estimate; your Innbocks invoice is authoritative.","x-required-scopes":["billing:read"],"responses":{"200":{"description":"Usage","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Usage"}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/reports/summary":{"get":{"tags":["Billing"],"security":[{"partnerApiKey":[]}],"operationId":"getStoreReport","summary":"Read the month-to-date store report","description":"Requires the `billing:read` scope. Returns the figures behind the dashboard Reports page for the current calendar month in the store's time zone: mail received, requests completed by type, money collected, customers joined and cancelled, and mailbox occupancy, for the whole store and for each location. `collected_cents` counts successful card payments made through Innbocks (plan invoices and service fees); cash and offline payments are not included. Previous-month figures cover the same days of last month.","x-required-scopes":["billing:read"],"responses":{"200":{"description":"Store report","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StoreReport"}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/plans":{"get":{"tags":["Plans"],"security":[{"partnerApiKey":[]}],"operationId":"listPlans","summary":"List plans","description":"Requires the `plans:read` scope. Lists the vendor's plans so you can discover a valid `plan_id` before assigning one on customer create/update. Active plans only unless `include_inactive=true`.","x-required-scopes":["plans:read"],"parameters":[{"name":"limit","in":"query","description":"Maximum number of items to return per page.","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","description":"Pagination cursor from a previous response's `next_cursor`.","schema":{"type":"string"}},{"name":"include_inactive","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Plans","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"plans":{"type":"array","items":{"$ref":"#/components/schemas/Plan"}},"next_cursor":{"type":"string","nullable":true}}}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/customers/{customer_id}/credits":{"get":{"tags":["Credits"],"security":[{"partnerApiKey":[]}],"operationId":"getCustomerCredits","summary":"Retrieve credit balance and mail allowance","description":"Requires the `credits:read` scope. Returns the customer's service-credit balance in cents, credits expiring within 30 days, items held past the monthly mail allowance, this month's allowance usage, and auto top-up settings.","x-required-scopes":["credits:read"],"parameters":[{"name":"customer_id","in":"path","required":true,"description":"Innbocks customer id, or your external id when `id_type=external`.","schema":{"type":"string"}},{"name":"id_type","in":"query","required":false,"description":"Set to `external` to resolve the path id against your external_customer_id.","schema":{"type":"string","enum":["external"]}}],"responses":{"200":{"description":"Credits","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"credits":{"type":"object","properties":{"enabled":{"type":"boolean"},"balance_cents":{"type":"integer"},"expiring_soon_cents":{"type":"integer"},"expiring_soon_at":{"type":"string","format":"date-time","nullable":true},"held_count":{"type":"integer"},"held_cents":{"type":"integer"},"allowance":{"type":"object","nullable":true,"properties":{"included_items":{"type":"integer"},"used_items":{"type":"integer"},"overage_cents":{"type":"integer"},"policy":{"type":"string","enum":["hold","bill"]},"counts_packages":{"type":"boolean"}}},"auto_top_up":{"type":"object","properties":{"bundle_id":{"type":"string","nullable":true},"threshold_cents":{"type":"integer","nullable":true}}}}}}}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/customers/{customer_id}/credits/ledger":{"get":{"tags":["Credits"],"security":[{"partnerApiKey":[]}],"operationId":"listCustomerCreditLedger","summary":"List credit ledger entries","description":"Requires the `credits:read` scope. Newest first. Lots (purchase, bonus, vendor_grant, plan_grant, reversal) carry `remaining_cents`; consumption and expiry rows are negative and reference the mail item or service request they paid for.","x-required-scopes":["credits:read"],"parameters":[{"name":"customer_id","in":"path","required":true,"description":"Innbocks customer id, or your external id when `id_type=external`.","schema":{"type":"string"}},{"name":"id_type","in":"query","required":false,"description":"Set to `external` to resolve the path id against your external_customer_id.","schema":{"type":"string","enum":["external"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"before","in":"query","schema":{"type":"string"},"description":"Entry id to page backwards from."}],"responses":{"200":{"description":"Ledger","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["purchase","bonus","vendor_grant","plan_grant","reversal","consumption","expiry"]},"amount_cents":{"type":"integer"},"remaining_cents":{"type":"integer","nullable":true},"expires_at":{"type":"string","format":"date-time","nullable":true},"reason_code":{"type":"string","nullable":true},"note":{"type":"string","nullable":true},"service_request_id":{"type":"string","nullable":true},"mail_id":{"type":"string","nullable":true},"bundle_id":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}}}},"has_more":{"type":"boolean"},"next_before":{"type":"string","nullable":true}}}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/customers/{customer_id}/credits/grant":{"post":{"tags":["Credits"],"security":[{"partnerApiKey":[]}],"operationId":"grantCustomerCredits","summary":"Grant credits","description":"Requires the `credits:write` scope. Adds credits to the customer's balance, for example after a payment at your counter. Send an `Idempotency-Key`; a retry with the same key returns the original grant. Credits are applied to held mail and queued fees immediately.","x-required-scopes":["credits:write"],"parameters":[{"name":"customer_id","in":"path","required":true,"description":"Innbocks customer id, or your external id when `id_type=external`.","schema":{"type":"string"}},{"name":"id_type","in":"query","required":false,"description":"Set to `external` to resolve the path id against your external_customer_id.","schema":{"type":"string","enum":["external"]}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Client-generated key to make retries of this write safe.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["amount_cents","reason_code"],"properties":{"amount_cents":{"type":"integer","minimum":1,"maximum":100000},"reason_code":{"type":"string","enum":["paid_offline","courtesy","migration","promotion","plan_included"]},"note":{"type":"string","maxLength":500},"expires_at":{"type":"string","format":"date-time"}}}}}},"responses":{"201":{"description":"Grant","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"grant":{"type":"object","properties":{"entry_id":{"type":"string"},"amount_cents":{"type":"integer"},"reason_code":{"type":"string"},"balance_cents":{"type":"integer"},"settled_cents":{"type":"integer"},"replayed":{"type":"boolean"}}}}}}}}}},"401":{"description":"Missing, invalid, or insufficiently-scoped API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}