OfficeGest
Officegest api

Get started

Getting started with the OfficeGest API v2

OfficeGest API v2

The OfficeGest API v2 allows you to integrate external systems with OfficeGest through a simple and predictable REST interface.

The API v2 is in an experimental phase. Some endpoints may change without prior notice.

Before you start

Access to the OfficeGest API is subject to the following service rules.

Webservices module required

Your OfficeGest subscription must have the Webservices module active. Without it, API requests are refused.

Usage limits

OfficeGest offers several commercial plans, each with its own usage limits.

PlanPer minutePer month
Base plan200 requests100,000 requests

Need more? If your integration needs more requests, you can activate a plan with higher limits. Contact your account manager or Guisoft support.

Usage is reported on every response

Each JSON response tells you how many requests you still have available, so your integration can pace itself before hitting a limit.

WhereFieldMeaning
HeaderX-RateLimit-LimitRequests allowed per minute
HeaderX-RateLimit-RemainingRequests left in the current minute window
Bodymeta.monthly_limit / meta.monthly_remainingMonthly allowance and requests left
HeaderRetry-AfterSeconds to wait before retrying (only on 429 RATE_LIMITED)

You can check the limits currently enforced for your company at any time with GET /api/v2/utils/license (rate_limit_per_minute, rate_limit_per_month). For the full details, see Rate limits.

Refused requests (429) still count towards the monthly limit. Never retry in a tight loop — always wait for the time indicated in Retry-After.

Sandbox for testing

A Sandbox is available so you can develop and test your integration before going live.

  • Request your Sandbox credentials at join.officegest.com/sandbox.
  • Everything saved in the Sandbox is wiped daily, overnight.
  • Sandbox credentials are valid for 30 days.

The Sandbox is shared

The Sandbox is shared with other developers. Do not create or upload sensitive information there (real customer data, personal data, passwords, financial or confidential business data) — use fictitious test data only.

Access credentials

The API uses the same credentials as an OfficeGest user: the username and password of a regular OfficeGest user account. That user must:

  • be registered as an Employee (Colaborador);
  • have Web Access (Acesso Web) enabled;
  • have a strong password.

You authenticate once to obtain a token. Send the credentials to POST /api/v2/auth/login; the response returns a token that must be sent in the Authorization: Bearer header of every subsequent request (see Authentication below).

Permissions follow the user's privileges

What the API can read or change depends entirely on the privileges assigned to that employee in OfficeGest. If an endpoint returns 403 FORBIDDEN, review the user's privileges — not the API call.

Recommended: one employee per integration

Create a dedicated employee for each integration (e.g. api-eshop) instead of using a person's account, and grant it only the privileges the integration needs. This keeps access auditable and avoids integrations breaking when someone changes their password or leaves the company.

Base URL

Each OfficeGest installation has its own address. The base URL follows this format:

https://<your-domain>/api/v2

For example, if your OfficeGest is at https://company.officegest.com, the API base URL will be:

https://company.officegest.com/api/v2

Authentication

All API requests require a Bearer Token in the Authorization header.

Get your token

To obtain a Bearer Token, send a POST request to the login endpoint with your credentials:

curl -X POST https://company.officegest.com/api/v2/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username": "your-username", "password": "your-password"}'

The response will include your access token and when it expires:

{
  "data": {
    "access_token": "eyJhbGciOiJIUzI1NiIs...",
    "token_type": "Bearer",
    "expires_in": 86400,
    "expires_at": "2026-11-06T10:30:00+00:00",
    "user": { ... },
    "company": { ... },
    "permissions": [ ... ],
    "modules": [ ... ],
    "addons": [ ... ]
  }
}
FieldDescription
data.access_tokenThe token to send in the Authorization header.
data.token_typeAlways Bearer.
data.expires_inSeconds until the token expires (86400, which is 24 hours).
data.expires_atThe moment the token expires, in ISO 8601 with the UTC offset.

Keep your token safe. Do not expose it in client-side code or public repositories.

Token expiration

A token is valid for 24 hours. After that, any request with it returns 401 with data.code set to TOKEN_EXPIRED:

{
  "data": {
    "code": "TOKEN_EXPIRED",
    "message": "Authentication token has expired"
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}

When you receive TOKEN_EXPIRED, log in again to get a new token.

The expired token is deleted the first time it is detected. A second request with the same token returns UNAUTHENTICATED, not TOKEN_EXPIRED.

Include the token in every request

Add the Authorization header with the value Bearer followed by your access_token:

Authorization: Bearer eyJhbGciOiJIUzI1NiIs...

Your first request

Let's test the connection by making a simple request to list customers:

curl https://company.officegest.com/api/v2/entities/customers \
  -H "Authorization: Bearer your-token-here"
const response = await fetch("https://company.officegest.com/api/v2/entities/customers", {
  headers: {
    "Authorization": "Bearer your-token-here"
  }
});

const data = await response.json();
console.log(data);
import requests

response = requests.get(
    "https://company.officegest.com/api/v2/entities/customers",
    headers={"Authorization": "Bearer your-token-here"}
)

print(response.json())
$ch = curl_init("https://company.officegest.com/api/v2/entities/customers");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: Bearer your-token-here"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

echo $response;

If everything is set up correctly, you'll receive a JSON response with the list of customers.

API Responses

The API always returns JSON. A typical successful response:

{
  "data": [ ... ],
  "meta": {
    "current_page": 1,
    "total": 50
  }
}

Common errors

Every error has a stable data.code. The full catalog, the error body and examples are in Errors.

Statusdata.codeMeaningWhat to do
401UNAUTHENTICATEDMissing or invalid tokenCheck that the Authorization header is correct
401TOKEN_EXPIREDExpired tokenLog in again to get a new token; see Token expiration
401INVALID_CREDENTIALSWrong credentials on loginCheck the username and password sent to /auth/login
403FORBIDDENForbiddenYour token does not have access to this resource
404NOT_FOUNDNot foundCheck the endpoint URL
422VALIDATION_FAILEDInvalid dataCheck the fields listed in data.errors
429RATE_LIMITEDToo many requestsWait the seconds in Retry-After; see Rate limits
500INTERNAL_ERRORInternal errorContact support with the trace ID

OpenAPI specification

The public operations of the API v2 are available as an OpenAPI 3.0 document, at a fixed URL and without login, to import into Postman, Insomnia or a client generator:

https://api.officegest.com/docs/officegest-api/v2/openapi.json

Specification last updated on . Download openapi.json (557 operations).

Documentation sections

Explore the available endpoints by category in the sidebar.