# API Overview

Introduction

Welcome to the Gangmates API documentation. Our API allows developers to integrate with the Gangmates platform, providing access to features such as paystubs and user management. This document provides an overview of the available endpoints and how to interact with them.

### Base URLs

* **Staging Environment:** `https://stage.gangmates.com`
* **Production Environment:** `https://gangmates.com`

### Rate Limiting

Gangmates employs layered rate limiting to protect tenants and the platform. There are **two buckets** evaluated per request:

1. **Endpoint Bucket (per token + IP + route)**
   * Default: **100 requests/min**
   * **Sensitive endpoints:** **10 requests/min** (listed below)
2. **Global Bucket (per company + IP)**
   * **Standard:** 50 requests/min
   * **Premium:** 1,000 requests/min
   * **Enterprise:** 5,000 requests/min

> The **effective limit** is the stricter of the two. For example, a Standard plan calling a non‑sensitive endpoint is limited to **50/min** globally, even though the endpoint bucket allows 100/min.

### Endpoints

#### Paystubs

* **Get List of Paystubs**

  ```bash
  GET /api/paystubs
  ```

  Retrieves a list of paystubs for the authenticated company.
* **Create a New Paystub**

  ```bash
  POST /api/paystubs
  ```

  Creates a new paystub for the authenticated company.

#### Users

* **Get List of Users**

  ```bash
  GET /api/users
  ```

  Retrieves a list of users for the authenticated company.
* **Create a New User**

  ```bash
  POST /api/users
  ```

  Creates a new user for the authenticated company.
* **Get User by ID**

  ```bash
  GET /api/users/{id}
  ```

  Retrieves a user by their ID.
* **Update User by ID**

  ```bash
  PUT /api/users/{id}
  ```

  Updates a user by their ID.
* **Delete User by ID**

  ```bash
  DELETE /api/users/{id}
  ```

  Deletes a user by their ID.

### Error Handling

The API uses standard HTTP status codes to indicate the success or failure of an API request.

* `200 OK` - The request was successful.
* `201 Created` - The resource was successfully created.
* `400 Bad Request` - The request was invalid or cannot be otherwise served.
* `401 Unauthorized` - Authentication credentials were missing or incorrect.
* `404 Not Found` - The requested resource does not exist.
* `429 Too Many Requests` - The rate limit has been exceeded.

### Contact

For any questions or support, please contact our support team at <support@gangmates.com>.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gangmates.com/api-documentation/api-overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
