# Directory

The Directory API gives you access to Organizations, Accounts, Employees and Groups. Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT.

## GET /api/v1/organization

> List organizations

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"alias":{"type":"string"},"owners":{"type":"array","items":{"type":"string","format":"uuid"}},"profile":{"$ref":"#/components/schemas/OrganizationProfile"},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}},"keys":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationKey"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","name","active","status","created","alias"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"OrganizationProfile":{"type":"object","properties":{"logoUrl":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"countryCode":{"type":"string"},"companySize":{"type":"string"},"website":{"type":"string"},"mission":{"type":"string"}}},"App":{"type":"object","description":"An Application (integration) record.","properties":{"id":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"internal":{"type":"boolean"},"name":{"type":"string"},"type":{"type":"string"},"active":{"type":"boolean"},"status":{"type":"object","properties":{"current":{"type":"string","enum":["ACTIVE","INACTIVE","DRAFT","COMPLETED","CANCELED","TEST","ARCHIVED","TO_BE_DELETED"]},"changedAt":{"type":"string","format":"date-time","nullable":true},"changedBy":{"type":"string","format":"uuid","nullable":true}}},"created":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid","nullable":true}}},"organization":{"type":"string","format":"uuid"},"secretData":{"type":"object","additionalProperties":{"type":"string"}},"appData":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},"OrganizationKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"secretBase64":{"type":"string"},"limitToRole":{"type":"string"}},"required":["id","name","secretBase64","limitToRole"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/organization":{"get":{"tags":["Directory"],"summary":"List organizations","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## POST /api/v1/organization

> Create organization

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"OrganizationRequest":{"type":"object","properties":{"name":{"type":"string"},"alias":{"type":"string"},"ownerEmail":{"type":"string"}},"required":["name"]},"Organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"alias":{"type":"string"},"owners":{"type":"array","items":{"type":"string","format":"uuid"}},"profile":{"$ref":"#/components/schemas/OrganizationProfile"},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}},"keys":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationKey"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","name","active","status","created","alias"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"OrganizationProfile":{"type":"object","properties":{"logoUrl":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"countryCode":{"type":"string"},"companySize":{"type":"string"},"website":{"type":"string"},"mission":{"type":"string"}}},"App":{"type":"object","description":"An Application (integration) record.","properties":{"id":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"internal":{"type":"boolean"},"name":{"type":"string"},"type":{"type":"string"},"active":{"type":"boolean"},"status":{"type":"object","properties":{"current":{"type":"string","enum":["ACTIVE","INACTIVE","DRAFT","COMPLETED","CANCELED","TEST","ARCHIVED","TO_BE_DELETED"]},"changedAt":{"type":"string","format":"date-time","nullable":true},"changedBy":{"type":"string","format":"uuid","nullable":true}}},"created":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid","nullable":true}}},"organization":{"type":"string","format":"uuid"},"secretData":{"type":"object","additionalProperties":{"type":"string"}},"appData":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},"OrganizationKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"secretBase64":{"type":"string"},"limitToRole":{"type":"string"}},"required":["id","name","secretBase64","limitToRole"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/organization":{"post":{"tags":["Directory"],"summary":"Create organization","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## PATCH /api/v1/organization

> Update current organization

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"OrganizationRequest":{"type":"object","properties":{"name":{"type":"string"},"alias":{"type":"string"},"ownerEmail":{"type":"string"}},"required":["name"]},"Organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"alias":{"type":"string"},"owners":{"type":"array","items":{"type":"string","format":"uuid"}},"profile":{"$ref":"#/components/schemas/OrganizationProfile"},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}},"keys":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationKey"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","name","active","status","created","alias"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"OrganizationProfile":{"type":"object","properties":{"logoUrl":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"countryCode":{"type":"string"},"companySize":{"type":"string"},"website":{"type":"string"},"mission":{"type":"string"}}},"App":{"type":"object","description":"An Application (integration) record.","properties":{"id":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"internal":{"type":"boolean"},"name":{"type":"string"},"type":{"type":"string"},"active":{"type":"boolean"},"status":{"type":"object","properties":{"current":{"type":"string","enum":["ACTIVE","INACTIVE","DRAFT","COMPLETED","CANCELED","TEST","ARCHIVED","TO_BE_DELETED"]},"changedAt":{"type":"string","format":"date-time","nullable":true},"changedBy":{"type":"string","format":"uuid","nullable":true}}},"created":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid","nullable":true}}},"organization":{"type":"string","format":"uuid"},"secretData":{"type":"object","additionalProperties":{"type":"string"}},"appData":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},"OrganizationKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"secretBase64":{"type":"string"},"limitToRole":{"type":"string"}},"required":["id","name","secretBase64","limitToRole"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/organization":{"patch":{"tags":["Directory"],"summary":"Update current organization","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/organization/{organization}

> Get organization by ID

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"alias":{"type":"string"},"owners":{"type":"array","items":{"type":"string","format":"uuid"}},"profile":{"$ref":"#/components/schemas/OrganizationProfile"},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}},"keys":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationKey"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","name","active","status","created","alias"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"OrganizationProfile":{"type":"object","properties":{"logoUrl":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"countryCode":{"type":"string"},"companySize":{"type":"string"},"website":{"type":"string"},"mission":{"type":"string"}}},"App":{"type":"object","description":"An Application (integration) record.","properties":{"id":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"internal":{"type":"boolean"},"name":{"type":"string"},"type":{"type":"string"},"active":{"type":"boolean"},"status":{"type":"object","properties":{"current":{"type":"string","enum":["ACTIVE","INACTIVE","DRAFT","COMPLETED","CANCELED","TEST","ARCHIVED","TO_BE_DELETED"]},"changedAt":{"type":"string","format":"date-time","nullable":true},"changedBy":{"type":"string","format":"uuid","nullable":true}}},"created":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid","nullable":true}}},"organization":{"type":"string","format":"uuid"},"secretData":{"type":"object","additionalProperties":{"type":"string"}},"appData":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},"OrganizationKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"secretBase64":{"type":"string"},"limitToRole":{"type":"string"}},"required":["id","name","secretBase64","limitToRole"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/organization/{organization}":{"get":{"tags":["Directory"],"summary":"Get organization by ID","parameters":[{"name":"organization","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## PATCH /api/v1/organization/{organization}

> Update organization by ID

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"OrganizationRequest":{"type":"object","properties":{"name":{"type":"string"},"alias":{"type":"string"},"ownerEmail":{"type":"string"}},"required":["name"]},"Organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"alias":{"type":"string"},"owners":{"type":"array","items":{"type":"string","format":"uuid"}},"profile":{"$ref":"#/components/schemas/OrganizationProfile"},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}},"keys":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationKey"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","name","active","status","created","alias"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"OrganizationProfile":{"type":"object","properties":{"logoUrl":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"countryCode":{"type":"string"},"companySize":{"type":"string"},"website":{"type":"string"},"mission":{"type":"string"}}},"App":{"type":"object","description":"An Application (integration) record.","properties":{"id":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"internal":{"type":"boolean"},"name":{"type":"string"},"type":{"type":"string"},"active":{"type":"boolean"},"status":{"type":"object","properties":{"current":{"type":"string","enum":["ACTIVE","INACTIVE","DRAFT","COMPLETED","CANCELED","TEST","ARCHIVED","TO_BE_DELETED"]},"changedAt":{"type":"string","format":"date-time","nullable":true},"changedBy":{"type":"string","format":"uuid","nullable":true}}},"created":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid","nullable":true}}},"organization":{"type":"string","format":"uuid"},"secretData":{"type":"object","additionalProperties":{"type":"string"}},"appData":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},"OrganizationKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"secretBase64":{"type":"string"},"limitToRole":{"type":"string"}},"required":["id","name","secretBase64","limitToRole"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/organization/{organization}":{"patch":{"tags":["Directory"],"summary":"Update organization by ID","parameters":[{"name":"organization","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/organization/profile

> Get organization profile

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"OrganizationProfile":{"type":"object","properties":{"logoUrl":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"countryCode":{"type":"string"},"companySize":{"type":"string"},"website":{"type":"string"},"mission":{"type":"string"}}}}},"paths":{"/api/v1/organization/profile":{"get":{"tags":["Directory"],"summary":"Get organization profile","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationProfile"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## POST /api/v1/organization/profile

> Create or replace organization profile

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"OrganizationProfile":{"type":"object","properties":{"logoUrl":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"countryCode":{"type":"string"},"companySize":{"type":"string"},"website":{"type":"string"},"mission":{"type":"string"}}},"Organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"alias":{"type":"string"},"owners":{"type":"array","items":{"type":"string","format":"uuid"}},"profile":{"$ref":"#/components/schemas/OrganizationProfile"},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}},"keys":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationKey"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","name","active","status","created","alias"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"App":{"type":"object","description":"An Application (integration) record.","properties":{"id":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"internal":{"type":"boolean"},"name":{"type":"string"},"type":{"type":"string"},"active":{"type":"boolean"},"status":{"type":"object","properties":{"current":{"type":"string","enum":["ACTIVE","INACTIVE","DRAFT","COMPLETED","CANCELED","TEST","ARCHIVED","TO_BE_DELETED"]},"changedAt":{"type":"string","format":"date-time","nullable":true},"changedBy":{"type":"string","format":"uuid","nullable":true}}},"created":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid","nullable":true}}},"organization":{"type":"string","format":"uuid"},"secretData":{"type":"object","additionalProperties":{"type":"string"}},"appData":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},"OrganizationKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"secretBase64":{"type":"string"},"limitToRole":{"type":"string"}},"required":["id","name","secretBase64","limitToRole"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/organization/profile":{"post":{"tags":["Directory"],"summary":"Create or replace organization profile","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationProfile"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## PATCH /api/v1/organization/profile

> Update organization profile

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"OrganizationProfile":{"type":"object","properties":{"logoUrl":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"countryCode":{"type":"string"},"companySize":{"type":"string"},"website":{"type":"string"},"mission":{"type":"string"}}},"Organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"alias":{"type":"string"},"owners":{"type":"array","items":{"type":"string","format":"uuid"}},"profile":{"$ref":"#/components/schemas/OrganizationProfile"},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}},"keys":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationKey"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","name","active","status","created","alias"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"App":{"type":"object","description":"An Application (integration) record.","properties":{"id":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"internal":{"type":"boolean"},"name":{"type":"string"},"type":{"type":"string"},"active":{"type":"boolean"},"status":{"type":"object","properties":{"current":{"type":"string","enum":["ACTIVE","INACTIVE","DRAFT","COMPLETED","CANCELED","TEST","ARCHIVED","TO_BE_DELETED"]},"changedAt":{"type":"string","format":"date-time","nullable":true},"changedBy":{"type":"string","format":"uuid","nullable":true}}},"created":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid","nullable":true}}},"organization":{"type":"string","format":"uuid"},"secretData":{"type":"object","additionalProperties":{"type":"string"}},"appData":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},"OrganizationKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"secretBase64":{"type":"string"},"limitToRole":{"type":"string"}},"required":["id","name","secretBase64","limitToRole"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/organization/profile":{"patch":{"tags":["Directory"],"summary":"Update organization profile","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationProfile"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/organization/{organization}/profile

> Get organization profile by ID

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"OrganizationProfile":{"type":"object","properties":{"logoUrl":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"countryCode":{"type":"string"},"companySize":{"type":"string"},"website":{"type":"string"},"mission":{"type":"string"}}}}},"paths":{"/api/v1/organization/{organization}/profile":{"get":{"tags":["Directory"],"summary":"Get organization profile by ID","parameters":[{"name":"organization","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationProfile"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## POST /api/v1/organization/{organization}/profile

> Create or replace profile for organization

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"OrganizationProfile":{"type":"object","properties":{"logoUrl":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"countryCode":{"type":"string"},"companySize":{"type":"string"},"website":{"type":"string"},"mission":{"type":"string"}}},"Organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"alias":{"type":"string"},"owners":{"type":"array","items":{"type":"string","format":"uuid"}},"profile":{"$ref":"#/components/schemas/OrganizationProfile"},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}},"keys":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationKey"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","name","active","status","created","alias"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"App":{"type":"object","description":"An Application (integration) record.","properties":{"id":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"internal":{"type":"boolean"},"name":{"type":"string"},"type":{"type":"string"},"active":{"type":"boolean"},"status":{"type":"object","properties":{"current":{"type":"string","enum":["ACTIVE","INACTIVE","DRAFT","COMPLETED","CANCELED","TEST","ARCHIVED","TO_BE_DELETED"]},"changedAt":{"type":"string","format":"date-time","nullable":true},"changedBy":{"type":"string","format":"uuid","nullable":true}}},"created":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid","nullable":true}}},"organization":{"type":"string","format":"uuid"},"secretData":{"type":"object","additionalProperties":{"type":"string"}},"appData":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},"OrganizationKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"secretBase64":{"type":"string"},"limitToRole":{"type":"string"}},"required":["id","name","secretBase64","limitToRole"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/organization/{organization}/profile":{"post":{"tags":["Directory"],"summary":"Create or replace profile for organization","parameters":[{"name":"organization","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationProfile"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## PATCH /api/v1/organization/{organization}/profile

> Update profile for organization

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"OrganizationProfile":{"type":"object","properties":{"logoUrl":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"countryCode":{"type":"string"},"companySize":{"type":"string"},"website":{"type":"string"},"mission":{"type":"string"}}},"Organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"alias":{"type":"string"},"owners":{"type":"array","items":{"type":"string","format":"uuid"}},"profile":{"$ref":"#/components/schemas/OrganizationProfile"},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}},"keys":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationKey"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","name","active","status","created","alias"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"App":{"type":"object","description":"An Application (integration) record.","properties":{"id":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"internal":{"type":"boolean"},"name":{"type":"string"},"type":{"type":"string"},"active":{"type":"boolean"},"status":{"type":"object","properties":{"current":{"type":"string","enum":["ACTIVE","INACTIVE","DRAFT","COMPLETED","CANCELED","TEST","ARCHIVED","TO_BE_DELETED"]},"changedAt":{"type":"string","format":"date-time","nullable":true},"changedBy":{"type":"string","format":"uuid","nullable":true}}},"created":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid","nullable":true}}},"organization":{"type":"string","format":"uuid"},"secretData":{"type":"object","additionalProperties":{"type":"string"}},"appData":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},"OrganizationKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"secretBase64":{"type":"string"},"limitToRole":{"type":"string"}},"required":["id","name","secretBase64","limitToRole"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/organization/{organization}/profile":{"patch":{"tags":["Directory"],"summary":"Update profile for organization","parameters":[{"name":"organization","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationProfile"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/organization/alias/{alias}

> Get organization by alias

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"alias":{"type":"string"},"owners":{"type":"array","items":{"type":"string","format":"uuid"}},"profile":{"$ref":"#/components/schemas/OrganizationProfile"},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}},"keys":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationKey"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","name","active","status","created","alias"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"OrganizationProfile":{"type":"object","properties":{"logoUrl":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"countryCode":{"type":"string"},"companySize":{"type":"string"},"website":{"type":"string"},"mission":{"type":"string"}}},"App":{"type":"object","description":"An Application (integration) record.","properties":{"id":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"internal":{"type":"boolean"},"name":{"type":"string"},"type":{"type":"string"},"active":{"type":"boolean"},"status":{"type":"object","properties":{"current":{"type":"string","enum":["ACTIVE","INACTIVE","DRAFT","COMPLETED","CANCELED","TEST","ARCHIVED","TO_BE_DELETED"]},"changedAt":{"type":"string","format":"date-time","nullable":true},"changedBy":{"type":"string","format":"uuid","nullable":true}}},"created":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid","nullable":true}}},"organization":{"type":"string","format":"uuid"},"secretData":{"type":"object","additionalProperties":{"type":"string"}},"appData":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},"OrganizationKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"secretBase64":{"type":"string"},"limitToRole":{"type":"string"}},"required":["id","name","secretBase64","limitToRole"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/organization/alias/{alias}":{"get":{"tags":["Directory"],"summary":"Get organization by alias","parameters":[{"name":"alias","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/organization/by-app/{type}

> List organizations by app type

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"alias":{"type":"string"},"owners":{"type":"array","items":{"type":"string","format":"uuid"}},"profile":{"$ref":"#/components/schemas/OrganizationProfile"},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}},"keys":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationKey"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","name","active","status","created","alias"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"OrganizationProfile":{"type":"object","properties":{"logoUrl":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"countryCode":{"type":"string"},"companySize":{"type":"string"},"website":{"type":"string"},"mission":{"type":"string"}}},"App":{"type":"object","description":"An Application (integration) record.","properties":{"id":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"internal":{"type":"boolean"},"name":{"type":"string"},"type":{"type":"string"},"active":{"type":"boolean"},"status":{"type":"object","properties":{"current":{"type":"string","enum":["ACTIVE","INACTIVE","DRAFT","COMPLETED","CANCELED","TEST","ARCHIVED","TO_BE_DELETED"]},"changedAt":{"type":"string","format":"date-time","nullable":true},"changedBy":{"type":"string","format":"uuid","nullable":true}}},"created":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid","nullable":true}}},"organization":{"type":"string","format":"uuid"},"secretData":{"type":"object","additionalProperties":{"type":"string"}},"appData":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},"OrganizationKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"secretBase64":{"type":"string"},"limitToRole":{"type":"string"}},"required":["id","name","secretBase64","limitToRole"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/organization/by-app/{type}":{"get":{"tags":["Directory"],"summary":"List organizations by app type","parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/organization/by-app-id/{type}/{externalId}

> List organizations by app external ID

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"alias":{"type":"string"},"owners":{"type":"array","items":{"type":"string","format":"uuid"}},"profile":{"$ref":"#/components/schemas/OrganizationProfile"},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}},"keys":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationKey"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","name","active","status","created","alias"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"OrganizationProfile":{"type":"object","properties":{"logoUrl":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"countryCode":{"type":"string"},"companySize":{"type":"string"},"website":{"type":"string"},"mission":{"type":"string"}}},"App":{"type":"object","description":"An Application (integration) record.","properties":{"id":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"internal":{"type":"boolean"},"name":{"type":"string"},"type":{"type":"string"},"active":{"type":"boolean"},"status":{"type":"object","properties":{"current":{"type":"string","enum":["ACTIVE","INACTIVE","DRAFT","COMPLETED","CANCELED","TEST","ARCHIVED","TO_BE_DELETED"]},"changedAt":{"type":"string","format":"date-time","nullable":true},"changedBy":{"type":"string","format":"uuid","nullable":true}}},"created":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid","nullable":true}}},"organization":{"type":"string","format":"uuid"},"secretData":{"type":"object","additionalProperties":{"type":"string"}},"appData":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},"OrganizationKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"secretBase64":{"type":"string"},"limitToRole":{"type":"string"}},"required":["id","name","secretBase64","limitToRole"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/organization/by-app-id/{type}/{externalId}":{"get":{"tags":["Directory"],"summary":"List organizations by app external ID","parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string"}},{"name":"externalId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/organization/by-app-data/{type}/{key}/{value}

> List organizations by app data

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"alias":{"type":"string"},"owners":{"type":"array","items":{"type":"string","format":"uuid"}},"profile":{"$ref":"#/components/schemas/OrganizationProfile"},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}},"keys":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationKey"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","name","active","status","created","alias"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"OrganizationProfile":{"type":"object","properties":{"logoUrl":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"countryCode":{"type":"string"},"companySize":{"type":"string"},"website":{"type":"string"},"mission":{"type":"string"}}},"App":{"type":"object","description":"An Application (integration) record.","properties":{"id":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"internal":{"type":"boolean"},"name":{"type":"string"},"type":{"type":"string"},"active":{"type":"boolean"},"status":{"type":"object","properties":{"current":{"type":"string","enum":["ACTIVE","INACTIVE","DRAFT","COMPLETED","CANCELED","TEST","ARCHIVED","TO_BE_DELETED"]},"changedAt":{"type":"string","format":"date-time","nullable":true},"changedBy":{"type":"string","format":"uuid","nullable":true}}},"created":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid","nullable":true}}},"organization":{"type":"string","format":"uuid"},"secretData":{"type":"object","additionalProperties":{"type":"string"}},"appData":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},"OrganizationKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"secretBase64":{"type":"string"},"limitToRole":{"type":"string"}},"required":["id","name","secretBase64","limitToRole"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/organization/by-app-data/{type}/{key}/{value}":{"get":{"tags":["Directory"],"summary":"List organizations by app data","parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"value","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## POST /api/v1/organization/by-app-secret/{type}/{key}

> List organizations by app secret

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"ListBySecretRequest":{"type":"object","properties":{"secret":{"type":"string"}},"required":["secret"]},"Organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"alias":{"type":"string"},"owners":{"type":"array","items":{"type":"string","format":"uuid"}},"profile":{"$ref":"#/components/schemas/OrganizationProfile"},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}},"keys":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationKey"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","name","active","status","created","alias"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"OrganizationProfile":{"type":"object","properties":{"logoUrl":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"countryCode":{"type":"string"},"companySize":{"type":"string"},"website":{"type":"string"},"mission":{"type":"string"}}},"App":{"type":"object","description":"An Application (integration) record.","properties":{"id":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"internal":{"type":"boolean"},"name":{"type":"string"},"type":{"type":"string"},"active":{"type":"boolean"},"status":{"type":"object","properties":{"current":{"type":"string","enum":["ACTIVE","INACTIVE","DRAFT","COMPLETED","CANCELED","TEST","ARCHIVED","TO_BE_DELETED"]},"changedAt":{"type":"string","format":"date-time","nullable":true},"changedBy":{"type":"string","format":"uuid","nullable":true}}},"created":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid","nullable":true}}},"organization":{"type":"string","format":"uuid"},"secretData":{"type":"object","additionalProperties":{"type":"string"}},"appData":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},"OrganizationKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"secretBase64":{"type":"string"},"limitToRole":{"type":"string"}},"required":["id","name","secretBase64","limitToRole"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/organization/by-app-secret/{type}/{key}":{"post":{"tags":["Directory"],"summary":"List organizations by app secret","parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListBySecretRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## POST /api/v1/organization/keys

> Create API key for organization

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"NewKeyRequest":{"type":"object","properties":{"name":{"type":"string"},"limitToRole":{"type":"string"}},"required":["name"]},"Organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"alias":{"type":"string"},"owners":{"type":"array","items":{"type":"string","format":"uuid"}},"profile":{"$ref":"#/components/schemas/OrganizationProfile"},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}},"keys":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationKey"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","name","active","status","created","alias"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"OrganizationProfile":{"type":"object","properties":{"logoUrl":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"countryCode":{"type":"string"},"companySize":{"type":"string"},"website":{"type":"string"},"mission":{"type":"string"}}},"App":{"type":"object","description":"An Application (integration) record.","properties":{"id":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"internal":{"type":"boolean"},"name":{"type":"string"},"type":{"type":"string"},"active":{"type":"boolean"},"status":{"type":"object","properties":{"current":{"type":"string","enum":["ACTIVE","INACTIVE","DRAFT","COMPLETED","CANCELED","TEST","ARCHIVED","TO_BE_DELETED"]},"changedAt":{"type":"string","format":"date-time","nullable":true},"changedBy":{"type":"string","format":"uuid","nullable":true}}},"created":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid","nullable":true}}},"organization":{"type":"string","format":"uuid"},"secretData":{"type":"object","additionalProperties":{"type":"string"}},"appData":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},"OrganizationKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"secretBase64":{"type":"string"},"limitToRole":{"type":"string"}},"required":["id","name","secretBase64","limitToRole"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/organization/keys":{"post":{"tags":["Directory"],"summary":"Create API key for organization","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewKeyRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## POST /api/v1/organization/{organization}/keys

> Create API key for org by ID

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"NewKeyRequest":{"type":"object","properties":{"name":{"type":"string"},"limitToRole":{"type":"string"}},"required":["name"]},"Organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"alias":{"type":"string"},"owners":{"type":"array","items":{"type":"string","format":"uuid"}},"profile":{"$ref":"#/components/schemas/OrganizationProfile"},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}},"keys":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationKey"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","name","active","status","created","alias"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"OrganizationProfile":{"type":"object","properties":{"logoUrl":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"countryCode":{"type":"string"},"companySize":{"type":"string"},"website":{"type":"string"},"mission":{"type":"string"}}},"App":{"type":"object","description":"An Application (integration) record.","properties":{"id":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"internal":{"type":"boolean"},"name":{"type":"string"},"type":{"type":"string"},"active":{"type":"boolean"},"status":{"type":"object","properties":{"current":{"type":"string","enum":["ACTIVE","INACTIVE","DRAFT","COMPLETED","CANCELED","TEST","ARCHIVED","TO_BE_DELETED"]},"changedAt":{"type":"string","format":"date-time","nullable":true},"changedBy":{"type":"string","format":"uuid","nullable":true}}},"created":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid","nullable":true}}},"organization":{"type":"string","format":"uuid"},"secretData":{"type":"object","additionalProperties":{"type":"string"}},"appData":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},"OrganizationKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"secretBase64":{"type":"string"},"limitToRole":{"type":"string"}},"required":["id","name","secretBase64","limitToRole"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/organization/{organization}/keys":{"post":{"tags":["Directory"],"summary":"Create API key for org by ID","parameters":[{"name":"organization","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewKeyRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## DELETE /api/v1/organization/keys/{key}

> Delete API key for current organization

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"alias":{"type":"string"},"owners":{"type":"array","items":{"type":"string","format":"uuid"}},"profile":{"$ref":"#/components/schemas/OrganizationProfile"},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}},"keys":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationKey"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","name","active","status","created","alias"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"OrganizationProfile":{"type":"object","properties":{"logoUrl":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"countryCode":{"type":"string"},"companySize":{"type":"string"},"website":{"type":"string"},"mission":{"type":"string"}}},"App":{"type":"object","description":"An Application (integration) record.","properties":{"id":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"internal":{"type":"boolean"},"name":{"type":"string"},"type":{"type":"string"},"active":{"type":"boolean"},"status":{"type":"object","properties":{"current":{"type":"string","enum":["ACTIVE","INACTIVE","DRAFT","COMPLETED","CANCELED","TEST","ARCHIVED","TO_BE_DELETED"]},"changedAt":{"type":"string","format":"date-time","nullable":true},"changedBy":{"type":"string","format":"uuid","nullable":true}}},"created":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid","nullable":true}}},"organization":{"type":"string","format":"uuid"},"secretData":{"type":"object","additionalProperties":{"type":"string"}},"appData":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},"OrganizationKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"secretBase64":{"type":"string"},"limitToRole":{"type":"string"}},"required":["id","name","secretBase64","limitToRole"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/organization/keys/{key}":{"delete":{"tags":["Directory"],"summary":"Delete API key for current organization","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## DELETE /api/v1/organization/{organization}/keys/{key}

> Delete API key by org ID

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"alias":{"type":"string"},"owners":{"type":"array","items":{"type":"string","format":"uuid"}},"profile":{"$ref":"#/components/schemas/OrganizationProfile"},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}},"keys":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationKey"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","name","active","status","created","alias"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"OrganizationProfile":{"type":"object","properties":{"logoUrl":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"countryCode":{"type":"string"},"companySize":{"type":"string"},"website":{"type":"string"},"mission":{"type":"string"}}},"App":{"type":"object","description":"An Application (integration) record.","properties":{"id":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"internal":{"type":"boolean"},"name":{"type":"string"},"type":{"type":"string"},"active":{"type":"boolean"},"status":{"type":"object","properties":{"current":{"type":"string","enum":["ACTIVE","INACTIVE","DRAFT","COMPLETED","CANCELED","TEST","ARCHIVED","TO_BE_DELETED"]},"changedAt":{"type":"string","format":"date-time","nullable":true},"changedBy":{"type":"string","format":"uuid","nullable":true}}},"created":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid","nullable":true}}},"organization":{"type":"string","format":"uuid"},"secretData":{"type":"object","additionalProperties":{"type":"string"}},"appData":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},"OrganizationKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"secretBase64":{"type":"string"},"limitToRole":{"type":"string"}},"required":["id","name","secretBase64","limitToRole"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/organization/{organization}/keys/{key}":{"delete":{"tags":["Directory"],"summary":"Delete API key by org ID","parameters":[{"name":"organization","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/account

> List accounts

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Account":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"grants":{"type":"array","items":{"$ref":"#/components/schemas/AccountGrant"}}},"required":["id","email","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"AccountGrant":{"type":"object","properties":{"orgId":{"type":"string","format":"uuid"},"role":{"type":"string"},"employeeId":{"type":"string","format":"uuid"}},"required":["role"]}}},"paths":{"/api/v1/account":{"get":{"tags":["Directory"],"summary":"List accounts","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Account"}}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## POST /api/v1/account

> Create account

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"AccountRequest":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"}},"required":["email"]},"Account":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"grants":{"type":"array","items":{"$ref":"#/components/schemas/AccountGrant"}}},"required":["id","email","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"AccountGrant":{"type":"object","properties":{"orgId":{"type":"string","format":"uuid"},"role":{"type":"string"},"employeeId":{"type":"string","format":"uuid"}},"required":["role"]}}},"paths":{"/api/v1/account":{"post":{"tags":["Directory"],"summary":"Create account","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/account/{accountIdOrEmail}

> Get account by ID or email

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Account":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"grants":{"type":"array","items":{"$ref":"#/components/schemas/AccountGrant"}}},"required":["id","email","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"AccountGrant":{"type":"object","properties":{"orgId":{"type":"string","format":"uuid"},"role":{"type":"string"},"employeeId":{"type":"string","format":"uuid"}},"required":["role"]}}},"paths":{"/api/v1/account/{accountIdOrEmail}":{"get":{"tags":["Directory"],"summary":"Get account by ID or email","parameters":[{"name":"accountIdOrEmail","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## PATCH /api/v1/account/{accountIdOrEmail}

> Update account

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"AccountRequest":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"}},"required":["email"]},"Account":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"grants":{"type":"array","items":{"$ref":"#/components/schemas/AccountGrant"}}},"required":["id","email","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"AccountGrant":{"type":"object","properties":{"orgId":{"type":"string","format":"uuid"},"role":{"type":"string"},"employeeId":{"type":"string","format":"uuid"}},"required":["role"]}}},"paths":{"/api/v1/account/{accountIdOrEmail}":{"patch":{"tags":["Directory"],"summary":"Update account","parameters":[{"name":"accountIdOrEmail","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## POST /api/v1/account/{accountId}/grant

> Grant account a role

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"AccountGrant":{"type":"object","properties":{"orgId":{"type":"string","format":"uuid"},"role":{"type":"string"},"employeeId":{"type":"string","format":"uuid"}},"required":["role"]},"Account":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"grants":{"type":"array","items":{"$ref":"#/components/schemas/AccountGrant"}}},"required":["id","email","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]}}},"paths":{"/api/v1/account/{accountId}/grant":{"post":{"tags":["Directory"],"summary":"Grant account a role","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountGrant"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/account/org-admins

> List organization admins

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Account":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"grants":{"type":"array","items":{"$ref":"#/components/schemas/AccountGrant"}}},"required":["id","email","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"AccountGrant":{"type":"object","properties":{"orgId":{"type":"string","format":"uuid"},"role":{"type":"string"},"employeeId":{"type":"string","format":"uuid"}},"required":["role"]}}},"paths":{"/api/v1/account/org-admins":{"get":{"tags":["Directory"],"summary":"List organization admins","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Account"}}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/account/{accountId}/employees

> List employees for account

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Employee":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organization":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"emails":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeEmail"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/EntityGroupMembership"}},"managers":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeManager"}},"profile":{"$ref":"#/components/schemas/EmployeeProfile"},"account":{"type":"string","format":"uuid"},"authentication":{"$ref":"#/components/schemas/EmployeeAccount"},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","organization","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"EmployeeEmail":{"type":"object","properties":{"email":{"type":"string"},"primary":{"type":"boolean"}},"required":["email","primary"]},"EntityGroupMembership":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["entityType","entityId","type"]},"EmployeeManager":{"type":"object","properties":{"managerId":{"type":"string","format":"uuid"},"type":{"type":"string"},"since":{"type":"string","format":"date-time"}},"required":["managerId","type","since"]},"EmployeeProfile":{"type":"object","properties":{"employeeNumber":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"bio":{"type":"string"},"profileImage":{"type":"string"},"birthDate":{"type":"string","format":"date"},"gender":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"joinDate":{"type":"string","format":"date"},"companyRole":{"type":"string"}}},"EmployeeAccount":{"type":"object","properties":{"account":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"email":{"type":"string"},"role":{"type":"string"}},"required":["account","createdAt","email","role"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/account/{accountId}/employees":{"get":{"tags":["Directory"],"summary":"List employees for account","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Employee"}}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/account/for-org

> List accounts for organization

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Account":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"grants":{"type":"array","items":{"$ref":"#/components/schemas/AccountGrant"}}},"required":["id","email","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"AccountGrant":{"type":"object","properties":{"orgId":{"type":"string","format":"uuid"},"role":{"type":"string"},"employeeId":{"type":"string","format":"uuid"}},"required":["role"]}}},"paths":{"/api/v1/account/for-org":{"get":{"tags":["Directory"],"summary":"List accounts for organization","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Account"}}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/employee

> List employees

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Employee":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organization":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"emails":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeEmail"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/EntityGroupMembership"}},"managers":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeManager"}},"profile":{"$ref":"#/components/schemas/EmployeeProfile"},"account":{"type":"string","format":"uuid"},"authentication":{"$ref":"#/components/schemas/EmployeeAccount"},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","organization","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"EmployeeEmail":{"type":"object","properties":{"email":{"type":"string"},"primary":{"type":"boolean"}},"required":["email","primary"]},"EntityGroupMembership":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["entityType","entityId","type"]},"EmployeeManager":{"type":"object","properties":{"managerId":{"type":"string","format":"uuid"},"type":{"type":"string"},"since":{"type":"string","format":"date-time"}},"required":["managerId","type","since"]},"EmployeeProfile":{"type":"object","properties":{"employeeNumber":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"bio":{"type":"string"},"profileImage":{"type":"string"},"birthDate":{"type":"string","format":"date"},"gender":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"joinDate":{"type":"string","format":"date"},"companyRole":{"type":"string"}}},"EmployeeAccount":{"type":"object","properties":{"account":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"email":{"type":"string"},"role":{"type":"string"}},"required":["account","createdAt","email","role"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/employee":{"get":{"tags":["Directory"],"summary":"List employees","parameters":[{"name":"status","in":"query","schema":{"type":"string"}},{"name":"type","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Employee"}}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## POST /api/v1/employee

> Create employee

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"EmployeeRequest":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"account":{"type":"string","format":"uuid"},"role":{"type":"string"}},"required":["name","email"]},"Employee":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organization":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"emails":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeEmail"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/EntityGroupMembership"}},"managers":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeManager"}},"profile":{"$ref":"#/components/schemas/EmployeeProfile"},"account":{"type":"string","format":"uuid"},"authentication":{"$ref":"#/components/schemas/EmployeeAccount"},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","organization","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"EmployeeEmail":{"type":"object","properties":{"email":{"type":"string"},"primary":{"type":"boolean"}},"required":["email","primary"]},"EntityGroupMembership":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["entityType","entityId","type"]},"EmployeeManager":{"type":"object","properties":{"managerId":{"type":"string","format":"uuid"},"type":{"type":"string"},"since":{"type":"string","format":"date-time"}},"required":["managerId","type","since"]},"EmployeeProfile":{"type":"object","properties":{"employeeNumber":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"bio":{"type":"string"},"profileImage":{"type":"string"},"birthDate":{"type":"string","format":"date"},"gender":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"joinDate":{"type":"string","format":"date"},"companyRole":{"type":"string"}}},"EmployeeAccount":{"type":"object","properties":{"account":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"email":{"type":"string"},"role":{"type":"string"}},"required":["account","createdAt","email","role"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/employee":{"post":{"tags":["Directory"],"summary":"Create employee","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Employee"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/employee/{employee}

> Get employee

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Employee":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organization":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"emails":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeEmail"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/EntityGroupMembership"}},"managers":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeManager"}},"profile":{"$ref":"#/components/schemas/EmployeeProfile"},"account":{"type":"string","format":"uuid"},"authentication":{"$ref":"#/components/schemas/EmployeeAccount"},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","organization","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"EmployeeEmail":{"type":"object","properties":{"email":{"type":"string"},"primary":{"type":"boolean"}},"required":["email","primary"]},"EntityGroupMembership":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["entityType","entityId","type"]},"EmployeeManager":{"type":"object","properties":{"managerId":{"type":"string","format":"uuid"},"type":{"type":"string"},"since":{"type":"string","format":"date-time"}},"required":["managerId","type","since"]},"EmployeeProfile":{"type":"object","properties":{"employeeNumber":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"bio":{"type":"string"},"profileImage":{"type":"string"},"birthDate":{"type":"string","format":"date"},"gender":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"joinDate":{"type":"string","format":"date"},"companyRole":{"type":"string"}}},"EmployeeAccount":{"type":"object","properties":{"account":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"email":{"type":"string"},"role":{"type":"string"}},"required":["account","createdAt","email","role"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/employee/{employee}":{"get":{"tags":["Directory"],"summary":"Get employee","parameters":[{"name":"employee","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Employee"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## PATCH /api/v1/employee/{employee}

> Update employee

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"EmployeeRequest":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"account":{"type":"string","format":"uuid"},"role":{"type":"string"}},"required":["name","email"]},"Employee":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organization":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"emails":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeEmail"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/EntityGroupMembership"}},"managers":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeManager"}},"profile":{"$ref":"#/components/schemas/EmployeeProfile"},"account":{"type":"string","format":"uuid"},"authentication":{"$ref":"#/components/schemas/EmployeeAccount"},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","organization","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"EmployeeEmail":{"type":"object","properties":{"email":{"type":"string"},"primary":{"type":"boolean"}},"required":["email","primary"]},"EntityGroupMembership":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["entityType","entityId","type"]},"EmployeeManager":{"type":"object","properties":{"managerId":{"type":"string","format":"uuid"},"type":{"type":"string"},"since":{"type":"string","format":"date-time"}},"required":["managerId","type","since"]},"EmployeeProfile":{"type":"object","properties":{"employeeNumber":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"bio":{"type":"string"},"profileImage":{"type":"string"},"birthDate":{"type":"string","format":"date"},"gender":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"joinDate":{"type":"string","format":"date"},"companyRole":{"type":"string"}}},"EmployeeAccount":{"type":"object","properties":{"account":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"email":{"type":"string"},"role":{"type":"string"}},"required":["account","createdAt","email","role"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/employee/{employee}":{"patch":{"tags":["Directory"],"summary":"Update employee","parameters":[{"name":"employee","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Employee"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/employee/by-name/{name}

> Get employees by name

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Employee":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organization":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"emails":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeEmail"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/EntityGroupMembership"}},"managers":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeManager"}},"profile":{"$ref":"#/components/schemas/EmployeeProfile"},"account":{"type":"string","format":"uuid"},"authentication":{"$ref":"#/components/schemas/EmployeeAccount"},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","organization","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"EmployeeEmail":{"type":"object","properties":{"email":{"type":"string"},"primary":{"type":"boolean"}},"required":["email","primary"]},"EntityGroupMembership":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["entityType","entityId","type"]},"EmployeeManager":{"type":"object","properties":{"managerId":{"type":"string","format":"uuid"},"type":{"type":"string"},"since":{"type":"string","format":"date-time"}},"required":["managerId","type","since"]},"EmployeeProfile":{"type":"object","properties":{"employeeNumber":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"bio":{"type":"string"},"profileImage":{"type":"string"},"birthDate":{"type":"string","format":"date"},"gender":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"joinDate":{"type":"string","format":"date"},"companyRole":{"type":"string"}}},"EmployeeAccount":{"type":"object","properties":{"account":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"email":{"type":"string"},"role":{"type":"string"}},"required":["account","createdAt","email","role"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/employee/by-name/{name}":{"get":{"tags":["Directory"],"summary":"Get employees by name","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Employee"}}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/employee/{employee}/managers

> List managers of employee

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"EmployeeManager":{"type":"object","properties":{"managerId":{"type":"string","format":"uuid"},"type":{"type":"string"},"since":{"type":"string","format":"date-time"}},"required":["managerId","type","since"]}}},"paths":{"/api/v1/employee/{employee}/managers":{"get":{"tags":["Directory"],"summary":"List managers of employee","parameters":[{"name":"employee","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeManager"}}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## POST /api/v1/employee/{employee}/managers

> Set managers for employee

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"EmployeeManagerRequest":{"type":"object","properties":{"managerId":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["managerId","type"]},"Employee":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organization":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"emails":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeEmail"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/EntityGroupMembership"}},"managers":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeManager"}},"profile":{"$ref":"#/components/schemas/EmployeeProfile"},"account":{"type":"string","format":"uuid"},"authentication":{"$ref":"#/components/schemas/EmployeeAccount"},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","organization","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"EmployeeEmail":{"type":"object","properties":{"email":{"type":"string"},"primary":{"type":"boolean"}},"required":["email","primary"]},"EntityGroupMembership":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["entityType","entityId","type"]},"EmployeeManager":{"type":"object","properties":{"managerId":{"type":"string","format":"uuid"},"type":{"type":"string"},"since":{"type":"string","format":"date-time"}},"required":["managerId","type","since"]},"EmployeeProfile":{"type":"object","properties":{"employeeNumber":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"bio":{"type":"string"},"profileImage":{"type":"string"},"birthDate":{"type":"string","format":"date"},"gender":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"joinDate":{"type":"string","format":"date"},"companyRole":{"type":"string"}}},"EmployeeAccount":{"type":"object","properties":{"account":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"email":{"type":"string"},"role":{"type":"string"}},"required":["account","createdAt","email","role"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/employee/{employee}/managers":{"post":{"tags":["Directory"],"summary":"Set managers for employee","parameters":[{"name":"employee","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeManagerRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Employee"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## DELETE /api/v1/employee/{employee}/managers/{manager}

> Remove manager from employee

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/api/v1/employee/{employee}/managers/{manager}":{"delete":{"tags":["Directory"],"summary":"Remove manager from employee","parameters":[{"name":"employee","in":"path","required":true,"schema":{"type":"string"}},{"name":"manager","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/employee/{employee}/profile

> Get employee profile

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"EmployeeProfile":{"type":"object","properties":{"employeeNumber":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"bio":{"type":"string"},"profileImage":{"type":"string"},"birthDate":{"type":"string","format":"date"},"gender":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"joinDate":{"type":"string","format":"date"},"companyRole":{"type":"string"}}}}},"paths":{"/api/v1/employee/{employee}/profile":{"get":{"tags":["Directory"],"summary":"Get employee profile","parameters":[{"name":"employee","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeProfile"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## POST /api/v1/employee/{employee}/profile

> Create or replace employee profile

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"EmployeeProfile":{"type":"object","properties":{"employeeNumber":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"bio":{"type":"string"},"profileImage":{"type":"string"},"birthDate":{"type":"string","format":"date"},"gender":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"joinDate":{"type":"string","format":"date"},"companyRole":{"type":"string"}}},"Employee":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organization":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"emails":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeEmail"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/EntityGroupMembership"}},"managers":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeManager"}},"profile":{"$ref":"#/components/schemas/EmployeeProfile"},"account":{"type":"string","format":"uuid"},"authentication":{"$ref":"#/components/schemas/EmployeeAccount"},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","organization","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"EmployeeEmail":{"type":"object","properties":{"email":{"type":"string"},"primary":{"type":"boolean"}},"required":["email","primary"]},"EntityGroupMembership":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["entityType","entityId","type"]},"EmployeeManager":{"type":"object","properties":{"managerId":{"type":"string","format":"uuid"},"type":{"type":"string"},"since":{"type":"string","format":"date-time"}},"required":["managerId","type","since"]},"EmployeeAccount":{"type":"object","properties":{"account":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"email":{"type":"string"},"role":{"type":"string"}},"required":["account","createdAt","email","role"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/employee/{employee}/profile":{"post":{"tags":["Directory"],"summary":"Create or replace employee profile","parameters":[{"name":"employee","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeProfile"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Employee"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## PATCH /api/v1/employee/{employee}/profile

> Update employee profile

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"EmployeeProfile":{"type":"object","properties":{"employeeNumber":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"bio":{"type":"string"},"profileImage":{"type":"string"},"birthDate":{"type":"string","format":"date"},"gender":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"joinDate":{"type":"string","format":"date"},"companyRole":{"type":"string"}}},"Employee":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organization":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"emails":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeEmail"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/EntityGroupMembership"}},"managers":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeManager"}},"profile":{"$ref":"#/components/schemas/EmployeeProfile"},"account":{"type":"string","format":"uuid"},"authentication":{"$ref":"#/components/schemas/EmployeeAccount"},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","organization","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"EmployeeEmail":{"type":"object","properties":{"email":{"type":"string"},"primary":{"type":"boolean"}},"required":["email","primary"]},"EntityGroupMembership":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["entityType","entityId","type"]},"EmployeeManager":{"type":"object","properties":{"managerId":{"type":"string","format":"uuid"},"type":{"type":"string"},"since":{"type":"string","format":"date-time"}},"required":["managerId","type","since"]},"EmployeeAccount":{"type":"object","properties":{"account":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"email":{"type":"string"},"role":{"type":"string"}},"required":["account","createdAt","email","role"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/employee/{employee}/profile":{"patch":{"tags":["Directory"],"summary":"Update employee profile","parameters":[{"name":"employee","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeProfile"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Employee"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/employee/by-account/{accountId}

> Get employee by account ID

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Employee":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organization":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"emails":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeEmail"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/EntityGroupMembership"}},"managers":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeManager"}},"profile":{"$ref":"#/components/schemas/EmployeeProfile"},"account":{"type":"string","format":"uuid"},"authentication":{"$ref":"#/components/schemas/EmployeeAccount"},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","organization","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"EmployeeEmail":{"type":"object","properties":{"email":{"type":"string"},"primary":{"type":"boolean"}},"required":["email","primary"]},"EntityGroupMembership":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["entityType","entityId","type"]},"EmployeeManager":{"type":"object","properties":{"managerId":{"type":"string","format":"uuid"},"type":{"type":"string"},"since":{"type":"string","format":"date-time"}},"required":["managerId","type","since"]},"EmployeeProfile":{"type":"object","properties":{"employeeNumber":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"bio":{"type":"string"},"profileImage":{"type":"string"},"birthDate":{"type":"string","format":"date"},"gender":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"joinDate":{"type":"string","format":"date"},"companyRole":{"type":"string"}}},"EmployeeAccount":{"type":"object","properties":{"account":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"email":{"type":"string"},"role":{"type":"string"}},"required":["account","createdAt","email","role"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/employee/by-account/{accountId}":{"get":{"tags":["Directory"],"summary":"Get employee by account ID","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Employee"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/employee/by-manager/{managerId}

> List reports for manager

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Employee":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organization":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"emails":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeEmail"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/EntityGroupMembership"}},"managers":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeManager"}},"profile":{"$ref":"#/components/schemas/EmployeeProfile"},"account":{"type":"string","format":"uuid"},"authentication":{"$ref":"#/components/schemas/EmployeeAccount"},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","organization","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"EmployeeEmail":{"type":"object","properties":{"email":{"type":"string"},"primary":{"type":"boolean"}},"required":["email","primary"]},"EntityGroupMembership":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["entityType","entityId","type"]},"EmployeeManager":{"type":"object","properties":{"managerId":{"type":"string","format":"uuid"},"type":{"type":"string"},"since":{"type":"string","format":"date-time"}},"required":["managerId","type","since"]},"EmployeeProfile":{"type":"object","properties":{"employeeNumber":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"bio":{"type":"string"},"profileImage":{"type":"string"},"birthDate":{"type":"string","format":"date"},"gender":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"joinDate":{"type":"string","format":"date"},"companyRole":{"type":"string"}}},"EmployeeAccount":{"type":"object","properties":{"account":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"email":{"type":"string"},"role":{"type":"string"}},"required":["account","createdAt","email","role"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/employee/by-manager/{managerId}":{"get":{"tags":["Directory"],"summary":"List reports for manager","parameters":[{"name":"managerId","in":"path","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Employee"}}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/group

> List groups

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Group":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"organization":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"profile":{"$ref":"#/components/schemas/GroupProfile"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/EntityGroupMembership"}},"members":{"type":"array","items":{"$ref":"#/components/schemas/GroupMember"}}},"required":["id","type","organization","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"GroupProfile":{"type":"object","properties":{"icon":{"type":"string"},"description":{"type":"string"}}},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]},"EntityGroupMembership":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["entityType","entityId","type"]},"GroupMember":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"},"since":{"type":"string","format":"date-time"}},"required":["entityType","entityId","type","since"]}}},"paths":{"/api/v1/group":{"get":{"tags":["Directory"],"summary":"List groups","parameters":[{"name":"status","in":"query","schema":{"type":"string"}},{"name":"type","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Group"}}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## POST /api/v1/group

> Create group

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"GroupRequest":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"]},"Group":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"organization":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"profile":{"$ref":"#/components/schemas/GroupProfile"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/EntityGroupMembership"}},"members":{"type":"array","items":{"$ref":"#/components/schemas/GroupMember"}}},"required":["id","type","organization","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"GroupProfile":{"type":"object","properties":{"icon":{"type":"string"},"description":{"type":"string"}}},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]},"EntityGroupMembership":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["entityType","entityId","type"]},"GroupMember":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"},"since":{"type":"string","format":"date-time"}},"required":["entityType","entityId","type","since"]}}},"paths":{"/api/v1/group":{"post":{"tags":["Directory"],"summary":"Create group","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Group"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/group/{id}

> Get group

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Group":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"organization":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"profile":{"$ref":"#/components/schemas/GroupProfile"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/EntityGroupMembership"}},"members":{"type":"array","items":{"$ref":"#/components/schemas/GroupMember"}}},"required":["id","type","organization","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"GroupProfile":{"type":"object","properties":{"icon":{"type":"string"},"description":{"type":"string"}}},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]},"EntityGroupMembership":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["entityType","entityId","type"]},"GroupMember":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"},"since":{"type":"string","format":"date-time"}},"required":["entityType","entityId","type","since"]}}},"paths":{"/api/v1/group/{id}":{"get":{"tags":["Directory"],"summary":"Get group","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Group"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## PATCH /api/v1/group/{id}

> Update group

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"GroupRequest":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"]},"Group":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"organization":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"profile":{"$ref":"#/components/schemas/GroupProfile"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/EntityGroupMembership"}},"members":{"type":"array","items":{"$ref":"#/components/schemas/GroupMember"}}},"required":["id","type","organization","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"GroupProfile":{"type":"object","properties":{"icon":{"type":"string"},"description":{"type":"string"}}},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]},"EntityGroupMembership":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["entityType","entityId","type"]},"GroupMember":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"},"since":{"type":"string","format":"date-time"}},"required":["entityType","entityId","type","since"]}}},"paths":{"/api/v1/group/{id}":{"patch":{"tags":["Directory"],"summary":"Update group","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Group"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/group/{group}/profile

> Get group profile

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"GroupProfile":{"type":"object","properties":{"icon":{"type":"string"},"description":{"type":"string"}}}}},"paths":{"/api/v1/group/{group}/profile":{"get":{"tags":["Directory"],"summary":"Get group profile","parameters":[{"name":"group","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupProfile"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## POST /api/v1/group/{group}/profile

> Create or replace group profile

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"GroupProfile":{"type":"object","properties":{"icon":{"type":"string"},"description":{"type":"string"}}},"Group":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"organization":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"profile":{"$ref":"#/components/schemas/GroupProfile"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/EntityGroupMembership"}},"members":{"type":"array","items":{"$ref":"#/components/schemas/GroupMember"}}},"required":["id","type","organization","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]},"EntityGroupMembership":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["entityType","entityId","type"]},"GroupMember":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"},"since":{"type":"string","format":"date-time"}},"required":["entityType","entityId","type","since"]}}},"paths":{"/api/v1/group/{group}/profile":{"post":{"tags":["Directory"],"summary":"Create or replace group profile","parameters":[{"name":"group","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupProfile"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Group"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## PATCH /api/v1/group/{group}/profile

> Update group profile

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"GroupProfile":{"type":"object","properties":{"icon":{"type":"string"},"description":{"type":"string"}}},"Group":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"organization":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"profile":{"$ref":"#/components/schemas/GroupProfile"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/EntityGroupMembership"}},"members":{"type":"array","items":{"$ref":"#/components/schemas/GroupMember"}}},"required":["id","type","organization","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]},"EntityGroupMembership":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["entityType","entityId","type"]},"GroupMember":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"},"since":{"type":"string","format":"date-time"}},"required":["entityType","entityId","type","since"]}}},"paths":{"/api/v1/group/{group}/profile":{"patch":{"tags":["Directory"],"summary":"Update group profile","parameters":[{"name":"group","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupProfile"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Group"}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/group/{groupId}/members

> List group members

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"EntityInfo":{"type":"object","properties":{"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"},"organization":{"type":"string","format":"uuid"}},"required":["entityId","type"]},"Employee":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organization":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/StatusInfo"},"created":{"$ref":"#/components/schemas/CreationInfo"},"emails":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeEmail"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/EntityGroupMembership"}},"managers":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeManager"}},"profile":{"$ref":"#/components/schemas/EmployeeProfile"},"account":{"type":"string","format":"uuid"},"authentication":{"$ref":"#/components/schemas/EmployeeAccount"},"preferences":{"$ref":"#/components/schemas/NamespacedPreferences"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/EntityMapping"}}},"required":["id","organization","name","active","status","created"]},"StatusInfo":{"type":"object","properties":{"current":{"type":"string"},"changedAt":{"type":"string","format":"date-time"},"changedBy":{"type":"string","format":"uuid"}},"required":["current"]},"CreationInfo":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string","format":"uuid"}},"required":["createdAt"]},"EmployeeEmail":{"type":"object","properties":{"email":{"type":"string"},"primary":{"type":"boolean"}},"required":["email","primary"]},"EntityGroupMembership":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["entityType","entityId","type"]},"EmployeeManager":{"type":"object","properties":{"managerId":{"type":"string","format":"uuid"},"type":{"type":"string"},"since":{"type":"string","format":"date-time"}},"required":["managerId","type","since"]},"EmployeeProfile":{"type":"object","properties":{"employeeNumber":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"bio":{"type":"string"},"profileImage":{"type":"string"},"birthDate":{"type":"string","format":"date"},"gender":{"type":"string"},"timezone":{"type":"string"},"location":{"type":"string"},"joinDate":{"type":"string","format":"date"},"companyRole":{"type":"string"}}},"EmployeeAccount":{"type":"object","properties":{"account":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"email":{"type":"string"},"role":{"type":"string"}},"required":["account","createdAt","email","role"]},"NamespacedPreferences":{"type":"object","properties":{"namespace":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["namespace","values"]},"EntityMapping":{"type":"object","properties":{"app":{"type":"string","format":"uuid"},"namespace":{"type":"string"},"mappedId":{"type":"string"},"reference":{"type":"string"},"mappingData":{"type":"object","additionalProperties":{"type":"string"}},"mappingSecrets":{"type":"object","additionalProperties":{"type":"string"}}},"required":["app","mappedId","mappingData","mappingSecrets"]}}},"paths":{"/api/v1/group/{groupId}/members":{"get":{"tags":["Directory"],"summary":"List group members","parameters":[{"name":"groupId","in":"path","required":true,"schema":{"type":"string"}},{"name":"entity","in":"query","schema":{"type":"string"}},{"name":"membership","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/EntityInfo"},{"$ref":"#/components/schemas/Employee"}]}}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## GET /api/v1/entity/{entity}/groups

> Get entity groups

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"EntityGroupMembership":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["entityType","entityId","type"]}}},"paths":{"/api/v1/entity/{entity}/groups":{"get":{"tags":["Directory"],"summary":"Get entity groups","parameters":[{"name":"entity","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EntityGroupMembership"}}}}},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## POST /api/v1/entity/{entity}/groups

> Set groups for entity

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/api/v1/entity/{entity}/groups":{"post":{"tags":["Directory"],"summary":"Set groups for entity","parameters":[{"name":"entity","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"groupId":{"type":"string","format":"uuid"},"type":{"type":"string"}}}}}}},"responses":{"200":{"description":"OK"},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```

## DELETE /api/v1/entity/{entity}/groups/{group}

> Remove entity from group

```json
{"openapi":"3.1.0","info":{"title":"Peoplelogic API","version":"1.0.0"},"tags":[{"name":"Directory","description":"The Directory API gives you access to Organizations, Accounts, Employees and Groups.  Every Entity within the subsequent API calls must have an Organization attached and API calls must be made with a User specific JWT."}],"servers":[{"url":"https://api.peoplelogic.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/api/v1/entity/{entity}/groups/{group}":{"delete":{"tags":["Directory"],"summary":"Remove entity from group","parameters":[{"name":"entity","in":"path","required":true,"schema":{"type":"string"}},{"name":"group","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Bad Request – invalid request payload."},"401":{"description":"Unauthorized – missing or invalid JWT."},"403":{"description":"Forbidden – insufficient permissions."},"404":{"description":"Not Found – no Entity with that ID."}}}}}}
```
