# Create a Code

`POST /lokta-lms/api/v1/codes`

Creates a code. Codes created through api are always 'user defined' and so system defined is marked as false.

## Request body (application/json)
- `name` (string)

## Responses
- `200`: OK

## Response fields
- `resourceId` (integer)

## Example request (cURL)
```bash
curl -X POST \
  'http://localhost:8080/lokta-lms/api/v1/codes' \
  -u '{username}:{password}' \
  -H 'Tenant-Identifier: default' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "MyNewCode"
}'
```

## Example response
```json
{
  "resourceId": 4
}
```

Interactive: https://developer.lokta.ai/reference.html#operation/createCode
