> For the complete documentation index, see [llms.txt](https://docs.redutzu.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.redutzu.com/resources/redutzu-mdt/exports-events/server-exports/citizens.md).

# Citizens

***

## Type

```typescript
type Citizen = {
    identifier: string,
    firstname: string,
    lastname: string,
    gender: string,
    image?: string,
    notes?: string,
    birthdate: string,
    job: string,
    job_grade: string,
    vehicles: string[],
    images: {
        id: number,
        value: string,
        description: string
    }[],
    incidents: {
        id: number,
        createdAt: string
    }[],
    evidences: {
        id: number,
        createdAt: string
    }[],
    warrants: {
        id: number,
        createdAt: string
    }[],
    bolos: {
        id: number,
        createdAt: string
    }[],
    weapons: {
        serial: string,
        label: string
    }[]
}
```

## Exports

The exports can contain data from the type field.

### SearchCitizen

```lua
exports['redutzu-mdt']:SearchCitizen(identifier: string) // CitizenType | null

```

### RegisterCitizen

```lua
exports['redutzu-mdt']:RegisterCitizen({
  identifier = 'license:1234',
  firstname = 'Firstname',
  lastname = 'Lastname',
  gender = 'm',
  birthdate = '10/05/2000',
  job = { name = 'police', label = 'Law Enforcement', grade = 'Chief' },
  fingerprint = 'abc123',
  notes = 'Citizen notes',
  image = 'https://yourwebsite.com/'
}) -- boolean
```

### UpdateCitizen

```lua
-- It returns a boolean (if it was successfully updated)
exports['redutzu-mdt']:UpdateCitizen(identifier, {
  notes = 'New notes',
  incidents = { 1, 7, 10 }
}) -- boolean
```

```lua
local success = exports['redutzu-mdt']:UpdateCitizen('license:1234', {
    image = 'https://i.pinimg.com/736x/98/1d/6b/981d6b2e0ccb5e968a0618c8d47671da.jpg',
    vehicles = { 'XYZ987' }
})

if not success then
    print('There was an error updating the citizen')
    return
end

print('Citizen updated')
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.redutzu.com/resources/redutzu-mdt/exports-events/server-exports/citizens.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
