---
title: "Create a new attendance code"
method: POST
path: "/Attendance/Codes"
tags: ["Attendance"]
---

# Create a new attendance code

`POST /Attendance/Codes`

**Requires permissions:** *AcademicStaff* or *AcademicSupport* or *StudentFacing*

## Request body

- PostAttendanceCodeRequest
  - `code` AttendanceCode
    - `attendanceCodeId` string, guid, nullable
    - `code` string
    - `description` string
    - `category` string
    - `eventType` string, nullable
    - `session` string, nullable
    - `order` integer, nullable
    - `display` boolean, nullable
    - `archived` boolean
    - `showInAbsenceOffex` boolean
    - `isAbsent` boolean
    - `isPresent` boolean
    - `isLate` boolean
    - `isUnauthorised` boolean

## Response `200`

Success - Created attendance code

- PostAttendanceCodeResponse
  - `code` AttendanceCode
    - `attendanceCodeId` string, guid, nullable
    - `code` string
    - `description` string
    - `category` string
    - `eventType` string, nullable
    - `session` string, nullable
    - `order` integer, nullable
    - `display` boolean, nullable
    - `archived` boolean
    - `showInAbsenceOffex` boolean
    - `isAbsent` boolean
    - `isPresent` boolean
    - `isLate` boolean
    - `isUnauthorised` boolean

## Other responses

- `400` — An Error Occurred - Could not create attendance code
- `401` — Unauthorized
- `403` — Forbidden

---

[API](https://skmtc.net/tonbridge/apis/tonbridge-app-api.md) · [All operations](https://skmtc.net/tonbridge/apis/tonbridge-app-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tonbridge/tonbridge-app-api/versions/28344aa564b4/schema)
