# Subscriptions

Use to manage notifications subscriptions.

## Get user subscriptions

> Get user subscriptions

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Subscriptions","description":"Use to manage notifications subscriptions."}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"schemas":{"Subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/Subscription"}},"Subscription":{"type":"object","required":["events","channels"],"allOf":[{"$ref":"#/components/schemas/SubscriptionForPut"},{"type":"object","properties":{"id":{"type":"string","maxLength":100}}}]},"SubscriptionForPut":{"type":"object","required":["events","channels"],"properties":{"events":{"$ref":"#/components/schemas/SubscriptionEvents"},"channels":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":100}}},"SubscriptionEvents":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionEvent"},"minItems":0,"maxItems":100},"SubscriptionEvent":{"type":"object","required":["category","types"],"properties":{"category":{"type":"string"},"types":{"type":"array","items":{"type":"string"}}}},"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"}}}},"501NotImplemented":{"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/subscriptions":{"get":{"tags":["Subscriptions"],"operationId":"getUserSubscriptions","summary":"Get user subscriptions","description":"Get user subscriptions","responses":{"200":{"description":"User subscriptions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscriptions"}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"501":{"$ref":"#/components/responses/501NotImplemented"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Create user subscription

> Create user subscription

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Subscriptions","description":"Use to manage notifications subscriptions."}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"schemas":{"Subscription":{"type":"object","required":["events","channels"],"allOf":[{"$ref":"#/components/schemas/SubscriptionForPut"},{"type":"object","properties":{"id":{"type":"string","maxLength":100}}}]},"SubscriptionForPut":{"type":"object","required":["events","channels"],"properties":{"events":{"$ref":"#/components/schemas/SubscriptionEvents"},"channels":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":100}}},"SubscriptionEvents":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionEvent"},"minItems":0,"maxItems":100},"SubscriptionEvent":{"type":"object","required":["category","types"],"properties":{"category":{"type":"string"},"types":{"type":"array","items":{"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"}}}},"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"}}}},"501NotImplemented":{"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/subscriptions":{"post":{"tags":["Subscriptions"],"operationId":"createSubscription","summary":"Create user subscription","description":"Create user subscription","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"responses":{"200":{"description":"Subscription created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"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"},"501":{"$ref":"#/components/responses/501NotImplemented"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Update user subscription

> Update user subscription

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Subscriptions","description":"Use to manage notifications subscriptions."}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"schemas":{"SubscriptionForPut":{"type":"object","required":["events","channels"],"properties":{"events":{"$ref":"#/components/schemas/SubscriptionEvents"},"channels":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":100}}},"SubscriptionEvents":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionEvent"},"minItems":0,"maxItems":100},"SubscriptionEvent":{"type":"object","required":["category","types"],"properties":{"category":{"type":"string"},"types":{"type":"array","items":{"type":"string"}}}},"Subscription":{"type":"object","required":["events","channels"],"allOf":[{"$ref":"#/components/schemas/SubscriptionForPut"},{"type":"object","properties":{"id":{"type":"string","maxLength":100}}}]},"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"}}}},"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"}}}},"501NotImplemented":{"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/subscriptions/{id}":{"put":{"tags":["Subscriptions"],"operationId":"updateSubscription","summary":"Update user subscription","description":"Update user subscription","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionForPut"}}}},"responses":{"200":{"description":"Subscription created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"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"},"501":{"$ref":"#/components/responses/501NotImplemented"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Delete user subscription

> Delete user subscription

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Subscriptions","description":"Use to manage notifications subscriptions."}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"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"}}}},"501NotImplemented":{"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/subscriptions/{id}":{"delete":{"tags":["Subscriptions"],"operationId":"deleteSubscription","summary":"Delete user subscription","description":"Delete user subscription","responses":{"204":{"description":"Subscription deleted 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"},"501":{"$ref":"#/components/responses/501NotImplemented"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```
