Create Department
Creates a new department within a business customer's team structure. Departments allow business customers to organize authorized users (subProfiles) into logical groups for streamlined management and access control. Once created, authorized users can be assigned to the department.
Endpoint
POST /api/teams/departments
Authentication
Bearer token required. Obtain via:
POST https://api.banking.netevia.dev/api/auth/v2
Include in header: Authorization: Bearer {token}
Token lifetime: 10 minutes. Refresh via POST /api/auth/refresh.
When to use
Use this endpoint when a business customer needs to organize their authorized users into departments (e.g., Finance, Operations, HR). Departments provide a way to group subProfiles and manage access levels collectively. This is relevant for businesses with multiple teams requiring differentiated access to banking features.
Request Body
The request body accepts one of two schemas:
Create Department Request (for new departments):
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Name of the department. Min length: 1, max length: 128 characters. |
| description | string | No | Optional description of the department. Max length: 2048 characters. |
Update Department Request (to update an existing department via this endpoint):
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Name of the department. Min length: 1, max length: 128 characters. |
| description | string | No | Optional description of the department. Max length: 2048 characters. |
| departmentId | integer (int32) | No | ID of an existing department when used in an update context. |
{
"name": "Finance",
"description": "Handles all financial operations and reporting"
}Response
200 OK
| Field | Type | Description |
|---|---|---|
| id | integer (int32) | Unique identifier of the newly created department. |
| name | string | Name of the department. |
| description | string | Description of the department. |
| creator | object | Information about the user who created the department. |
| creator.id | integer (int32) | Unique identifier of the creator. |
| creator.name | string | Full name of the creator. |
| authorizedUserCount | integer (int32) | Number of authorized users currently assigned to the department. |
{
"id": 42,
"name": "Finance",
"description": "Handles all financial operations and reporting",
"creator": {
"id": 7,
"name": "Jane Smith"
},
"authorizedUserCount": 0
}Error Codes
| Code | When it happens |
|---|---|
| 400 | Missing required fields (e.g., name not provided) or validation error (e.g., name exceeds 128 characters) |
| 401 | Token missing, expired, or invalid |
| 403 | Insufficient permissions — caller is not authorized to create departments for this business |
| 404 | Resource not found |
| 500 | Internal server error |
Common Mistakes
- Omitting the required
namefield — the request will fail with a 400 error. - Exceeding the
namecharacter limit of 128 ordescriptionlimit of 2048 characters. - Using a personal customer token — departments are only available for business customers.
- Sending an expired Bearer token; tokens expire after 10 minutes and must be refreshed via
POST /api/auth/refresh.
Related Endpoints
GET /api/teams/departments— Retrieve a list of all departments for the business customerPUT /api/teams/departments/{departmentId}— Update an existing departmentDELETE /api/teams/departments/{departmentId}— Delete a departmentPOST /api/teams/subprofiles— Create an authorized user (subProfile) to assign to a department
Example
curl -X POST https://api.banking.netevia.dev/api/teams/departments \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Finance",
"description": "Handles all financial operations and reporting"
}'