# API key

### Roles UI example
| Name | Role | CreatedAt |
| -------- | -------- | -------- |
| Key for projects | projects admin, modules editor | Date |
### The list of the roles
For each entity (organization, project, platforms) we will have options:
Admin - all actions are available
Editor - view and edit (can not delete something or create new)
Viewer - only view
Also we can have like Viewer, Editor and Admin for all entities
in a case when you do not want to exclude something

### Log collections
we need to store information about actions for each API key
exactly, when somebody edit, create or delete something in our app
| Field Name | Type | Comments |
| -------- | -------- | -------- |
| API key name | String | |
| Action type | Create or Update or Delete | |
| Changes | Object | Only for create and update actions |
| Date | Date | |
#### Changes example:
```
{
organizationId: 7,
data: {
name: 'New name'
}
}
```
or
```
{
facebookBotId: 74,
data: {
prevValue: {
applicationId: 6
},
newValue: {
applicationId: 7
}
}
}
```