# Service Accounts

Service accounts enable programmatic access to the NVIDIA Run:ai API, allowing applications or automated systems to authenticate and interact securely. Each service account is associated with an access key which includes a client ID and secret used to generate access token. Service accounts can be managed organization-wide or with a defined scope.

## Get a list of service accounts.

> Retrieve a list of service accounts.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Service Accounts","description":"Service accounts enable programmatic access to the NVIDIA Run:ai API, allowing applications or automated systems to authenticate and interact securely. \nEach service account is associated with an access key which includes a client ID and secret used to generate access token. \nService accounts can be managed organization-wide or with a defined scope.\n"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"schemas":{"ServiceAccounts":{"type":"array","minItems":0,"maxItems":1000,"items":{"$ref":"#/components/schemas/ServiceAccount"}},"ServiceAccount":{"type":"object","required":["name","createdBy","createdAt","updatedAt","enabled","lastLogin","id","clientId"],"properties":{"name":{"type":"string","description":"The name of the service account."},"createdBy":{"type":"string","description":"The email address of the user who created the service account."},"createdAt":{"type":"string","format":"date-time","nullable":true,"description":"The timestamp for when the service account was created."},"updatedAt":{"type":"string","format":"date-time","nullable":true,"description":"The timestamp for when the service account was last updated."},"enabled":{"type":"boolean","description":"Indicates whether the service account is enabled."},"tenantId":{"type":"string","description":"The unique identifier of the tenant."},"lastLogin":{"type":"string","format":"date-time","nullable":true,"description":"The timestamp of the last time the service account was used to authenticate."},"id":{"type":"string","description":"The unique identifier of the service account."},"clientId":{"type":"string","description":"The client identifier associated with the service account. Used when requesting authentication tokens."}}},"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"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/service-accounts":{"get":{"summary":"Get a list of service accounts.","description":"Retrieve a list of service accounts.","operationId":"get_service_accounts","tags":["Service Accounts"],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceAccounts"}}}},"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"}}}}}}
```

## Create a service account.

> Used to create a service account.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Service Accounts","description":"Service accounts enable programmatic access to the NVIDIA Run:ai API, allowing applications or automated systems to authenticate and interact securely. \nEach service account is associated with an access key which includes a client ID and secret used to generate access token. \nService accounts can be managed organization-wide or with a defined scope.\n"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"schemas":{"ServiceAccountCreationRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string","pattern":"^[a-z][-_a-z0-9]*[a-z0-9]$","description":"The name of the service account. The name must be unique within the organization and can only contain lowercase alphanumeric characters and hyphens. It must start and end with a letter.","minLength":2,"maxLength":255}}},"ServiceAccountPostResponse":{"type":"object","required":["id","name","clientSecret"],"properties":{"id":{"type":"string","description":"The unique identifier of the service account."},"name":{"type":"string","description":"The name of the service account."},"clientSecret":{"type":"string","description":"Secret credential paired with the client ID. Used to obtain authentication tokens. Displayed only once upon creation."},"clientId":{"type":"string","description":"The client identifier associated with the service account. Used when requesting authentication tokens."}}},"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"}}}},"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/service-accounts":{"post":{"summary":"Create a service account.","description":"Used to create a service account.","operationId":"create_service_account","tags":["Service Accounts"],"requestBody":{"description":"Service account object to create","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceAccountCreationRequest"}}}},"responses":{"201":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceAccountPostResponse"}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"409":{"$ref":"#/components/responses/409Conflict"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Get service account by id.

> Retrieve the details of a service account by id.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Service Accounts","description":"Service accounts enable programmatic access to the NVIDIA Run:ai API, allowing applications or automated systems to authenticate and interact securely. \nEach service account is associated with an access key which includes a client ID and secret used to generate access token. \nService accounts can be managed organization-wide or with a defined scope.\n"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"serviceAccountId":{"name":"serviceAccountId","in":"path","required":true,"description":"Service account id","schema":{"type":"string"}}},"schemas":{"ServiceAccount":{"type":"object","required":["name","createdBy","createdAt","updatedAt","enabled","lastLogin","id","clientId"],"properties":{"name":{"type":"string","description":"The name of the service account."},"createdBy":{"type":"string","description":"The email address of the user who created the service account."},"createdAt":{"type":"string","format":"date-time","nullable":true,"description":"The timestamp for when the service account was created."},"updatedAt":{"type":"string","format":"date-time","nullable":true,"description":"The timestamp for when the service account was last updated."},"enabled":{"type":"boolean","description":"Indicates whether the service account is enabled."},"tenantId":{"type":"string","description":"The unique identifier of the tenant."},"lastLogin":{"type":"string","format":"date-time","nullable":true,"description":"The timestamp of the last time the service account was used to authenticate."},"id":{"type":"string","description":"The unique identifier of the service account."},"clientId":{"type":"string","description":"The client identifier associated with the service account. Used when requesting authentication tokens."}}},"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"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/service-accounts/{serviceAccountId}":{"get":{"summary":"Get service account by id.","description":"Retrieve the details of a service account by id.","operationId":"get_service_account_by_id","tags":["Service Accounts"],"parameters":[{"$ref":"#/components/parameters/serviceAccountId"}],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceAccount"}}}},"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"}}}}}}
```

## Delete a service account by id.

> Use to delete a service account by id.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Service Accounts","description":"Service accounts enable programmatic access to the NVIDIA Run:ai API, allowing applications or automated systems to authenticate and interact securely. \nEach service account is associated with an access key which includes a client ID and secret used to generate access token. \nService accounts can be managed organization-wide or with a defined scope.\n"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"serviceAccountId":{"name":"serviceAccountId","in":"path","required":true,"description":"Service account id","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/service-accounts/{serviceAccountId}":{"delete":{"summary":"Delete a service account by id.","description":"Use to delete a service account by id.","operationId":"delete_service_account_by_id","tags":["Service Accounts"],"parameters":[{"$ref":"#/components/parameters/serviceAccountId"}],"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"}}}}}}
```

## Update service account details by id.

> Use to update the details of a service account by id.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Service Accounts","description":"Service accounts enable programmatic access to the NVIDIA Run:ai API, allowing applications or automated systems to authenticate and interact securely. \nEach service account is associated with an access key which includes a client ID and secret used to generate access token. \nService accounts can be managed organization-wide or with a defined scope.\n"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"serviceAccountId":{"name":"serviceAccountId","in":"path","required":true,"description":"Service account id","schema":{"type":"string"}}},"schemas":{"ServiceAccountPatchRequest":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean","description":"Indicates whether the service account is enabled."}}},"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"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/service-accounts/{serviceAccountId}":{"patch":{"summary":"Update service account details by id.","description":"Use to update the details of a service account by id.","operationId":"update_service_account_by_id","tags":["Service Accounts"],"parameters":[{"$ref":"#/components/parameters/serviceAccountId"}],"requestBody":{"description":"Service account object that needs to be updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceAccountPatchRequest"}}}},"responses":{"200":{"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 service account secret.

> Use to regenerate the service account secret by id.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Service Accounts","description":"Service accounts enable programmatic access to the NVIDIA Run:ai API, allowing applications or automated systems to authenticate and interact securely. \nEach service account is associated with an access key which includes a client ID and secret used to generate access token. \nService accounts can be managed organization-wide or with a defined scope.\n"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"serviceAccountId":{"name":"serviceAccountId","in":"path","required":true,"description":"Service account id","schema":{"type":"string"}}},"schemas":{"RegenerateServiceAccountSecretResponse":{"type":"object","properties":{"clientSecret":{"type":"string","description":"Secret credential paired with the client ID. Used to obtain authentication tokens. Displayed only once upon regeneration."}}},"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"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/service-accounts/{serviceAccountId}/secret":{"post":{"summary":"Regenerate a service account secret.","description":"Use to regenerate the service account secret by id.","operationId":"regenerate_service_account_secret","tags":["Service Accounts"],"parameters":[{"$ref":"#/components/parameters/serviceAccountId"}],"responses":{"200":{"description":"Regenerated successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegenerateServiceAccountSecretResponse"}}}},"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"}}}}}}
```
