# PrivateApplication

## GET /api/v1/private-application/{id}

> Get Private Application

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"PrivateApplicationViewModelResponse":{"required":["Data"],"type":"object","properties":{"data":{"$ref":"#/components/schemas/PrivateApplicationViewModel"}},"additionalProperties":false},"PrivateApplicationViewModel":{"required":["CustomTokenClaims","DefaultTokenLifetimeDays","Name"],"type":"object","properties":{"name":{"type":"string","description":"Name of the application"},"description":{"type":"string","description":"Description of the application","nullable":true},"defaultTokenLifetimeDays":{"maximum":730,"minimum":1,"type":"integer","description":"Default token lifetime in days","format":"int32"},"customTokenClaims":{"type":"object","description":"Custom token claims"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags for the application"},"id":{"type":"integer","description":"Id of the application","format":"int64"},"modifier":{"type":"string","description":"Modifier of the application"},"modifiedUtc":{"type":"string","description":"Last modified date of the application","format":"date-time"},"hasTokens":{"type":"boolean","description":"Indicates if the application contains tokens"},"hasActiveTokens":{"type":"boolean","description":"Indicates if the application contains not revoked tokens"},"nextTokenExpiry":{"type":"string","description":"Next token expiry date","format":"date-time","nullable":true}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/private-application/{id}":{"get":{"tags":["PrivateApplication"],"summary":"Get Private Application","operationId":"SinglePrivateApplication","parameters":[{"name":"id","in":"path","description":"Private Application Id","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Private Application found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivateApplicationViewModelResponse"}}}},"404":{"description":"Private Application not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## PUT /api/v1/private-application/{id}

> Update Private Application

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"ModifyApplicationModel":{"required":["CustomTokenClaims","DefaultTokenLifetimeDays","Name"],"type":"object","properties":{"name":{"type":"string","description":"Name of the application"},"description":{"type":"string","description":"Description of the application","nullable":true},"defaultTokenLifetimeDays":{"maximum":730,"minimum":1,"type":"integer","description":"Default token lifetime in days","format":"int32"},"customTokenClaims":{"type":"object","description":"Custom token claims"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags for the application"}},"additionalProperties":false},"Int64Response":{"required":["Data"],"type":"object","properties":{"data":{"type":"integer","description":"Response data","format":"int64"}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/private-application/{id}":{"put":{"tags":["PrivateApplication"],"summary":"Update Private Application","parameters":[{"name":"id","in":"path","description":"Private Application Id","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"description":"Private Application model","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModifyApplicationModel"}}}},"responses":{"200":{"description":"Private Application updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Int64Response"}}}},"400":{"description":"Could not create token","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Private Application not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"410":{"description":"Private Application is deleted","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## DELETE /api/v1/private-application/{id}

> Delete Private Application

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/private-application/{id}":{"delete":{"tags":["PrivateApplication"],"summary":"Delete Private Application","parameters":[{"name":"id","in":"path","description":"Private Application Id","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"204":{"description":"Private Application deleted"},"404":{"description":"Private Application not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Can't delete Private Application with active tokens","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## List Private Applications

> If response data is empty there were no Private Applications found with the chosen filters

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"FilterMode":{"enum":["Or","And"],"type":"string"},"PrivateApplicationViewModelListResponse":{"required":["Data"],"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PrivateApplicationViewModel"},"description":"Response data","nullable":true}},"additionalProperties":false},"PrivateApplicationViewModel":{"required":["CustomTokenClaims","DefaultTokenLifetimeDays","Name"],"type":"object","properties":{"name":{"type":"string","description":"Name of the application"},"description":{"type":"string","description":"Description of the application","nullable":true},"defaultTokenLifetimeDays":{"maximum":730,"minimum":1,"type":"integer","description":"Default token lifetime in days","format":"int32"},"customTokenClaims":{"type":"object","description":"Custom token claims"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags for the application"},"id":{"type":"integer","description":"Id of the application","format":"int64"},"modifier":{"type":"string","description":"Modifier of the application"},"modifiedUtc":{"type":"string","description":"Last modified date of the application","format":"date-time"},"hasTokens":{"type":"boolean","description":"Indicates if the application contains tokens"},"hasActiveTokens":{"type":"boolean","description":"Indicates if the application contains not revoked tokens"},"nextTokenExpiry":{"type":"string","description":"Next token expiry date","format":"date-time","nullable":true}},"additionalProperties":false}}},"paths":{"/api/v1/private-application":{"get":{"tags":["PrivateApplication"],"summary":"List Private Applications","description":"If response data is empty there were no Private Applications found with the chosen filters","operationId":"ListPrivateApplications","parameters":[{"name":"NameFilter","in":"query","description":"Filter by name of the application","schema":{"type":"string","description":"Filter by name of the application"}},{"name":"DescriptionFilter","in":"query","description":"Filter by description of the application","schema":{"type":"string","description":"Filter by description of the application"}},{"name":"TokenContentFilter","in":"query","description":"Filter by token content","schema":{"type":"string","description":"Filter by token content"}},{"name":"FilterMode","in":"query","schema":{"$ref":"#/components/schemas/FilterMode"}},{"name":"TokenExpiringWithinDays","in":"query","description":"Filter by tokens expiring within X days","schema":{"type":"integer","description":"Filter by tokens expiring within X days","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivateApplicationViewModelListResponse"}}}}}}}}}
```

## POST /api/v1/private-application

> Create Private Application

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"ModifyApplicationModel":{"required":["CustomTokenClaims","DefaultTokenLifetimeDays","Name"],"type":"object","properties":{"name":{"type":"string","description":"Name of the application"},"description":{"type":"string","description":"Description of the application","nullable":true},"defaultTokenLifetimeDays":{"maximum":730,"minimum":1,"type":"integer","description":"Default token lifetime in days","format":"int32"},"customTokenClaims":{"type":"object","description":"Custom token claims"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags for the application"}},"additionalProperties":false},"Int64Response":{"required":["Data"],"type":"object","properties":{"data":{"type":"integer","description":"Response data","format":"int64"}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/private-application":{"post":{"tags":["PrivateApplication"],"summary":"Create Private Application","requestBody":{"description":"Private Application model","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModifyApplicationModel"}}}},"responses":{"201":{"description":"Private Application created","headers":{"Location":{"description":"Location of the created Private Application","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Int64Response"}}}},"400":{"description":"Token content is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Private Application with the same name already exists","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## List Private Application Tokens

> If response data is empty there were no tokens found for the Private Application

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"FilterMode":{"enum":["Or","And"],"type":"string"},"PrivateApplicationTokensResponseResponse":{"required":["Data"],"type":"object","properties":{"data":{"$ref":"#/components/schemas/PrivateApplicationTokensResponse"}},"additionalProperties":false},"PrivateApplicationTokensResponse":{"required":["tokens"],"type":"object","properties":{"tokenCount":{"type":"integer","format":"int32"},"tokens":{"type":"array","items":{"$ref":"#/components/schemas/PrivateApplicationTokenViewModel"}}},"additionalProperties":false},"PrivateApplicationTokenViewModel":{"type":"object","properties":{"id":{"type":"integer","description":"Id of the token","format":"int64"},"name":{"type":"string","description":"Name of the token"},"expiryTimeUtc":{"type":"string","description":"Expiry time of the token","format":"date-time"},"createTimeUtc":{"type":"string","description":"Create time of the token","format":"date-time"},"tokenClaims":{"type":"object","description":"Token claims"},"creator":{"type":"string","description":"Creator of the token"},"revoker":{"type":"string","description":"Revoker of the token","nullable":true},"revokeTimeUtc":{"type":"string","description":"Revoked time of the token","format":"date-time","nullable":true},"revokeReason":{"type":"string","description":"Reason for revoking the token","nullable":true},"fullToken":{"type":"string","description":"Raw token"},"payloadOnly":{"type":"string","description":"Only payload part of the token"}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/private-application/{id}/tokens":{"get":{"tags":["PrivateApplication"],"summary":"List Private Application Tokens","description":"If response data is empty there were no tokens found for the Private Application","parameters":[{"name":"id","in":"path","description":"Private Application Id","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"PageNumber","in":"query","schema":{"type":"integer","format":"int32"}},{"name":"PageSize","in":"query","schema":{"type":"integer","format":"int32"}},{"name":"NameFilter","in":"query","description":"Filter by name of the token","schema":{"type":"string","description":"Filter by name of the token"}},{"name":"IsExpiredFilter","in":"query","description":"Filter by token expiry status","schema":{"type":"boolean","description":"Filter by token expiry status"}},{"name":"IsRevokedFilter","in":"query","description":"Filter by token revocation status","schema":{"type":"boolean","description":"Filter by token revocation status"}},{"name":"ClaimKeyFilter","in":"query","description":"Filter by token claim key","schema":{"type":"string","description":"Filter by token claim key"}},{"name":"FilterMode","in":"query","schema":{"$ref":"#/components/schemas/FilterMode"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivateApplicationTokensResponseResponse"}}}},"404":{"description":"Private Application or Private Application token not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## POST /api/v1/private-application/{id}/tokens

> Create Private Application Token

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"PrivateApplicationTokenCreateModel":{"required":["Name"],"type":"object","properties":{"name":{"type":"string","description":"Name of the token"},"tokenLifetimeDays":{"type":"integer","description":"Token lifetime in days","format":"int32","nullable":true},"tokenClaims":{"type":"object","description":"Token claims"}},"additionalProperties":false},"Int64Response":{"required":["Data"],"type":"object","properties":{"data":{"type":"integer","description":"Response data","format":"int64"}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/private-application/{id}/tokens":{"post":{"tags":["PrivateApplication"],"summary":"Create Private Application Token","parameters":[{"name":"id","in":"path","description":"Private Application Id","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"description":"Private Application Token model","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivateApplicationTokenCreateModel"}}}},"responses":{"201":{"description":"Private Application token created","headers":{"Location":{"description":"Location of the created Private Application Token","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Int64Response"}}}},"404":{"description":"Private Application not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## GET /api/v1/private-application/{id}/tokens/{tokenId}

> Get Private Application Token

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"PrivateApplicationTokenViewModelResponse":{"required":["Data"],"type":"object","properties":{"data":{"$ref":"#/components/schemas/PrivateApplicationTokenViewModel"}},"additionalProperties":false},"PrivateApplicationTokenViewModel":{"type":"object","properties":{"id":{"type":"integer","description":"Id of the token","format":"int64"},"name":{"type":"string","description":"Name of the token"},"expiryTimeUtc":{"type":"string","description":"Expiry time of the token","format":"date-time"},"createTimeUtc":{"type":"string","description":"Create time of the token","format":"date-time"},"tokenClaims":{"type":"object","description":"Token claims"},"creator":{"type":"string","description":"Creator of the token"},"revoker":{"type":"string","description":"Revoker of the token","nullable":true},"revokeTimeUtc":{"type":"string","description":"Revoked time of the token","format":"date-time","nullable":true},"revokeReason":{"type":"string","description":"Reason for revoking the token","nullable":true},"fullToken":{"type":"string","description":"Raw token"},"payloadOnly":{"type":"string","description":"Only payload part of the token"}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/private-application/{id}/tokens/{tokenId}":{"get":{"tags":["PrivateApplication"],"summary":"Get Private Application Token","operationId":"SinglePrivateApplicationToken","parameters":[{"name":"id","in":"path","description":"Private Application Id","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"tokenId","in":"path","description":"Private Application Token Id","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Private Application token found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivateApplicationTokenViewModelResponse"}}}},"404":{"description":"Private Application or Private Application token not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## POST /api/v1/private-application/{id}/tokens/{tokenId}

> Regenerate Private Application Token

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"Int64Response":{"required":["Data"],"type":"object","properties":{"data":{"type":"integer","description":"Response data","format":"int64"}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/private-application/{id}/tokens/{tokenId}":{"post":{"tags":["PrivateApplication"],"summary":"Regenerate Private Application Token","parameters":[{"name":"id","in":"path","description":"Private Application Id","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"tokenId","in":"path","description":"Private Application Token Id","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"201":{"description":"Private Application token regenerated","headers":{"Location":{"description":"Location of the created Private Application Token","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Int64Response"}}}},"404":{"description":"Private Application not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## POST /api/v1/private-application/{id}/tokens/revocation

> Revoke all tokens of Private Application

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"Int32Response":{"required":["Data"],"type":"object","properties":{"data":{"type":"integer","description":"Response data","format":"int32"}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/private-application/{id}/tokens/revocation":{"post":{"tags":["PrivateApplication"],"summary":"Revoke all tokens of Private Application","parameters":[{"name":"id","in":"path","description":"Private Application Id","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"description":"Revocation reason","content":{"application/json":{"schema":{"type":"string"}}}},"responses":{"200":{"description":"Number of Private Application Tokens revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Int32Response"}}}},"404":{"description":"Private Application not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## POST /api/v1/private-application/{id}/tokens/{tokenId}/revocation

> Revoke token of Private Application

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/private-application/{id}/tokens/{tokenId}/revocation":{"post":{"tags":["PrivateApplication"],"summary":"Revoke token of Private Application","parameters":[{"name":"id","in":"path","description":"Private Application Id","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"tokenId","in":"path","description":"Private Application Token Id","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"description":"Token revocation reason","content":{"application/json":{"schema":{"type":"string"}}}},"responses":{"200":{"description":"Private Application token revoked"},"404":{"description":"Private Application not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```
