Create a new department

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):

FieldTypeRequiredDescription
namestringYesName of the department. Min length: 1, max length: 128 characters.
descriptionstringNoOptional description of the department. Max length: 2048 characters.

Update Department Request (to update an existing department via this endpoint):

FieldTypeRequiredDescription
namestringYesName of the department. Min length: 1, max length: 128 characters.
descriptionstringNoOptional description of the department. Max length: 2048 characters.
departmentIdinteger (int32)NoID of an existing department when used in an update context.
{
  "name": "Finance",
  "description": "Handles all financial operations and reporting"
}

Response

200 OK

FieldTypeDescription
idinteger (int32)Unique identifier of the newly created department.
namestringName of the department.
descriptionstringDescription of the department.
creatorobjectInformation about the user who created the department.
creator.idinteger (int32)Unique identifier of the creator.
creator.namestringFull name of the creator.
authorizedUserCountinteger (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

CodeWhen it happens
400Missing required fields (e.g., name not provided) or validation error (e.g., name exceeds 128 characters)
401Token missing, expired, or invalid
403Insufficient permissions — caller is not authorized to create departments for this business
404Resource not found
500Internal server error

Common Mistakes

  • Omitting the required name field — the request will fail with a 400 error.
  • Exceeding the name character limit of 128 or description limit 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 customer
  • PUT /api/teams/departments/{departmentId} — Update an existing department
  • DELETE /api/teams/departments/{departmentId} — Delete a department
  • POST /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"
  }'
Body Params
string
required
length between 1 and 128
string | null
Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
string
enum
Defaults to application/json

Generated from available request content types

Allowed:
Response

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
text/plain
application/json
text/json