Skip to content

API Integration

Access your MyCompanyDesk data programmatically through the REST API.

INFO

API access is part of the Pro plan.

Overview

The MyCompanyDesk API lets you:

  • Create and retrieve invoices, expenses, and customers
  • Automate billing workflows
  • Integrate with other business tools
  • Build custom reporting
  • Sync data with external systems

Authentication

Send your API key in the X-API-Key request header:

bash
curl -X GET "https://api.mycompanydesk.com/api/invoices" \
  -H "X-API-Key: mcd_live_xxxxx"

The Authorization: Bearer header is used for browser sessions only. API keys always go in X-API-Key.

Creating an API key

  1. Go to Settings > API Keys
  2. Click Create API Key
  3. Give the key a descriptive name and choose its permissions
  4. Copy the key right away, it is only shown once

When creating a key you can set:

  • Scopes: Read (view data), Write (create, update, and delete), and Admin (full access)
  • IP allowlist (optional): restrict the key to specific IP addresses
  • Expiration (optional): 30 days, 90 days, 1 year, or never

You can revoke a key at any time from the same page. Revoked keys lose access immediately.

WARNING

Store your API key securely. Never commit it to source control or share it publicly.

Base URL

All API endpoints are available at:

https://api.mycompanydesk.com/api

Key endpoints

Customers

MethodEndpointDescription
GET/customersList all customers
POST/customersCreate a customer
GET/customers/:idGet a customer
PUT/customers/:idUpdate a customer
DELETE/customers/:idDelete a customer

Invoices

MethodEndpointDescription
GET/invoicesList all invoices
POST/invoicesCreate an invoice
GET/invoices/:idGet an invoice
PUT/invoices/:idUpdate an invoice
DELETE/invoices/:idDelete an invoice
GET/invoices/:id/pdfDownload the invoice PDF
POST/invoices/:id/emailSend the invoice by email
POST/invoices/:id/reminderSend a payment reminder
POST/invoices/:id/duplicateDuplicate an invoice
POST/invoices/:id/credit-noteCreate a credit note

Expenses

MethodEndpointDescription
GET/expensesList all expenses
POST/expensesCreate an expense
GET/expenses/:idGet an expense
PUT/expenses/:idUpdate an expense
DELETE/expenses/:idDelete an expense

Projects

MethodEndpointDescription
GET/projectsList all projects
POST/projectsCreate a project
GET/projects/:idGet a project
PUT/projects/:idUpdate a project
DELETE/projects/:idDelete a project
MethodEndpointDescription
GET/search?q=term&type=entitySearch across entities

Filtering

List endpoints support query parameters for filtering:

GET /api/invoices?status=sent&customer_id=123&limit=50

Common filters:

  • status: filter by status
  • customer_id: filter by customer
  • search: free-text search
  • date_from / date_to: filter by date range
  • limit: number of results
  • offset: pagination offset

Rate limiting

API requests are rate-limited to 200 requests per minute. Every response includes X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers. Exceeding the limit returns a 429 Too Many Requests response with a Retry-After header, so include a retry strategy in your integration.

Error handling

The API returns standard HTTP status codes:

CodeDescription
200Success
201Created
400Bad request (check your parameters)
401Unauthorized (invalid API key)
403Forbidden (insufficient permissions)
404Not found
429Rate limited
500Server error

Error responses include a JSON body:

json
{
  "error": "Description of what went wrong"
}

Webhooks

Webhooks notify your systems in real time when something happens in your account. Set them up in Settings > Webhooks: give the webhook a name and a URL, and pick the events you want to receive.

Available events:

  • invoice.created, invoice.updated, invoice.paid, invoice.overdue
  • expense.created, expense.updated, expense.deleted
  • customer.created, customer.updated
  • inbox.thread.received, inbox.message.received
  • test.ping (for testing your endpoint)

Each delivery is an HTTP POST with a JSON body:

json
{
  "id": "event id",
  "type": "invoice.paid",
  "company_id": 123,
  "created_at": "2026-07-02T12:00:00.000Z",
  "data": { }
}

Verifying deliveries

Every webhook has a signing secret, shown once when you create it (you can rotate it later). Each delivery includes an X-MCD-Signature header containing an HMAC-SHA256 hash (hex) of the raw request body, computed with your signing secret. Recompute the hash on your side and compare it to the header before trusting the payload. The X-MCD-Event-Type, X-MCD-Event-Id, and X-MCD-Delivery-Id headers identify the delivery.

Retries

Failed deliveries are retried automatically with increasing delays. An endpoint that keeps failing is disabled automatically; re-enable it from the webhooks page once your endpoint is healthy again.

Tips

  • Use pagination for large datasets
  • Cache responses where appropriate to reduce API calls
  • Implement retry logic with exponential backoff for rate limits
  • Use webhooks instead of polling for real-time updates

MyCompanyDesk — Accounting made simple.