# User Applications

## Get a list of users applications.

> Retrieve a list of the users applications.

```json
{"openapi":"3.0.3","info":{"title":"Runai API","version":"2.21"},"tags":[{"name":"User Applications"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"schemas":{"UserApps":{"type":"array","items":{"$ref":"#/components/schemas/UserApp"}},"UserApp":{"type":"object","required":["name","id","clientId","createdAt","lastLogin"],"properties":{"name":{"type":"string"},"clientId":{"type":"string"},"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time","nullable":true},"lastLogin":{"type":"string","format":"date-time","nullable":true}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/user-applications":{"get":{"summary":"Get a list of users applications.","description":"Retrieve a list of the users applications.","operationId":"get_user_applications","tags":["User Applications"],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserApps"}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Create a user application.

> Used to create a user application.

```json
{"openapi":"3.0.3","info":{"title":"Runai API","version":"2.21"},"tags":[{"name":"User Applications"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"schemas":{"UserAppCreationRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string","pattern":"^[a-z][-_a-z0-9]*[a-z0-9]$","description":"The name of the user application. The name must be unique within the user's applications list and can only contain lowercase alphanumeric characters and hyphens. It must start and end with a letter."}}},"UserAppPostResponse":{"type":"object","required":["id","name","secret","clientId","createdAt"],"properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"secret":{"type":"string"},"createdAt":{"format":"date-time","nullable":true,"type":"string"}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409Conflict":{"description":"The specified resource already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/user-applications":{"post":{"summary":"Create a user application.","description":"Used to create a user application.","operationId":"create_user_application","tags":["User Applications"],"requestBody":{"description":"Application object to create","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAppCreationRequest"}}}},"responses":{"201":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAppPostResponse"}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"409":{"$ref":"#/components/responses/409Conflict"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Get user application by id.

> Retrieve the details of a user's application by app id.

```json
{"openapi":"3.0.3","info":{"title":"Runai API","version":"2.21"},"tags":[{"name":"User Applications"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"appId":{"name":"appId","in":"path","required":true,"description":"The application id to retrieve","schema":{"type":"string"}}},"schemas":{"UserApp":{"type":"object","required":["name","id","clientId","createdAt","lastLogin"],"properties":{"name":{"type":"string"},"clientId":{"type":"string"},"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time","nullable":true},"lastLogin":{"type":"string","format":"date-time","nullable":true}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/user-applications/{appId}":{"get":{"summary":"Get user application by id.","description":"Retrieve the details of a user's application by app id.","operationId":"get_user_application_by_id","tags":["User Applications"],"parameters":[{"$ref":"#/components/parameters/appId"}],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserApp"}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Delete a user application byid.

> Use to user a user application by id.

```json
{"openapi":"3.0.3","info":{"title":"Runai API","version":"2.21"},"tags":[{"name":"User Applications"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"appId":{"name":"appId","in":"path","required":true,"description":"The application id to retrieve","schema":{"type":"string"}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}}},"paths":{"/api/v1/user-applications/{appId}":{"delete":{"summary":"Delete a user application byid.","description":"Use to user a user application by id.","operationId":"delete_user_application_by_id","tags":["User Applications"],"parameters":[{"$ref":"#/components/parameters/appId"}],"responses":{"204":{"description":"Executed successfully."},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Regenerate a user application secret.

> Use to regenerate the user application secret by id.

```json
{"openapi":"3.0.3","info":{"title":"Runai API","version":"2.21"},"tags":[{"name":"User Applications"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"appId":{"name":"appId","in":"path","required":true,"description":"The application id to retrieve","schema":{"type":"string"}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}}},"paths":{"/api/v1/user-applications/{appId}/secret":{"post":{"summary":"Regenerate a user application secret.","description":"Use to regenerate the user application secret by id.","operationId":"regenerate_user_application_secret","tags":["User Applications"],"parameters":[{"$ref":"#/components/parameters/appId"}],"responses":{"200":{"description":"Regenerated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"secret":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Get a list of all users applications.

> Retrieve a list of all users applications.

```json
{"openapi":"3.0.3","info":{"title":"Runai API","version":"2.21"},"tags":[{"name":"User Applications"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"schemas":{"UserAppsAdministration":{"type":"array","items":{"$ref":"#/components/schemas/UserAppAdministration"}},"UserAppAdministration":{"type":"object","required":["name","id","clientId","createdBy","createdAt","lastLogin"],"properties":{"name":{"type":"string"},"id":{"type":"string"},"clientId":{"type":"string"},"createdBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time","nullable":true},"lastLogin":{"type":"string","format":"date-time","nullable":true}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/administration/user-applications":{"get":{"summary":"Get a list of all users applications.","description":"Retrieve a list of all users applications.","operationId":"get_user_applications_administration","tags":["User Applications"],"parameters":[{"description":"Filter results by clientId","in":"query","name":"clientId","required":false,"schema":{"type":"string"}},{"description":"Filter results by creatdBy","in":"query","name":"createdBy","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAppsAdministration"}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Delete a user application by id for adminstrations.

> Use to delete a user application by id for adminstrations.

```json
{"openapi":"3.0.3","info":{"title":"Runai API","version":"2.21"},"tags":[{"name":"User Applications"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"appId":{"name":"appId","in":"path","required":true,"description":"The application id to retrieve","schema":{"type":"string"}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}}},"paths":{"/api/v1/administration/user-applications/{appId}":{"delete":{"summary":"Delete a user application by id for adminstrations.","description":"Use to delete a user application by id for adminstrations.","operationId":"delete_user_application_by_id_administration","tags":["User Applications"],"parameters":[{"$ref":"#/components/parameters/appId"}],"responses":{"204":{"description":"Executed successfully."},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```
