Skip to main content
Yosavo Studio by Youssef Ibaichou , home
Expertise

API Development

APIs are the contract between systems. I approach API development around predictable behavior, clear ownership, security, validation and long-term maintainability rather than simply exposing database operations over HTTP.

API design · Error handling · Idempotency · Webhooks

How I think about it

How I think about APIs

A good API should make expected behavior obvious and failure behavior predictable. Clients should not need to guess how authentication, validation, pagination or errors work.

  • Make the contract explicit and the errors boring.
  • Authorize every resource, on every request.
  • Design writes so they are safe to retry.
  • Treat every external provider as unreliable.

Key experience

Where this comes from

  • Lead developer on a multi-tenant collaboration platform built around REST APIs — from API design to the frontend integration consuming them.
  • API-driven Laravel and Node.js backends consumed by Vue.js and React frontends, including service-to-service APIs with a Python microservice on Yotria.
  • Stripe payment integration on Nexus Inclusion and a private client project.

Scope

What I know

  • Resource-oriented design
  • Status codes & conventions
  • Schema validation
  • Response design
  • Consistent error formats
  • Authentication methods
  • Tenant-aware authorization
  • Versioning & compatibility
  • Offset & cursor pagination
  • Idempotency keys
  • Webhooks
  • Third-party integrations
  • API documentation
  • Contract testing

Deep dive

API Development in practice

On this page (15 topics)

API design

Endpoints describe resources and their relationships — /organizations/{id}/members — and HTTP methods describe the action. Status codes carry meaning clients can rely on: 201 for creation, 204 for no content, 404 when a resource doesn't exist or isn't visible to the caller, 409 for conflicts, 422 for validation failures.

Predictability beats cleverness: the same naming, date formats, ID formats and casing on every endpoint, so a developer who has used one endpoint can guess how the next one works.

  1. Client

  2. API layer

    auth, validation

  3. Service

    business rules

  4. Data / external provider

    scoped, mapped

API request path: the client calls the API layer, which authenticates and validates before a service applies business rules against the data store or an external provider.

Request validation

Validation happens at the boundary, against an explicit schema: required fields, types, formats, allowed values, lengths. Unknown fields are rejected or ignored deliberately, never silently stored. The error response says exactly which field failed and why, in a structure the client can map back onto its form.

Response design

Responses are shaped for clients, not copied from the database: internal columns stay internal, and renaming a database field doesn't change the contract. Envelopes such as data and meta are useful when there's real metadata — pagination, totals, warnings — and noise when there isn't. Whichever choice is made, it's the same everywhere.

Error handling

Clients should be able to handle every error with one piece of code: the same structure for validation, authentication, authorization, not-found, conflict and server errors, with a stable machine-readable code and a human-readable message.

Internal errors return a generic message and a request ID. The stack trace goes to the logs, never to the client.

A consistent API error response
{
  "error": {
    "code": "validation_failed",
    "message": "The request contains invalid fields.",
    "fields": {
      "email": ["Enter a valid email address."],
      "role": ["Role must be one of: admin, member."]
    },
    "request_id": "req_8f2c1a"
  }
}

Authentication

The mechanism follows the client. First-party web apps on the same domain often do best with secure session cookies. Mobile apps and SPAs on other domains use short-lived access tokens with refresh. Server-to-server integrations use API keys or client credentials scoped to what the integration needs and rotatable without downtime. OAuth matters when users grant a third party access to their data — not as a default for every API.

Authorization

Authentication says who is calling; authorization decides what they may touch — on every request, for every resource. The checks run in order: does the resource exist within the caller's tenant, is the caller a member, does their role grant this action. Returning 404 rather than 403 for another tenant's resources avoids confirming they exist.

Related: Multi-Tenant SaaS expertise

Versioning

Versioning is a tool for breaking changes, not a ritual. Most evolution can be additive — new fields, new endpoints, new optional parameters — and stays backward compatible. When a breaking change is unavoidable for external clients, a new version with a deprecation period is kinder than a silent change. For an API used only by your own frontend and deployed together with it, versioning usually adds cost without benefit.

Pagination

Offset pagination (?page=3) is simple and supports jumping to a page, but it slows down on large tables and can skip or repeat items when rows are inserted while a client pages through. Cursor pagination (?after=…) is stable and efficient for feeds, syncs and large datasets, at the cost of random access.

I choose per endpoint: offsets for admin tables, cursors for anything large or continuously changing.

Filtering & sorting

Filters and sort fields are an allow-list, validated like any other input and never passed straight into a query. Each one is a performance commitment: an endpoint that allows sorting by any column across millions of rows needs indexes to match, or it becomes the slowest query in the system.

Idempotency

Networks fail after the server has done the work but before the client sees the response, so clients retry. For operations with side effects — payments, orders, invitations — a retry must not repeat the effect. The client sends an idempotency key; the server stores it with the result and returns the original result for a repeated key instead of performing the operation again.

If retrying a request can charge a customer twice, the API isn't finished.

Webhooks

Webhook handlers should assume events can be delayed, retried or delivered more than once. Processing should therefore be idempotent wherever duplicate execution could cause side effects.

In practice: verify the signature, store the event, return a 2xx quickly, and process it in a background job keyed on the event ID. Events can also arrive out of order, so handlers check the current state — or fetch the latest object from the provider — instead of trusting the order of arrival.

  1. Provider event

  2. Verify signature

  3. Store event

    keyed by event ID

  4. Acknowledge

    2xx, fast

  5. Process async

    idempotent

Webhook handling: verify the provider's signature, store the event, acknowledge quickly, then process it asynchronously and idempotently using the event ID.

Third-party integrations

Every external provider will eventually be slow, rate-limited or down. Calls get explicit timeouts, retries with backoff only for safe operations, respect for rate-limit headers, and caching for data that rarely changes. The provider's data model is mapped to yours at the edge, so their naming and quirks don't spread through the codebase — and switching providers stays possible.

Documentation

An API is only as usable as its documentation: each endpoint's purpose, authentication, parameters, responses and errors, with realistic examples. For public or partner APIs, an OpenAPI description generated from — or validated against — the code keeps documentation and behaviour aligned. Hand-written docs that drift are worse than none, because clients trust them.

Security

Authentication on every non-public endpoint, authorization on every resource, validation on every input. Rate limits protect login, password reset and expensive endpoints. Responses never include more data than the client needs — over-exposed fields are a common source of leaks. Logs record request IDs, routes and outcomes, not passwords, tokens or full payloads containing personal data.

Testing

API tests exercise the contract the way clients do: real HTTP requests against the application with a test database. The happy path is the smallest part. Validation failures, missing authentication, the wrong role, another tenant's resource, conflicts and retried requests are where the bugs that matter live. Response shapes are asserted, so an accidental contract change fails a test instead of a client.

In practice

Common problems I work with

  • Endpoints that return different error formats
  • Database columns exposed directly as the API contract
  • Missing authorization on nested or related resources
  • Retries that create duplicate payments or records
  • Webhooks processed twice or out of order
  • Documentation that no longer matches behaviour

Real products

How it connects to real products

APIs sit at the centre of the SaaS platforms and business systems I've built — between frontends, backends and third-party services.

  • Accessibility Technology / SaaS

    Nexus Inclusion

    API-driven SaaS: a React frontend on Node.js APIs, with Stripe payments and AWS Bedrock as integrated services.

  • SaaS / Portfolio Builder

    Yotria

    A Laravel API serving a React frontend, plus a Python microservice — APIs between services, not only between client and server.

    Coming soon
  • Enterprise SaaS

    Multi-Tenant Collaboration Platform

    Platform built around REST APIs — I led the architecture, backend, database design and the frontend integration consuming them.

    Private client project
  • School Management SaaS / EdTech

    Yo Madrassa

    School management SaaS with a Laravel backend serving the platform through APIs, alongside payments and role-based access.

  • Full-stack and lead developer roles

    Integrations & business systems

    Integrations, APIs and internal business systems built with Laravel and Node.js.

See all selected work

Related expertise

Laravel

Maintainable backends: structure, Eloquent, queues, authorization and SaaS patterns.

  • Application structure
  • Eloquent
  • Queues
  • Testing

Node.js

APIs, integrations and serverless workloads with careful async design.

  • API architecture
  • Async patterns
  • Serverless
  • Observability

SaaS Development

Tenancy, permissions, plans, billing and the realities of running SaaS in production.

  • Multi-tenancy
  • Permissions
  • Billing
  • Production delivery

AWS

Workload-first cloud architecture: serverless, storage, data, security and cost.

  • Serverless
  • S3 & DynamoDB
  • IAM
  • Cost awareness

Related services

  • Custom Software Development

    Build reliable web platforms, SaaS products, dashboards, APIs, and internal tools with modern full-stack technologies.

    Learn more
  • SaaS Product Development

    Design and build SaaS products from MVP to production, including architecture, user management, subscriptions, integrations and cloud infrastructure.

    Learn more
  • Technical Consulting

    Get practical technical guidance for architecture, code quality, performance, accessibility, cloud, and product planning.

    Learn more
Let's talk

Have a technical challenge?

Whether it's an architecture decision, a delivery problem or something specific to API Development, I can help you find a practical path forward.

What happens next

  1. Share your goal

    A few lines about the product, problem, or audit need.

  2. Get a quick read

    A practical reply on the best technical path forward.

  3. Move forward

    A clear scope, estimate, or concrete next step.