Gupy Department API
The Department API from Gupy, for department.
The Department API from Gupy, for department.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/gupy:gupy-department-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Gupy Admin Global Department API
description: Public API for Estrutura Organizacional - Only requires Bearer token authentication. The central-company-id is automatically extracted from the token.
version: '1.0'
contact: {}
servers:
- url: https://api.gupy.io
tags:
- name: Department
paths:
/os/v1/departments:
get:
description: Retrieves a paginated list of departments with optional filtering by name and external code.
operationId: OrganizationUnitPublicController_findOrganizationUnits_v1
parameters:
- name: name
required: false
in: query
description: Department name to filter (partial match)
schema:
example: Engineering
type: string
- name: externalCode
required: false
in: query
description: Department external code to filter (exact match)
schema:
example: DEP-001
type: string
- name: page
required: false
in: query
description: Page number for pagination
schema:
minimum: 1
default: 1
example: 1
type: number
- name: maxPageSize
required: false
in: query
description: Maximum page size for pagination
schema:
minimum: 1
maximum: 100
default: 10
example: 20
type: number
responses:
'200':
description: Departments retrieved successfully
content:
application/json:
example:
result:
data:
- uuid: d20dc017-80c6-4706-bbfe-549c1cc4d2c1
externalCode: DEP-001
name: Engineering Department
description: Department responsible for software development
costCenterCode: CC-001
page: 1
maxPageSize: 10
total: 1
totalPages: 1
'400':
description: Bad Request - Invalid query parameters
content:
application/json:
examples:
invalidPage:
summary: Invalid page parameter
value:
statusCode: 400
timestamp: '2025-05-29T21:00:00.000Z'
path: /os/v1/departments
method: GET
title: BadRequestException
message: Validation failed
errors:
- code: BadRequestException
target: ValidationPipe
message: externalCode should not be empty
invalidMaxPageSize:
summary: Invalid maxPageSize parameter
value:
statusCode: 400
timestamp: '2025-05-29T21:00:00.000Z'
path: /os/v1/departments
method: GET
title: BadRequestException
message: Validation failed
errors:
- code: BadRequestException
target: ValidationPipe
message: maxPageSize must not be greater than 100
'401':
description: Unauthorized - Invalid or missing token
content:
application/json:
example:
statusCode: 401
timestamp: '2026-02-18T19:21:54.468Z'
path: /v1/resource
method: GET
title: UnauthorizedException
message: Unauthorized
errors:
- code: UnauthorizedException
target: UnauthorizedException
message: Unauthorized
'500':
description: Internal Server Error - Unexpected failure
content:
application/json:
example:
statusCode: 500
timestamp: '2026-02-18T19:21:54.468Z'
path: /v1/resource
method: GET
title: InternalServerErrorException
message: Unexpected error occurred
errors:
- code: UnprocessableEntityException
target: Server
message: An unexpected error occurred. Please try again later.
security:
- bearer: []
- central-company-id: []
- company-uuid: []
summary: List departments with filtering and pagination
tags:
- Department
post:
description: 'Creates a new department in the company.
**Business Rules:**
- `name`: Required. Maximum 300 characters.
- `type`: Required. Must be a valid department type (e.g., DEPARTMENT).
- `externalCode`: Required. Maximum 50 characters. Must be unique within the company.
- `description`: Optional. Maximum 900 characters.
- `costCenter`: Optional. If provided, the cost center must exist in the company.
**Validation:**
- All required fields must be provided and not empty.
- The `externalCode` must not already exist for another department in the same company.
- If a `costCenter` is specified, it must be found by its `externalCode`.'
operationId: OrganizationUnitPublicController_create_v1
parameters: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateOrganizationUnitRequestDto'
examples:
basic:
summary: Basic department
value:
name: Produto
type: DEPARTMENT
externalCode: OU-F98
description: Department responsible for product development
withCostCenter:
summary: Department with cost center
value:
name: Engineering
type: DEPARTMENT
externalCode: OU-ENG-001
description: Engineering department
costCenter:
externalCode: CC_008
responses:
'201':
description: The department has been successfully created.
content:
application/json:
example:
result:
uuid: 550e8400-e29b-41d4-a716-446655440000
'400':
description: Bad Request - Validation errors
content:
application/json:
example:
statusCode: 400
timestamp: '2026-02-10T12:00:00.000Z'
path: /os/v1/departments
method: POST
title: BadRequestException
message: Validation failed
errors:
- code: ValidationError
target: name
message: name should not be empty
- code: ValidationError
target: externalCode
message: externalCode should not be empty
- code: ValidationError
target: type
message: type must be a valid enum value
'401':
description: Unauthorized - Invalid or missing token
content:
application/json:
example:
statusCode: 401
timestamp: '2026-02-18T19:21:54.466Z'
path: /os/v1/departments
method: POST
title: UnauthorizedException
message: Unauthorized
errors:
- code: UnauthorizedException
target: UnauthorizedException
message: Unauthorized
'409':
description: Conflict - department with the same external code already exists
content:
application/json:
example:
statusCode: 409
timestamp: '2026-02-10T12:00:00.000Z'
path: /os/v1/departments
method: POST
title: ConflictException
message: An department with this external code already exists in the company
errors:
- code: DEPARTMENT_ALREADY_EXISTS
target: externalCode
message: An department with this external code already exists in the company
'422':
description: Unprocessable Entity - Cost center not found or invalid data
content:
application/json:
example:
statusCode: 422
timestamp: '2026-02-10T12:00:00.000Z'
path: /os/v1/departments
method: POST
title: UnprocessableEntityException
message: The cost center with the provided external code was not found
errors:
- code: COST_CENTER_NOT_FOUND
target: costCenter.externalCode
message: The cost center with the provided external code was not found
'500':
description: Internal Server Error - Unexpected failure
content:
application/json:
example:
statusCode: 500
timestamp: '2026-02-18T19:21:54.466Z'
path: /os/v1/departments
method: POST
title: InternalServerErrorException
message: Unexpected error occurred
errors:
- code: UnprocessableEntityException
target: Server
message: An unexpected error occurred. Please try again later.
security:
- bearer: []
- central-company-id: []
- company-uuid: []
summary: Create a new department
tags:
- Department
/os/v1/departments/uuid/{uuid}:
get:
description: Retrieves a specific department by its UUID. Returns 404 if the department is not found.
operationId: OrganizationUnitPublicController_findOrganizationUnitByUuid_v1
parameters:
- name: uuid
required: true
in: path
description: Department UUID
schema:
format: uuid
example: d20dc017-80c6-4706-bbfe-549c1cc4d2c1
type: string
responses:
'200':
description: Department retrieved successfully
content:
application/json:
example:
result:
uuid: d20dc017-80c6-4706-bbfe-549c1cc4d2c1
externalCode: DEP-001
name: Engineering Department
description: Department responsible for software development
costCenterCode: CC-001
'401':
description: Unauthorized - Invalid or missing token
content:
application/json:
example:
statusCode: 401
timestamp: '2026-02-18T19:21:54.468Z'
path: /v1/resource
method: GET
title: UnauthorizedException
message: Unauthorized
errors:
- code: UnauthorizedException
target: UnauthorizedException
message: Unauthorized
'404':
description: Department not found
content:
application/json:
example:
statusCode: 404
timestamp: '2025-05-29T21:00:00.000Z'
path: /os/v1/departments/uuid/d20dc017-80c6-4706-bbfe-549c1cc4d2c1
method: GET
title: NotFoundException
message: Department with UUID d20dc017-80c6-4706-bbfe-549c1cc4d2c1 not found
errors:
- code: NotFoundException
target: NotFoundException
message: Department with UUID d20dc017-80c6-4706-bbfe-549c1cc4d2c1 not found
'500':
description: Internal Server Error - Unexpected failure
content:
application/json:
example:
statusCode: 500
timestamp: '2026-02-18T19:21:54.468Z'
path: /v1/resource
method: GET
title: InternalServerErrorException
message: Unexpected error occurred
errors:
- code: UnprocessableEntityException
target: Server
message: An unexpected error occurred. Please try again later.
security:
- bearer: []
- central-company-id: []
- company-uuid: []
summary: Get department by UUID
tags:
- Department
/os/v1/departments/{externalCode}:
put:
description: 'Updates the provided department fields.
**Business Rules:**
- `name`: Required. Maximum 300 characters.
- `description`: Optional. Maximum 900 characters.
- `type`: Optional. Must be one of: DEPARTMENT, SECTOR, SECTIONS.
- `costCenterCode`: Optional. If provided, the cost center must exist. Set to null to remove cost center.
- `externalCode`: Not editable in this endpoint.'
operationId: OrganizationUnitPublicController_update_v1
parameters:
- name: externalCode
required: true
in: path
description: Department external code
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateOrganizationUnitRequestDto'
examples:
updateDepartment:
summary: Update department with cost center
value:
name: Engineering and Platform
description: Department responsible for software and platform
type: DEPARTMENT
costCenterCode: CC_009
removeCostCenter:
summary: Update department removing cost center
value:
name: Engineering and Platform
description: Department responsible for software and platform
costCenterCode: null
responses:
'200':
description: Department updated successfully
'400':
description: Bad Request - Validation errors
'401':
description: Unauthorized - Invalid or missing token
content:
application/json:
example:
statusCode: 401
timestamp: '2026-02-18T19:21:54.467Z'
path: /os/v1/departments/:externalCode
method: PUT
title: UnauthorizedException
message: Unauthorized
errors:
- code: UnauthorizedException
target: UnauthorizedException
message: Unauthorized
'404':
description: Department not found
'409':
description: Conflict - Cost center not found
'500':
description: Internal Server Error - Unexpected failure
content:
application/json:
example:
statusCode: 500
timestamp: '2026-02-18T19:21:54.467Z'
path: /os/v1/departments/:externalCode
method: PUT
title: InternalServerErrorException
message: Unexpected error occurred
errors:
- code: UnprocessableEntityException
target: Server
message: An unexpected error occurred. Please try again later.
security:
- bearer: []
- central-company-id: []
- company-uuid: []
summary: Update an existing department
tags:
- Department
delete:
description: 'Deletes a department.
**Business Rules:**
• Department cannot be deleted if it is linked to active areas'
operationId: OrganizationUnitPublicController_deleteDepartment_v1
parameters:
- name: externalCode
required: true
in: path
description: The external code of the department to be deleted
schema:
type: string
maxLength: 50
responses:
'204':
description: Department successfully deleted
'400':
description: Bad Request - Department has active relationships (e.g. linked to areas)
content:
application/json:
example:
statusCode: 400
timestamp: '2025-05-29T21:00:00.000Z'
path: /v1/departments/{externalCode}
method: DELETE
title: BadRequestException
message: The department cannot be deleted because it has active relationships
errors:
- code: DEPARTMENT_HAS_ACTIVE_RELATIONSHIPS
target: BadRequestException
message: The department cannot be deleted because it has active relationships
'401':
description: Unauthorized - Invalid or missing token
content:
application/json:
example:
statusCode: 401
timestamp: '2026-02-18T19:21:54.469Z'
path: /v1/resource
method: GET
title: UnauthorizedException
message: Unauthorized
errors:
- code: UnauthorizedException
target: UnauthorizedException
message: Unauthorized
'404':
description: Not Found - Department not found
content:
application/json:
example:
statusCode: 404
timestamp: '2025-05-29T21:00:00.000Z'
path: /v1/departments/{externalCode}
method: DELETE
title: NotFoundException
message: Department with external code DEP-001 not found
errors:
- code: NotFoundException
target: NotFoundException
message: Department with external code DEP-001 not found
'500':
description: Internal Server Error - Unexpected failure
content:
application/json:
example:
statusCode: 500
timestamp: '2026-02-18T19:21:54.469Z'
path: /v1/resource
method: GET
title: InternalServerErrorException
message: Unexpected error occurred
errors:
- code: UnprocessableEntityException
target: Server
message: An unexpected error occurred. Please try again later.
security:
- bearer: []
- central-company-id: []
- company-uuid: []
summary: Delete department by external code
tags:
- Department
components:
schemas:
UpdateOrganizationUnitRequestDto:
type: object
properties:
name:
type: string
maxLength: 300
description: Department name
example: Engineering Department
description:
type: string
maxLength: 900
description: Department description
example: Department responsible for software development
type:
enum:
- DEPARTMENT
- SECTOR
- SECTIONS
type: string
description: Department type
example: DEPARTMENT
costCenterCode:
type:
- string
- 'null'
maxLength: 50
description: Cost center external code. Set to null to remove cost center.
example: CC_008
required:
- name
CostCenterDTO:
type: object
properties:
externalCode:
type: string
maxLength: 50
description: organization unit external code
example: OU-F98
required:
- externalCode
CreateOrganizationUnitRequestDto:
type: object
properties:
name:
type: string
maxLength: 300
description: organization unit name
example: Produto
type:
enum:
- DEPARTMENT
- SECTOR
- SECTIONS
type: string
description: organization unit type
example: DEPARTMENT
externalCode:
type: string
maxLength: 50
description: organization unit external code
example: OU-F98
description:
type: string
maxLength: 900
description: organization unit description
example: OU Description
costCenter:
$ref: '#/components/schemas/CostCenterDTO'
required:
- name
- type
- externalCode
- description
- costCenter
securitySchemes:
bearer:
scheme: bearer
bearerFormat: JWT
type: http
x-provenance:
method: searched
source: https://developers.gupy.io/reference
harvested: '2026-12-03'
tool: harvest-readme-openapi.py
note: Assembled verbatim from the OpenAPI definition ReadMe embeds in each operation page of the provider's developer portal; paths and components merged by API title, nothing authored.
assembled_from:
- https://developers.gupy.io/reference/areapubliccontroller_create_v1.md
- https://developers.gupy.io/reference/areapubliccontroller_deletebyexternalcode_v1.md
- https://developers.gupy.io/reference/areapubliccontroller_listallareas_v1.md
- https://developers.gupy.io/reference/areapubliccontroller_update_v1.md
- https://developers.gupy.io/reference/costcenterpubliccontroller_create_v1.md
- https://developers.gupy.io/reference/costcenterpubliccontroller_deletecostcenter_v1.md
- https://developers.gupy.io/reference/costcenterpubliccontroller_findcostcenterbyuuid_v1.md
- https://developers.gupy.io/reference/costcenterpubliccontroller_findcostcenters_v1.md
- https://developers.gupy.io/reference/costcenterpubliccontroller_update_v1.md
- https://developers.gupy.io/reference/operationunitpubliccontroller_create_v1.md
- https://developers.gupy.io/reference/operationunitpubliccontroller_deletebyexternalcode_v1.md
- https://developers.gupy.io/reference/operationunitpubliccontroller_listalloperationunits_v1.md
- https://developers.gupy.io/reference/operationunitpubliccontroller_updatebyexternalcode_v1.md
- https://developers.gupy.io/reference/organizationunitpubliccontroller_create_v1.md
- https://developers.gupy.io/reference/organizationunitpubliccontroller_deletedepartment_v1.md
- https://developers.gupy.io/reference/organizationunitpubliccontroller_findorganizationunitbyuuid_v1.md
- https://developers.gupy.io/reference/organizationunitpubliccontroller_findorganizationunits_v1.md
- https://developers.gupy.io/reference/organizationunitpubliccontroller_update_v1.md
- https://developers.gupy.io/reference/positionpubliccontroller_create_v1.md
- https://developers.gupy.io/reference/positionpubliccontroller_createbatch_v1.md
- https://developers.gupy.io/reference/positionpubliccontroller_createpositionreplication_v1.md
- https://developers.gupy.io/reference/positionpubliccontroller_deleteposition_v1.md
- https://developers.gupy.io/reference/positionpubliccontroller_deletepositionbyemployee_v1.md
- https://developers.gupy.io/reference/positionpubliccontroller_findpositions_v1.md
- https://developers.gupy.io/reference/positionpubliccontroller_updateposition_v1.md
- https://developers.gupy.io/reference/positionpubliccontroller_updatepositionbyemployee_v1.md
- https://developers.gupy.io/reference/rolepubliccontroller_create_v1.md
- https://developers.gupy.io/reference/rolepubliccontroller_delete_v1.md
- https://developers.gupy.io/reference/rolepubliccontroller_listroles_v1.md
- https://developers.gupy.io/reference/rolepubliccontroller_update_v1.md
merge:
pages: 30
deduped: 67
conflicts_kept_first: 0